public async Task <UserRole> CreateNewRole(NewUserRole role, DiscordServerContext discordServer) { var permissionsValue = role.Permissions.GetRawValue(); var guild = await this._restClient.GetGuildAsync(discordServer.Id); var restRole = await guild.CreateRoleAsync(role.Name, new GuildPermissions(permissionsValue), isMentionable : false); var userRole = new UserRoleFactory().Create(restRole); return(userRole); }
public static async Task <UserRole> CreateNewRole(NewUserRole role, DiscordServerContext discordServer) { var permissionsValue = role.Permissions.GetRawValue(); var guild = await _restClient.GetGuildAsync(discordServer.Id); var createRoleTask = guild.CreateRoleAsync(role.Name, new GuildPermissions(permissionsValue)); var restRole = createRoleTask.Result; var userRole = new UserRoleFactory().Create(restRole); return(userRole); }
public UserRole CreateNewRole(DiscordServerContext server, NewUserRole userRole) { return(Server.CreateNewRole(userRole, server).Result); }
private async Task <UserRole> SetRoleToServer(DiscordServerContext server, NewUserRole mutedRole) { return(await this._usersRolesService.CreateNewRole(server, mutedRole)); }
internal static Task <UserRole> CreateNewRole(NewUserRole role, DiscordServerContext discordServer) { return(_discordClient.RolesService.CreateNewRole(role, discordServer)); }
public async Task <UserRole> CreateNewRole(DiscordServerContext server, NewUserRole userRole) { return(await Server.CreateNewRole(userRole, server)); }
private UserRole SetRoleToServer(DiscordServerContext server, NewUserRole mutedRole) { return(_usersRolesService.CreateNewRole(server, mutedRole)); }