16 lines
533 B
C#
16 lines
533 B
C#
namespace FluxPose.DiscordBot.Roles;
|
|
|
|
public class Actions<TContext>(Users.Actions usersActions, GatewayClient client, TContext context) : ActionsBase<TContext>(context) where TContext : IInteractionContext
|
|
{
|
|
public async Task<List<Role>> GetRolesFromGuild()
|
|
{
|
|
var roles = (await client.Rest.GetGuildRolesAsync(GuildId)).ToList();
|
|
return roles;
|
|
}
|
|
|
|
public async Task GiveRoleToUser(ulong userId, ulong roleId)
|
|
{
|
|
await client.Rest.AddGuildUserRoleAsync(GuildId, userId, roleId);
|
|
}
|
|
}
|