mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
AutoDelete: ignore error 10008 Unknown Message
These errors are generally from messages that were deleted either by automod or another bot, so safe to ignore.
This commit is contained in:
parent
eb221859d8
commit
e69b581282
1 changed files with 8 additions and 1 deletions
|
@ -44,7 +44,14 @@ export async function deleteNextItem(pluginData: GuildPluginData<AutoDeletePlugi
|
|||
const timeAndDate = pluginData.getPlugin(TimeAndDatePlugin);
|
||||
|
||||
pluginData.state.guildLogs.ignoreLog(LogType.MESSAGE_DELETE, itemToDelete.message.id);
|
||||
pluginData.client.deleteMessage(itemToDelete.message.channel_id, itemToDelete.message.id).catch(logger.warn);
|
||||
pluginData.client.deleteMessage(itemToDelete.message.channel_id, itemToDelete.message.id).catch(err => {
|
||||
if (err.code === 10008) {
|
||||
// "Unknown Message", probably already deleted by automod or another bot, ignore
|
||||
return;
|
||||
}
|
||||
|
||||
logger.warn(err);
|
||||
});
|
||||
|
||||
const user = await resolveUser(pluginData.client, itemToDelete.message.user_id);
|
||||
const messageDate = timeAndDate
|
||||
|
|
Loading…
Add table
Reference in a new issue