1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-07 22:46:30 +03:00

Implement some unused guild configuration options

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-06-16 13:45:57 +05:00
parent 4702d2fcba
commit 635bf26601
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
5 changed files with 68 additions and 12 deletions

View file

@ -288,3 +288,20 @@ public class GuildScheduledEventDeleteResponder : IResponder<IGuildScheduledEven
guildData.Configuration.EventNotificationChannel.ToDiscordSnowflake(), embeds: new[] { built }, ct: ct);
}
}
/// <summary>
/// Handles updating <see cref="MemberData.Roles" /> when a guild member is updated.
/// </summary>
public class GuildMemberUpdateResponder : IResponder<IGuildMemberUpdate> {
private readonly GuildDataService _dataService;
public GuildMemberUpdateResponder(GuildDataService dataService) {
_dataService = dataService;
}
public async Task<Result> RespondAsync(IGuildMemberUpdate gatewayEvent, CancellationToken ct = default) {
var memberData = await _dataService.GetMemberData(gatewayEvent.GuildID, gatewayEvent.User.ID, ct);
memberData.Roles = gatewayEvent.Roles.ToList();
return Result.FromSuccess();
}
}