This commit is contained in:
phidias authored and GitHub committed 2026-10-09 18:33:44 +09:00
1 parent b56904e8ae
commit 75a35437c6
1 file changed
+3 -5
+3 -5
View File
@@ -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);