From b39b1bf3d1c3a9e128cf684942e9b64b4ad304bc Mon Sep 17 00:00:00 2001 From: Kwoth Date: Tue, 13 Dec 2016 05:56:53 +0100 Subject: [PATCH] Disable global custom reactions with - response --- docs/Custom Reactions.md | 8 ++++++++ src/NadekoBot/Modules/CustomReactions/CustomReactions.cs | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/Custom Reactions.md b/docs/Custom Reactions.md index e5e9cc34..803485d3 100644 --- a/docs/Custom Reactions.md +++ b/docs/Custom Reactions.md @@ -27,6 +27,14 @@ There's no special requirement for the formatting of the response, so we could j Now, if that command was ran in a server, anyone on that server can make the bot mention them, saying `It sure is, @Username` anytime they say "Nice Weather". If the command is ran in a direct message with the bot, then the custom reaction can be used on every server the bot is connected to. +###Block global Custom Reactions +If you want to disable some global custom reactions which you do not like, and you do not want to remove them or you are not the bot owner you can do so by adding a new Custom Reaction with the same trigger on your server, and set the response to `-`. + +For example: +`.acr /o/ -` + +Now if you try to trigger `/o/`, it won't print anything. + ###Placeholders! There are currently three different placeholders which we will look at, with more placeholders potentially coming in the future. diff --git a/src/NadekoBot/Modules/CustomReactions/CustomReactions.cs b/src/NadekoBot/Modules/CustomReactions/CustomReactions.cs index fd96a7fe..b7241f12 100644 --- a/src/NadekoBot/Modules/CustomReactions/CustomReactions.cs +++ b/src/NadekoBot/Modules/CustomReactions/CustomReactions.cs @@ -47,7 +47,8 @@ namespace NadekoBot.Modules.CustomReactions }).Shuffle().FirstOrDefault(); if (reaction != null) { - try { await channel.SendMessageAsync(reaction.ResponseWithContext(umsg)).ConfigureAwait(false); } catch { } + if(reaction.Response != "-") + try { await channel.SendMessageAsync(reaction.ResponseWithContext(umsg)).ConfigureAwait(false); } catch { } return true; } }