mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Ugly workaround/hotfix for message fetching
This commit is contained in:
parent
499511f79d
commit
8da47e53e6
9 changed files with 31 additions and 14 deletions
|
@ -11,6 +11,7 @@ import { LogsPlugin } from "../../Logs/LogsPlugin";
|
|||
import { BOT_SLOWMODE_PERMISSIONS } from "../requiredPermissions";
|
||||
import { SlowmodePluginType } from "../types";
|
||||
import { applyBotSlowmodeToUserId } from "./applyBotSlowmodeToUserId";
|
||||
import { hotfixMessageFetch } from "../../../utils/hotfixMessageFetch";
|
||||
|
||||
export async function onMessageCreate(pluginData: GuildPluginData<SlowmodePluginType>, msg: SavedMessage) {
|
||||
if (msg.is_bot) return;
|
||||
|
@ -49,7 +50,7 @@ export async function onMessageCreate(pluginData: GuildPluginData<SlowmodePlugin
|
|||
// Delete any extra messages sent after a slowmode was already applied
|
||||
const userHasSlowmode = await pluginData.state.slowmodes.userHasSlowmode(channel.id, msg.user_id);
|
||||
if (userHasSlowmode) {
|
||||
const message = await channel.messages.fetch(msg.id as Snowflake);
|
||||
const message = await hotfixMessageFetch(channel, msg.id);
|
||||
if (message) {
|
||||
message.delete();
|
||||
return thisMsgLock.interrupt();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue