public static EmbedBuilder UnconfirmedEmbed(bool adminConfirmed, MinecraftGuild minecraftGuild, ulong guildId, List <bool> confirmedMembers) { EmbedBuilder embed; StringBuilder description = new StringBuilder(); description.AppendLine($"Admin Confirmation: {(adminConfirmed ? "Granted" : "*Pending*")}"); for (int i = 0; i < minecraftGuild.MemberIds.Count; i++) { ulong memberId = (ulong)minecraftGuild.MemberIds[i]; SocketGuildUser member = null; SocketGuild guild = BotCore.Client.GetGuild(guildId); if (guild != null) { member = guild.GetUser(memberId); } description.AppendLine($"{(member == null ? memberId.ToString() : member.Mention)} Founding Membership Confirmation: {(confirmedMembers[i] ? "Granted" : "*Pending*")}"); } embed = new EmbedBuilder() { Title = $"Founding of Guild \"{minecraftGuild.Name}\" - Waiting for confirmations", Color = minecraftGuild.DiscordColor, Description = description.ToString() }; return(embed); }
public GuildCreationInteractiveMessage(IUserMessage message, MinecraftGuild guild) : base(message, expirationTime: EXPIRATIONDELAY) { Guild = guild; ConfirmedMembers = new List <bool>(new bool[guild.MemberIds.Count]); EmoteInteraction confirmInteraction = new EmoteInteraction(UnicodeEmoteService.Checkmark, CheckmarkEmoteUsed, false); EmoteInteraction denyInteraction = new EmoteInteraction(UnicodeEmoteService.Cross, CrossEmoteUsed, false); AddMessageInteractionParams(confirmInteraction, denyInteraction); }
public GuildInvitationInteractiveMessage(MinecraftGuild guild, SocketGuildUser newMember, IUserMessage message, ICollection <EmoteInteraction> interactions, long expirationTime = -1) : base(message, interactions, expirationTime) { Guild = guild; NewMember = newMember; AddMessageInteractionParams(new EmoteInteraction(UnicodeEmoteService.Checkmark, OnConfirm, false), new EmoteInteraction(UnicodeEmoteService.Cross, OnDeny, false)); }
public static async Task <GuildCreationInteractiveMessage> FromNewGuildAndMemberList(MinecraftGuild guild, List <SocketGuildUser> Members) { StringBuilder mentionString = new StringBuilder(); foreach (SocketGuildUser member in Members) { guild.MemberIds.Add(member.Id); mentionString.Append(member.Mention); mentionString.Append(" "); } RestUserMessage message = await GuildChannelHelper.SendMessage(GuildChannelHelper.InteractiveMessagesChannelId, guild.DiscordColor, content : $"{mentionString}Please confirm ({UnicodeEmoteService.Checkmark}) or deny ({UnicodeEmoteService.Cross}) founding Membership in Guild `{guild.Name}` by reacting to this message! {Markdown.Mention_Role(SettingsModel.AdminRole)} Please choose to confirm ({UnicodeEmoteService.Checkmark}) or deny ({UnicodeEmoteService.Cross}) founding of this guild!", embedTitle : "Setting up Interactive Message - Stand By"); if (message != null) { GuildCreationInteractiveMessage result = new GuildCreationInteractiveMessage(message as IUserMessage, guild); await message.AddReactionsAsync(new IEmote[] { UnicodeEmoteService.Checkmark, UnicodeEmoteService.Cross }); await result.UpdateMessage(message as IUserMessage, Members[0].Guild); return(result); } else { return(null); } }