3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Allow !clean to delete messages not already saved

If a message is found that is not stored, we save it and then bulk delete
This commit is contained in:
Dark 2021-06-17 02:10:23 +02:00
parent 421f6defaa
commit 2700f4e389
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8
2 changed files with 22 additions and 10 deletions

View file

@ -159,6 +159,12 @@ export class GuildSavedMessages extends BaseGuildRepository {
return this.create({ ...data, ...overrides });
}
async createFromMessages(messages: Message[], overrides = {}) {
for (const msg of messages) {
await this.createFromMsg(msg, overrides);
}
}
async markAsDeleted(id) {
await this.messages
.createQueryBuilder("messages")