3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +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 dea3c2516c
commit f762a238de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 });
}
}