Пример #1
0
        public async Task RegisterUser()
        {
            var handler = new UserAccounts();

            if (handler.GetUserAccount(Context.User.Id) is null)
            {
                handler.AddUserAccount(Context.User.Id, 1000);
                await Context.Channel.SendMessageAsync($"Successfully registered with the ID `{Context.User.Id}`.");
            }
            else
            {
                await Context.Channel.SendMessageAsync("You are already registered.");
            }
        }
Пример #2
0
        public async Task RegisterALLCommand()
        {
            if (!Utilities.UserHasPermission(Context.User as SocketGuildUser, GuildPermission.Administrator))
            {
                return;
            }

            int userCount = 0;

            foreach (var user in Context.Guild.Users)
            {
                userCount++;
                var handler = new UserAccounts();

                handler.AddUserAccount(user.Id, 200);
            }

            await Context.Channel.SendMessageAsync(userCount.ToString());
        }