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:
parent
4702d2fcba
commit
635bf26601
5 changed files with 68 additions and 12 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue