mirror of
https://github.com/RPCS3/discord-bot.git
synced 2025-02-26 04:36:21 +00:00
add author mention for content filters with custom message
This commit is contained in:
parent
91acda3912
commit
3bdfd0854e
@ -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)
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user