mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2026-11-26 08:13:12 +09:00
.
This commit is contained in:
1 parent
b56904e8ae
commit
75a35437c6
1 file changed
+3
-5
+3
-5
@@ -74,13 +74,11 @@ export default async function(context: ControllerPluginContext) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channel === null || !channel.isTextBased()) {
|
if (channel === null || !channel.isSendable()) {
|
||||||
logger.error(`[Chat Sync] Discord Channel ID ${channelId} is not a usable text channel.`);
|
logger.error(`[Chat Sync] Discord Channel ID ${channelId} is not a usable channel.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const textChannel = channel;
|
|
||||||
|
|
||||||
let nrcMsg = message;
|
let nrcMsg = message;
|
||||||
|
|
||||||
if (controller.config.get('ClusterChatSync.datetime_on_message')) {
|
if (controller.config.get('ClusterChatSync.datetime_on_message')) {
|
||||||
@@ -90,7 +88,7 @@ export default async function(context: ControllerPluginContext) {
|
|||||||
nrcMsg = `${stamp} ${nrcMsg}`;
|
nrcMsg = `${stamp} ${nrcMsg}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const send = (content: string) => textChannel.send({content, allowedMentions: {parse: []}});
|
const send = (content: string) => channel.send({content, allowedMentions: {parse: []}});
|
||||||
|
|
||||||
if (nrcMsg.length <= MAX_DISCORD_MESSAGE_LENGTH) {
|
if (nrcMsg.length <= MAX_DISCORD_MESSAGE_LENGTH) {
|
||||||
await send(nrcMsg);
|
await send(nrcMsg);
|
||||||
|
|||||||
Reference in new issue
Block a user