public async Task CounterMM(CommandContext ctx) { DbConnection conn = new DbConnection(Bot.dbSettings); DbApi dbApi = new DbApi(conn); int total = dbApi.GetServerTotal(); total--; dbApi.SetServerTotal(total); await ctx.Channel.SendMessageAsync("Server Counter: " + total.ToString()).ConfigureAwait(false); }
public async Task SwearBot(CommandContext ctx) { DbConnection conn = new DbConnection(Bot.dbSettings); DbApi dbApi = new DbApi(conn); string[] args = ctx.Message.Content.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); if (args.Length == 1) { int total = dbApi.GetServerTotal(); await ctx.Channel.SendMessageAsync("Server Counter: " + total.ToString()).ConfigureAwait(false); } else if (args.Length == 2) { if (args[1].StartsWith("<@!") && args[1].EndsWith(">")) { int user_total = dbApi.UserGetTotal(args[1]); await ctx.Channel.SendMessageAsync("Counter for " + args[1] + " is " + user_total.ToString()).ConfigureAwait(false); } } }