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) {
|
async sendMessage(request, nrc_msg) {
|
||||||
const channel_id = this.controller.config.get('ClusterChatSync.discord_channel_mapping')[request.instanceName];
|
const channel_id = this.controller.config.get('ClusterChatSync.discord_channel_mapping')[request.instanceName];
|
||||||
if (!channel_id) return;
|
if (!channel_id) return;
|
||||||
|
let channel;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let channel = await this.client.channels.fetch(channel_id);
|
channel = await this.client.channels.fetch(channel_id);
|
||||||
|
|
||||||
if (channel === null) {
|
if (channel === null) {
|
||||||
this.logger.error(`[Chat Sync] Discord Channel ID ${channel_id} not found.`);
|
this.logger.error(`[Chat Sync] Discord Channel ID ${channel_id} not found.`);
|
||||||
@@ -125,9 +126,7 @@ class ControllerPlugin extends BaseControllerPlugin {
|
|||||||
if (nrc_lindex !== -1) {
|
if (nrc_lindex !== -1) {
|
||||||
nrc_cmsg = nrc_cmsg.slice(0, nrc_lindex);
|
nrc_cmsg = nrc_cmsg.slice(0, nrc_lindex);
|
||||||
nrc_msg = nrc_msg.slice(nrc_lindex).trim();
|
nrc_msg = nrc_msg.slice(nrc_lindex).trim();
|
||||||
} else {
|
} else {nrc_msg = nrc_msg.slice(MAX_DISCORD_MESSAGE_LENGTH).trim();}
|
||||||
nrc_msg = nrc_msg.slice(MAX_DISCORD_MESSAGE_LENGTH).trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
await channel.send(nrc_cmsg, {allowedMentions: {parse: []}});
|
await channel.send(nrc_cmsg, {allowedMentions: {parse: []}});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user