Пример #1
0
        public async Task InfoAsync([Remainder] string Remainder = null)
        {
            if (Operators.ContainsKey(Context.Message.Author.Id))
            {
                RainBorg.tipBalance = RainBorg.GetBalance();

                decimal i = RainBorg.tipMin + RainBorg.tipFee - RainBorg.tipBalance;
                if (i < 0)
                {
                    i = 0;
                }

                string m = "```Current tip balance: " + RainBorg.Format(RainBorg.tipBalance) + " " + RainBorg.currencyName + "\n" +
                           "Amount needed for next tip: " + RainBorg.Format(i) + " " + RainBorg.currencyName + "\n" +
                           "Next tip at: " + RainBorg.waitNext + "\n" +
                           "Tip minimum: " + RainBorg.Format(RainBorg.tipMin) + " " + RainBorg.currencyName + "\n" +
                           "Tip maximum: " + RainBorg.Format(RainBorg.tipMax) + " " + RainBorg.currencyName + "\n" +
                           "Megatip amount: " + RainBorg.Format(RainBorg.megaTipAmount) + " " + RainBorg.currencyName + "\n" +
                           "Megatip chance: " + RainBorg.Format(RainBorg.megaTipChance) + "%\n" +
                           "Minimum users: " + RainBorg.userMin + "\n" +
                           "Maximum users: " + RainBorg.userMax + "\n" +
                           "Minimum wait time: " + String.Format("{0:n0}", RainBorg.waitMin) + "s (" + TimeSpan.FromSeconds(RainBorg.waitMin).ToString() + ")\n" +
                           "Maximum wait time: " + String.Format("{0:n0}", RainBorg.waitMax) + "s (" + TimeSpan.FromSeconds(RainBorg.waitMax).ToString() + ")\n" +
                           "Message timeout: " + String.Format("{0:n0}", RainBorg.timeoutPeriod) + "s (" + TimeSpan.FromSeconds(RainBorg.timeoutPeriod).ToString() + ")\n" +
                           "Minimum account age: " + TimeSpan.FromHours(RainBorg.accountAge).ToString() + "\n" +
                           "Flush pools on tip: " + RainBorg.flushPools + "\n" +
                           "Operators: " + Operators.Count + "\n" +
                           "Blacklisted: " + Blacklist.Count + "\n" +
                           "Greylisted: " + RainBorg.Greylist.Count + "\n" +
                           "Channels: " + RainBorg.UserPools.Keys.Count + "\n" +
                           "Paused: " + RainBorg.Paused.ToString() +
                           "```";
                await Context.Message.Author.SendMessageAsync(m);
            }
        }
Пример #2
0
        public async Task DoMegaTipAsync(decimal Amount, [Remainder] string Remainder = null)
        {
            try { await Context.Message.DeleteAsync(); }
            catch { }
            if (Operators.ContainsKey(Context.Message.Author.Id))
            {
                if (RainBorg.IsTipBotOnline())
                {
                    await RainBorg.MegaTipAsync(Amount);

                    try
                    {
                        RainBorg.Log(2, "Command", "Megatip for {0} {1} called by {2}", RainBorg.Format(Amount), RainBorg.currencyName, Context.User.Username);

                        // 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("👌"));
                    }
                }
                else
                {
                    RainBorg.Log(2, "Command", "Megatip for {0} {1} called by {2}, but it failed because tip bot is not online",
                                 RainBorg.Format(Amount), RainBorg.currencyName, Context.User.Username);
                }
            }
        }
Пример #3
0
        public async Task BalanceAsync([Remainder] string Remainder = null)
        {
            // Get balance
            RainBorg.tipBalance = RainBorg.GetBalance();

            decimal i = RainBorg.tipMin - RainBorg.tipBalance;

            if (i < 0)
            {
                i = 0;
            }

            string m = "Current tip balance: " + RainBorg.Format(RainBorg.tipBalance) + RainBorg.currencyName;

            await ReplyAsync(m);
        }
Пример #4
0
        public async Task StatsAsync([Remainder] ulong Id = 0)
        {
            if (Operators.ContainsKey(Context.Message.Author.Id))
            {
                string      m    = "```";
                StatTracker Stat = null;
                Console.WriteLine(Id);

                // Channel stats
                if ((Stat = Stats.GetChannelStats(Id)) != null)
                {
                    m += "#" + Context.Client.GetChannel(Id) + " Channel Stats:\n";
                    m += "Total " + RainBorg.currencyName + " Sent: " + RainBorg.Format(Stat.TotalAmount) + " " + RainBorg.currencyName + "\n";
                    m += "Total Tips Sent: " + Stat.TotalTips + "\n";
                    m += "Average Tip: " + RainBorg.Format(Stat.TotalAmount / Stat.TotalTips) + " " + RainBorg.currencyName + "";
                }

                // User stats
                else if ((Stat = Stats.GetUserStats(Id)) != null)
                {
                    m += "@" + Context.Client.GetUser(Id).Username + " User Stats:\n";
                    m += "Total " + RainBorg.currencyName + " Sent: " + RainBorg.Format(Stat.TotalAmount) + " " + RainBorg.currencyName + "\n";
                    m += "Total Tips Sent: " + Stat.TotalTips + "\n";
                    m += "Average Tip: " + RainBorg.Format(Stat.TotalAmount / Stat.TotalTips) + " " + RainBorg.currencyName + "";
                }

                // Global stats
                else
                {
                    Stat = Stats.GetGlobalStats();
                    m   += "Global Stats:\n";
                    m   += "Total " + RainBorg.currencyName + " Sent: " + RainBorg.Format(Stat.TotalAmount) + " " + RainBorg.currencyName + "\n";
                    m   += "Total Tips Sent: " + Stat.TotalTips + "\n";
                    m   += "Average Tip: " + RainBorg.Format(Stat.TotalAmount / Stat.TotalTips) + " " + RainBorg.currencyName + "";
                }

                m += "```";
                await Context.Message.Author.SendMessageAsync(m);
            }
        }