Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
GravityWolfNotAmused committed Jan 13, 2024
1 parent c0a3822 commit 66da2d3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions DiscordPlayerCountBot/DiscordClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@ public static async Task SetChannelName(this IDiscordClient socket, ulong? chann
throw new ArgumentException($"[Bot] - Invalid Channel Id: {channelId}, Channel was not found.");
}

/*
* Keep in mind there is a massive rate limit on this call that is specific to discord, and not Discord.Net
* 2x per 10 minutes
* https://discord.com/developers/docs/topics/rate-limits
* https://www.reddit.com/r/Discord_Bots/comments/qzrl5h/channel_name_edit_rate_limit/
*/

if (channel != null)
{
if (channel is ITextChannel && channel is not IVoiceChannel)
{
gameStatus = gameStatus.Replace('/', '-').Replace(' ', '-').Replace(':', '-');
}
if (channel is ITextChannel && channel is not IVoiceChannel)
{
gameStatus = gameStatus.Replace('/', '-').Replace(' ', '-').Replace(':', '-');
}

//Keep in mind there is a massive rate limit on this call that is specific to discord, and not Discord.Net
//2x per 10 minutes
//https://discord.com/developers/docs/topics/rate-limits
//https://www.reddit.com/r/Discord_Bots/comments/qzrl5h/channel_name_edit_rate_limit/
await channel.ModifyAsync(prop => prop.Name = gameStatus);
}
}
Expand Down

0 comments on commit 66da2d3

Please sign in to comment.