From cea954a7cdcc822c2cbd0d6e91471a5326852cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=A8=D0=B8?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD=D1=81=D0=BA=D0=B8=D0=B9?= Date: Fri, 17 Nov 2023 00:13:33 +0300 Subject: [PATCH] hotfix? --- Controllers/WeatherForecastController.cs | 3 ++- JusticeHandler.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Controllers/WeatherForecastController.cs b/Controllers/WeatherForecastController.cs index 8aac24b..ead55d4 100644 --- a/Controllers/WeatherForecastController.cs +++ b/Controllers/WeatherForecastController.cs @@ -29,7 +29,8 @@ namespace DiscordApp.Controllers await Console.Out.WriteLineAsync(guild.Name); var channel = guild.GetChannel(channelid) as ITextChannel; await Console.Out.WriteLineAsync(channel.Name); - var message = (channel.GetMessagesAsync().FlattenAsync().Result).FirstOrDefault(k => k.Id == 1166079976446103602) as IUserMessage; + var messages = (channel.GetMessagesAsync().FlattenAsync().Result); + var message = messages.Where(k => k.Id == Startup.discordSocketClient.GetApplicationInfoAsync().Result.Id && k.Type != MessageType.ThreadStarterMessage) as IUserMessage; await Console.Out.WriteLineAsync(message.Author.GlobalName); await message.ModifyAsync(func => { diff --git a/JusticeHandler.cs b/JusticeHandler.cs index 4abcc60..4bfeb78 100644 --- a/JusticeHandler.cs +++ b/JusticeHandler.cs @@ -30,7 +30,7 @@ namespace DiscordApp { client.Ready += ReadyAsync; handler.Log += LogAsync; - + await handler.AddModulesAsync(Assembly.GetEntryAssembly(), services); var guildCommand = new SlashCommandBuilder();