예제 #1
0
        public async Task tip(string mention, string value)
        {
            if (int.TryParse(value, out int tipvalue) && mention != "@everyone" && mention != "@here")
            {
                var user = GetUserIdByMention(mention);

                Console.WriteLine(Utilities.GetTime() + user.Nickname + $" +{tipvalue}");

                var account       = UserAccs.GetGuildAcc(user.Id);
                var accounttipper = UserAccs.GetAccount(Context.User);

                if (account == accounttipper)
                {
                    await Context.Channel.SendMessageAsync("U can send souls to yourself");

                    return;
                }

                if (accounttipper.Points < tipvalue)
                {
                    await Context.Channel.SendMessageAsync($"U need`{tipvalue - accounttipper.Points}`");

                    return;
                }

                accounttipper.Points -= tipvalue;
                account.Points       += tipvalue;

                await Context.Channel.SendMessageAsync(Utilities.GetFormattedAlert("tipinfo", user.Nickname, tipvalue.ToString()));

                UserAccs.SaveAccounts();
            }
        }
예제 #2
0
        public async Task EwaQ() // check the user stats or create the acc in database
        {
            var    account = UserAccs.GetAccount(Context.User);
            string msg     = Utilities.GetFormattedAlert("statinfo", Context.User.Username, (int)account.XP, account.Points);
            await Context.Channel.SendMessageAsync(msg);

            await Context.Message.DeleteAsync();
        }
예제 #3
0
 public async Task Lvler() // get lvl of user
 {
     var    account = UserAccs.GetAccount(Context.User);
     string msg     = Utilities.GetFormattedAlert("lvlinfo", account.LVL);
     await Context.Channel.SendMessageAsync(msg);
 }