Commit 9ffcfc3b authored by Morgân von Brylân's avatar Morgân von Brylân

Le SPOY ignore désormais le message supprimé par la commande >imite.

parent 674b8371
......@@ -76,6 +76,7 @@ const Discord = require("discord.js"),
SPOY: auth.spoy.server,
bbCategory: null
},
deleteIgnore = [],
tagRegexp = /[^#]+#[0-9]{4}/g,
......@@ -510,6 +511,10 @@ client.on("error", error);
function handleDeletedMsg(msg)
{
for(let i = 0 ; i < deleteIgnore.length ; i++)
if(deleteIgnore[i] === msg.id)
return deleteIgnore.splice(i, 1);
if(msg.author.bot
|| params.ignoredChannels.includes(msg.channel.id)
|| ( msg.guild && !servers[msg.guild.id].settings.logAdminDeletedMsg && isAdmin(msg.member) )
......@@ -1854,7 +1859,10 @@ function c_imite(msg, prm)
else
{
if(myself.permissionsIn(msg.channel).has(Discord.Permissions.FLAGS.MANAGE_MESSAGES))
{
deleteIgnore.push(msg.id);
msg.delete().catch(error);
}
msg.channel.createWebhook(cible.displayName, cible.user.avatarURL, `Pour imiter ${cible.user.tag}, à la demande de ${msg.author.tag}.`).then(webhook => {
webhook.send(message).then(whMsg => {
......
{
"name": "strun_bah_couille",
"version": "3.1872.11",
"version": "3.1873.0",
"description": "Strun Bah Couille le Crisse-Barbe",
"main": "bot.js",
"repository": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment