From 7885106266511cd463a188afdd1e226bd26529b6 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Mon, 11 Jul 2022 02:57:24 +0200 Subject: [PATCH] Bot should no longer always notify server level gains --- src/NadekoBot/Modules/Xp/XpService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/Modules/Xp/XpService.cs b/src/NadekoBot/Modules/Xp/XpService.cs index b55606355..719b4624d 100644 --- a/src/NadekoBot/Modules/Xp/XpService.cs +++ b/src/NadekoBot/Modules/Xp/XpService.cs @@ -318,8 +318,11 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand long newLevel, XpNotificationLocation notifyLoc) { - var user = await _client.GetUserAsync(userId); + if (notifyLoc == XpNotificationLocation.None) + return; + var guild = _client.GetGuild(guildId); + var user = guild?.GetUser(userId); var ch = guild?.GetTextChannel(channelId); if (user is null || guild is null)