Skip to content

Commit

Permalink
Fix long dequeues and fix status ratelimiting (ish)
Browse files Browse the repository at this point in the history
  • Loading branch information
joker-119 committed Jun 6, 2022
1 parent 70e451c commit 02956bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions DiscordIntegration.Bot/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ private async void OnReceived(object? sender, ReceivedFullEventArgs ev)
else
await Client.SetStatusAsync(UserStatus.AFK);

await Client.SetActivityAsync(new Game(command.Parameters[0].ToString()));
if (Client.Activity.Name != command.Parameters[0].ToString())
await Client.SetActivityAsync(new Game(command.Parameters[0].ToString()));

break;
}
Expand Down Expand Up @@ -151,8 +152,13 @@ private async Task DequeueMessages()
{
string msg = string.Empty;
string[] split = message.Value.Split('\n');
int i = 0;
while (msg.Length < 1900)
msg += split;
{
msg += split[i];
i++;
}

_ = Guild.GetTextChannel(message.Key).SendMessageAsync(embed: await EmbedBuilderService.CreateBasicEmbed($"Server {ServerNumber} Logs", msg, Color.Green));
messages.Add(message.Key, message.Value.Replace(msg, string.Empty));
}
Expand Down
4 changes: 2 additions & 2 deletions DiscordIntegration.Bot/DiscordIntegration.Bot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyVersion>1.3.0</AssemblyVersion>
<FileVersion>1.3.0</FileVersion>
<AssemblyVersion>1.3.1</AssemblyVersion>
<FileVersion>1.3.1</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 02956bf

Please sign in to comment.