public async Task AgreeToTheRules() { if (Context.IsPrivate == true) { return; } if (!RoleCheck.HasClerkRole((SocketGuildUser)Context.User) && !RoleCheck.HasDiplomatRole((SocketGuildUser)Context.User)) { var guildUser = Context.User as IGuildUser; var memberRole = Context.Guild.GetRole(RoleIds.roles.applicantID); await guildUser.AddRoleAsync(memberRole); var user = Context.User; await Context.Channel.SendMessageAsync($"{user.Mention} has agreed to the rules and is a {memberRole}"); } }
public async Task Diplomat(SocketGuildUser user, [Remainder] string guild) { if (Context.IsPrivate == true) { return; } var diplomatLog = Global.Client.GetGuild(Config.bot.guildID).GetTextChannel(ChannelIds.channels.diplomatLogID); if (RoleCheck.HasInvestmentStaffRole((SocketGuildUser)Context.User) || RoleCheck.HasRecruiterRole((SocketGuildUser)Context.User)) { if (RoleCheck.HasClerkRole((SocketGuildUser)user)) { await ReplyAsync("Role conflict. Unable to assign the Diplomat role."); return; } var target = user as IGuildUser; var memberRole = Context.Guild.GetRole(RoleIds.roles.diplomatID); await target.AddRoleAsync(memberRole); await diplomatLog.SendMessageAsync($"{target.Mention} is from the {guild}"); } }