1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-18 16:03:36 +03:00

Ban backticks in /remind

This commit is contained in:
Macintxsh 2024-06-25 22:31:22 +05:00
parent a0e7b3a611
commit ab260eea15
Signed by: mctaylors
GPG key ID: 4EEF4F949A266EE2
4 changed files with 22 additions and 0 deletions

View file

@ -158,6 +158,16 @@ public sealed class RemindCommandGroup : CommandGroup
return await _feedback.SendContextualEmbedResultAsync(failedEmbed, ct: CancellationToken);
}
if (text.Contains('`'))
{
var failedEmbed = new EmbedBuilder()
.WithSmallTitle(Messages.RemindBannedText, bot)
.WithColour(ColorsList.Red)
.Build();
return await _feedback.SendContextualEmbedResultAsync(failedEmbed, ct: CancellationToken);
}
return await AddReminderAsync(timeSpan, text, data, channelId, executor, CancellationToken);
}

View file

@ -1196,5 +1196,11 @@ namespace TeamOctolings.Octobot {
return ResourceManager.GetString("SettingsModeratorRole", resourceCulture);
}
}
internal static string RemindBannedText {
get {
return ResourceManager.GetString("RemindBannedText", resourceCulture);
}
}
}
}

View file

@ -681,4 +681,7 @@
<data name="SettingsModeratorRole" xml:space="preserve">
<value>Moderator role</value>
</data>
<data name="RemindBannedText" xml:space="preserve">
<value>Text contains banned characters!</value>
</data>
</root>

View file

@ -681,4 +681,7 @@
<data name="SettingsModeratorRole" xml:space="preserve">
<value>Роль модератора</value>
</data>
<data name="RemindBannedText" xml:space="preserve">
<value>Текст имеет запрещенные символы!</value>
</data>
</root>