Ejemplo n.º 1
0
        public async Task _MockAddPerson()
        {
            await Context.Message.DeleteAsync();

            List <ulong> mocked = await SaveSystem.GetMocked();

            IReadOnlyCollection <SocketUser> mentioned = Context.Message.MentionedUsers;

            if (mentioned.Count == 0 && !mocked.Contains(Context.User.Id))
            {
                await SaveSystem.AddMocked(Context.User.Id);

                await ClientConsole.Log(new TargetedCommandMessage("AddMockUser", Context, Context.User));

                await Context.Channel.SendMessageAsync($"Starting to mock {Context.User.Mention}");

                return;
            }

            List <ulong> adminIds = await SaveSystem.GetAdminIds();

            if (adminIds.Contains(Context.User.Id) || adminIds.Count == 0)
            {
                foreach (SocketUser user in mentioned)
                {
                    if (!mocked.Contains(user.Id) && Context.User == user)
                    {
                        await SaveSystem.AddMocked(user.Id);

                        await ClientConsole.Log(new TargetedCommandMessage("AddMockUser", Context, user));

                        await Context.Channel.SendMessageAsync($"Starting to mock {user.Mention}");
                    }
                }
            }
        }