diff --git a/KfChatDotNetBot/ChatBot.cs b/KfChatDotNetBot/ChatBot.cs index f4abc9c..c689de8 100644 --- a/KfChatDotNetBot/ChatBot.cs +++ b/KfChatDotNetBot/ChatBot.cs @@ -352,7 +352,7 @@ public class ChatBot private void OnUsersJoined(object sender, List users, UsersJsonModel jsonPayload) { - var settings = Helpers.GetMultipleValues([BuiltIn.Keys.GambaSeshUserId, BuiltIn.Keys.GambaSeshDetectEnabled]) + var settings = Helpers.GetMultipleValues([BuiltIn.Keys.GambaSeshUserId, BuiltIn.Keys.GambaSeshDetectEnabled, BuiltIn.Keys.BotKeesSeen]) .Result; _logger.Debug($"Received {users.Count} user join events"); using var db = new ApplicationDbContext(); @@ -372,6 +372,13 @@ public class ChatBot true); _yatsLastSeen = DateTimeOffset.UtcNow; } + + if (user.Id == 89776 && !settings[BuiltIn.Keys.BotKeesSeen].ToBoolean()) + { + _logger.Info("Kees has joined!"); + SendChatMessage($":!: :!: {user.Username} has appeared! :!: :!:", true); + Helpers.SetValueAsBoolean(BuiltIn.Keys.BotKeesSeen, true).Wait(_cancellationToken); + } _logger.Info($"{user.Username} joined!"); var userDb = db.Users.FirstOrDefault(u => u.KfId == user.Id); diff --git a/KfChatDotNetBot/Settings/BuiltIn.cs b/KfChatDotNetBot/Settings/BuiltIn.cs index 5d2fc65..25ad987 100644 --- a/KfChatDotNetBot/Settings/BuiltIn.cs +++ b/KfChatDotNetBot/Settings/BuiltIn.cs @@ -860,6 +860,16 @@ public static class BuiltIn IsSecret = false, CacheDuration = TimeSpan.FromHours(1), ValueType = SettingValueType.Boolean + }, + new BuiltInSettingsModel + { + Key = Keys.BotKeesSeen, + Regex = "(true|false)", + Description = "Track if Kees has been seen so users can receive a one-time notice if he suddenly shows up", + Default = "false", + IsSecret = false, + CacheDuration = TimeSpan.FromHours(1), + ValueType = SettingValueType.Boolean } ]; @@ -931,5 +941,6 @@ public static class BuiltIn public static string BotChrisDjLiveImage = "Bot.ChrisDjLiveImage"; public static string DiscordTemporarilyBypassGambaSeshInitialValue = "Discord.TemporarilyBypassGambaSeshInitialValue"; + public static string BotKeesSeen = "Bot.KeesSeen"; } } \ No newline at end of file