Example #1
0
        public async Task OutOutAsync([Remainder] string Remainder = null)
        {
            if (!OptedOut.ContainsKey(Context.Message.Author.Id))
            {
                OptedOut.Add(Context.Message.Author.Id);
                await RainBorg.RemoveUserAsync(Context.Message.Author, 0);

                await Config.Save();

                try
                {
                    // Add reaction to message
                    IEmote emote = Context.Guild.Emotes.First(e => e.Name == RainBorg.successReact);
                    await Context.Message.AddReactionAsync(emote);
                }
                catch
                {
                    await Context.Message.AddReactionAsync(new Emoji("👌"));
                }
                await Context.Message.Author.SendMessageAsync("You have opted out from receiving future tips.");
            }
            else
            {
                await Context.Message.Author.SendMessageAsync("You have already opted out, use $optin to opt back into receiving tips.");
            }
        }
 public async Task OptIn(CommandContext ctx)
 {
     if (OptedOut.Has(ctx.User.Id.ToString()))
     {
         OptedOut[ctx.User.Id.ToString()] = false;
         await ctx.RespondAsync(
             $"{ctx.User.Mention}, you've successfully opted back in to having your messages trigger hooks.");
     }
     else
     {
         await ctx.RespondAsync($"{ctx.User.Mention}, you haven't opted out.");
     }
 }
 public async Task OptOut(CommandContext ctx)
 {
     if (OptedOut.Has(ctx.User.Id.ToString()))
     {
         await ctx.RespondAsync($"{ctx.User.Mention}, you've already opted out.");
     }
     else
     {
         OptedOut[ctx.User.Id.ToString()] = true;
         await ctx.RespondAsync(
             $"{ctx.User.Mention}, you've successfully opted out from having your messages trigger hooks.");
     }
 }
Example #4
0
        internal static void Load()
        {
            // Load operators
            Operators.Load();

            // Load stats
            Stats.Load();

            // Load blacklist
            Blacklist.Load();

            // Load optedout
            OptedOut.Load();
        }
Example #5
0
        public async Task OptInAsync([Remainder] string Remainder = null)
        {
            if (OptedOut.ContainsKey(Context.Message.Author.Id))
            {
                OptedOut.Remove(Context.Message.Author.Id);
                await Config.Save();

                try
                {
                    // Add reaction to message
                    IEmote emote = Context.Guild.Emotes.First(e => e.Name == RainBorg.successReact);
                    await Context.Message.AddReactionAsync(emote);
                }
                catch
                {
                    await Context.Message.AddReactionAsync(new Emoji("👌"));
                }
                await Context.Message.Author.SendMessageAsync("You have opted back in, and will receive tips once again.");
            }
            else
            {
                await Context.Message.Author.SendMessageAsync("You have not opted out, you are already able to receive tips.");
            }
        }