mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2026-11-11 15:14:52 +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;
|
||||
}
|
||||
|
||||
if (channel === null || !channel.isTextBased()) {
|
||||
logger.error(`[Chat Sync] Discord Channel ID ${channelId} is not a usable text channel.`);
|
||||
if (channel === null || !channel.isSendable()) {
|
||||
logger.error(`[Chat Sync] Discord Channel ID ${channelId} is not a usable channel.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const textChannel = channel;
|
||||
|
||||
let nrcMsg = message;
|
||||
|
||||
if (controller.config.get('ClusterChatSync.datetime_on_message')) {
|
||||
@@ -90,7 +88,7 @@ export default async function(context: ControllerPluginContext) {
|
||||
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) {
|
||||
await send(nrcMsg);
|
||||
|
||||
Reference in new issue
Block a user