add author mention for content filters with custom message

This commit is contained in:
13xforever 2019-08-30 15:55:17 +05:00
parent 91acda3912
commit 3bdfd0854e
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,6 @@ namespace CompatBot.Database.Providers
{
internal static class ContentFilter
{
private static readonly object SyncObject = new object();
private static Dictionary<FilterContext, AhoCorasickDoubleArrayTrie<Piracystring>> filters = new Dictionary<FilterContext, AhoCorasickDoubleArrayTrie<Piracystring>>();
static ContentFilter()
@ -150,7 +149,7 @@ namespace CompatBot.Database.Providers
var rules = await client.GetChannelAsync(Config.BotRulesChannelId).ConfigureAwait(false);
msgContent = $"{message.Author.Mention} Please follow the {rules.Mention} and do not discuss piracy on this server. Repeated offence may result in a ban.";
}
await message.Channel.SendMessageAsync(msgContent).ConfigureAwait(false);
await message.Channel.SendMessageAsync($"{message.Author.Mention} {msgContent}").ConfigureAwait(false);
completedActions.Add(FilterAction.SendMessage);
}
catch (Exception e)

View File

@ -9,6 +9,7 @@ namespace Tests
{
[TestCase("2019-8-19 6:00 PT", "2019-08-19T13:00Z")]
[TestCase("2019-8-19 17:00 bst", "2019-08-19T16:00Z")]
[TestCase("2019-9-1 22:00 jst", "2019-09-01T13:00Z")]
public void TimeZoneConverterTest(string input, string utcInput)
{
var utc = DateTime.Parse(utcInput).Normalize();