1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-30 02:59:54 +03:00

Discord is broken lmao

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-06-16 17:28:18 +05:00
parent 0eb17a977d
commit cfa1819fd8
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
4 changed files with 22 additions and 25 deletions

View file

@ -87,14 +87,9 @@ public class GuildUpdateService : BackgroundService {
foreach (var memberData in data.MemberData.Values) {
var userIdSnowflake = memberData.Id.ToDiscordSnowflake();
if (!memberData.Roles.Contains(defaultRoleSnowflake)) {
var defaultRoleResult = await _guildApi.AddGuildMemberRoleAsync(
if (defaultRoleSnowflake.Value is not 0 && !memberData.Roles.Contains(defaultRoleSnowflake))
_ = _guildApi.AddGuildMemberRoleAsync(
guildId, userIdSnowflake, defaultRoleSnowflake, ct: ct);
if (!defaultRoleResult.IsSuccess)
_logger.LogWarning(
"Error in automatic default role add request.\n{ErrorMessage}",
defaultRoleResult.Error.Message);
}
if (DateTimeOffset.UtcNow > memberData.BannedUntil) {
var unbanResult = await _guildApi.RemoveGuildBanAsync(