Added DmHelpTextKeywords to data/bot.yml

- Bot now sends dm help text ONLY if the message contains one of the keywords specified
  - If no keywords are specified, bot will reply to every DM (like before)
- Fixed several commands which used error color for success confirmation messages
This commit is contained in:
Kwoth
2021-09-16 22:51:58 +02:00
parent 81254ed5f6
commit a09be96200
7 changed files with 47 additions and 22 deletions

View File

@@ -44,6 +44,11 @@ namespace NadekoBot.Modules.Help.Services
{
if (string.IsNullOrWhiteSpace(settings.DmHelpText) || settings.DmHelpText == "-")
return Task.CompletedTask;
// only send dm help text if it contains one of the keywords, if they're specified
// if they're not, then reply to every DM
if (settings.DmHelpTextKeywords.Any() && !settings.DmHelpTextKeywords.Any(k => msg.Content.Contains(k)))
return Task.CompletedTask;
var rep = new ReplacementBuilder()
.WithOverride("%prefix%", () => _bss.Data.Prefix)