Fail-safe the type on the LevelUp:MentionUser tag

This commit is contained in:
Daniel_I_Am 2020-08-11 04:12:27 +02:00
parent 23d8db2a4d
commit 79ff643a2e
No known key found for this signature in database
GPG Key ID: 80C428FCC9743E84

View File

@ -70,7 +70,7 @@ namespace ChaosBot.Discord.Services
ConfigurationRepository.GetValue<string>("LevelUp:Channel", context.Guild.Id, "false"); ConfigurationRepository.GetValue<string>("LevelUp:Channel", context.Guild.Id, "false");
string mentionString = $"<@{context.User.Id}>"; string mentionString = $"<@{context.User.Id}>";
if (!ConfigurationRepository.GetValue<bool>("LevelUp:MentionUser", context.Guild.Id, true)) if (!Convert.ToBoolean(ConfigurationRepository.GetValue<string>("LevelUp:MentionUser", context.Guild.Id, "true")))
{ {
mentionString = context.User.Username; mentionString = context.User.Username;
if (context.User is IGuildUser guildUser) if (context.User is IGuildUser guildUser)