mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2025-12-27 03:05:21 +09:00
.
This commit is contained in:
@@ -100,9 +100,10 @@ class ControllerPlugin extends BaseControllerPlugin {
|
||||
async sendMessage(request, nrc_msg) {
|
||||
const channel_id = this.controller.config.get('ClusterChatSync.discord_channel_mapping')[request.instanceName];
|
||||
if (!channel_id) return;
|
||||
let channel;
|
||||
|
||||
try {
|
||||
let channel = await this.client.channels.fetch(channel_id);
|
||||
channel = await this.client.channels.fetch(channel_id);
|
||||
|
||||
if (channel === null) {
|
||||
this.logger.error(`[Chat Sync] Discord Channel ID ${channel_id} not found.`);
|
||||
@@ -125,9 +126,7 @@ class ControllerPlugin extends BaseControllerPlugin {
|
||||
if (nrc_lindex !== -1) {
|
||||
nrc_cmsg = nrc_cmsg.slice(0, nrc_lindex);
|
||||
nrc_msg = nrc_msg.slice(nrc_lindex).trim();
|
||||
} else {
|
||||
nrc_msg = nrc_msg.slice(MAX_DISCORD_MESSAGE_LENGTH).trim();
|
||||
}
|
||||
} else {nrc_msg = nrc_msg.slice(MAX_DISCORD_MESSAGE_LENGTH).trim();}
|
||||
|
||||
await channel.send(nrc_cmsg, {allowedMentions: {parse: []}});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user