async Task RemoveReactions(IUserMessage msg) { msg ??= message ?? await GetUiMessage(); var bot = Handlers.DiscordBotHandler.Client.CurrentUser; _ = msg.RemoveReactionsAsync(bot, options.Select(x => EUI.ToEmote(x)).ToArray()); }
public void LoadOptions(IUserMessage reply) { if (options != null) { try { _ = reply.AddReactionsAsync(options.Select(s => EUI.ToEmote(s)).ToArray()); } catch (Exception e) { _ = Handlers.UniqueChannels.Instance.SendToLog(e); Log.LogS(e); } } }
public async Task <UI> Edit(Player player, string content, Embed embed, MsgType type, string data, bool editEmotes = true) { this.type = type; this.player = player; this.data = data; //Edit Message IUserMessage msg = await GetUiMessage(); await msg.ModifyAsync(x => { x.Content = content; x.Embed = embed; }); if (editEmotes) { List <string> oldops = options; InitialiseOption(); VerifyOptions(); oldops.RemoveAll(e => options.Contains(e)); _ = msg.RemoveReactionsAsync(Handlers.DiscordBotHandler.Client.CurrentUser, oldops.Select(x => EUI.ToEmote(x)).ToArray()); LoadOptions(msg); } return(this); }
internal Task RemoveReaction(string e, IUserMessage msg = null, SocketSelfUser bot = null) => RemoveReaction(EUI.ToEmote(e), msg, bot);