コード例 #1
0
 public async Task AddOwner(ulong id)
 {
     string sql = $"INSERT INTO BotOwners (OwnerID) VALUES ({id})";
     var l = Constants._BOTOWNERS_.ToList();
     l.Add(id);
     Constants._BOTOWNERS_ = l.ToArray();
     DBControl.UpdateDB(sql);
     var m = await Context.Channel.SendMessageAsync($"User {CustomUserTypereader.GetUserFromID(id, Context.Client.Guilds).Result.Username} added as one of my Owners.");
     GlobalVars.AddRandomTracker(m, 5);
 }
コード例 #2
0
        public async Task AddIgnore(ulong idiotID)
        {
            var user = await CustomUserTypereader.GetUserFromID(idiotID, Context.Client.Guilds);
            if (user != null)
            {
                GlobalVars.IgnoredUsers.Add(idiotID, user);

                string sql = $"INSERT INTO Ignores (UserID, DateAdded) VALUES ({idiotID},'{DateTime.Now.Day}-{DateTime.Now.Month}-{DateTime.Now.Year}')";
                DBControl.UpdateDB(sql);

                await Context.Channel.SendMessageAsync($"Added user {user.Mention} to the ignore list.\nThey will now be ignored by me.");
            }
            else
            {
                var msg = await Context.Channel.SendMessageAsync($"User not found (ID: {idiotID})");
                GlobalVars.AddRandomTracker(msg, 5);
            }
        }
コード例 #3
0
        public async Task AddFriend(ulong friendID)
        {
            var user = await CustomUserTypereader.GetUserFromID(friendID, Context.Client.Guilds);
            if (user != null)
            {
                GlobalVars.FriendUsers.Add(friendID, user);

                string sql = $"INSERT INTO Friends (UserID, DateAdded) VALUES ({friendID},'{DateTime.Now.Day}-{DateTime.Now.Month}-{DateTime.Now.Year}')";
                DBControl.UpdateDB(sql);

                await Context.Channel.SendMessageAsync($"Added user {user.Mention} as a friend.\nThey will no longer be timed out and will have more privileges in the future.");
            }
            else
            {
                var msg = await Context.Channel.SendMessageAsync($"User not found (ID: {friendID}");
                GlobalVars.AddRandomTracker(msg, 5);
            }
        }