3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 08:45:03 +00:00

Disable mentions in logs, allowing mods to be mentioned (#142)

Optionally you can return to old behavior by setting allow_user_mentions to true
This commit is contained in:
Nils 2021-01-28 00:26:24 +01:00 committed by GitHub
parent 4629936129
commit f4a87e445a
5 changed files with 21 additions and 8 deletions

View file

@ -1,4 +1,5 @@
import {
AllowedMentions,
Attachment,
Client,
Constants,
@ -748,10 +749,14 @@ export function chunkMessageLines(str: string, maxChunkLength = 1990): string[]
});
}
export async function createChunkedMessage(channel: TextableChannel, messageText: string) {
export async function createChunkedMessage(
channel: TextableChannel,
messageText: string,
allowedMentions?: AllowedMentions,
) {
const chunks = chunkMessageLines(messageText);
for (const chunk of chunks) {
await channel.createMessage(chunk);
await channel.createMessage({ content: chunk, allowedMentions });
}
}