diff --git a/backend/src/plugins/Logs/util/log.ts b/backend/src/plugins/Logs/util/log.ts index 0e5b75d3..aed24f3f 100644 --- a/backend/src/plugins/Logs/util/log.ts +++ b/backend/src/plugins/Logs/util/log.ts @@ -112,14 +112,14 @@ export async function log(pluginData: GuildPluginData, type: Log setTimeout(async () => { const batchedMessage = pluginData.state.batches.get(channel.id)!.join("\n"); pluginData.state.batches.delete(channel.id); - createChunkedMessage(channel, batchedMessage, cfg.allow_user_mentions).catch(noop); + createChunkedMessage(channel, batchedMessage, { users: cfg.allow_user_mentions }).catch(noop); }, batchTime); } pluginData.state.batches.get(channel.id)!.push(message); } else { // If we're not batching log messages, just send them immediately - await createChunkedMessage(channel, message, cfg.allow_user_mentions).catch(noop); + await createChunkedMessage(channel, message, { users: cfg.allow_user_mentions }).catch(noop); } } } diff --git a/backend/src/utils.ts b/backend/src/utils.ts index 2ddc82c6..ee9a3033 100644 --- a/backend/src/utils.ts +++ b/backend/src/utils.ts @@ -1,4 +1,5 @@ import { + AllowedMentions, Attachment, Client, Constants, @@ -751,11 +752,11 @@ export function chunkMessageLines(str: string, maxChunkLength = 1990): string[] export async function createChunkedMessage( channel: TextableChannel, messageText: string, - allowUserPings: boolean = true, + allowedMentions?: AllowedMentions, ) { const chunks = chunkMessageLines(messageText); for (const chunk of chunks) { - await channel.createMessage({ content: chunk, allowedMentions: { users: allowUserPings } }); + await channel.createMessage({ content: chunk, allowedMentions }); } }