mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Migrate Logs to new Plugin structure, also dont ignore it
This commit is contained in:
parent
140ba84544
commit
aea019181c
16 changed files with 764 additions and 1 deletions
21
backend/src/plugins/Logs/util/onMessageDeleteBulk.ts
Normal file
21
backend/src/plugins/Logs/util/onMessageDeleteBulk.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { PluginData } from "knub";
|
||||
import { LogsPluginType } from "../types";
|
||||
import { SavedMessage } from "src/data/entities/SavedMessage";
|
||||
import { LogType } from "src/data/LogType";
|
||||
import { getBaseUrl } from "src/pluginUtils";
|
||||
|
||||
export async function onMessageDeleteBulk(pluginData: PluginData<LogsPluginType>, savedMessages: SavedMessage[]) {
|
||||
const channel = pluginData.guild.channels.get(savedMessages[0].channel_id);
|
||||
const archiveId = await pluginData.state.archives.createFromSavedMessages(savedMessages, pluginData.guild);
|
||||
const archiveUrl = pluginData.state.archives.getUrl(getBaseUrl, archiveId);
|
||||
|
||||
pluginData.state.guildLogs.log(
|
||||
LogType.MESSAGE_DELETE_BULK,
|
||||
{
|
||||
count: savedMessages.length,
|
||||
channel,
|
||||
archiveUrl,
|
||||
},
|
||||
savedMessages[0].id,
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue