Example #1
0
        public async Task VoteCommand(int id, [Remainder] string message = "")
        {
            MafiaGame game = null;

            try
            {
                game = GetGame(id, Context.Guild.GetUser);
            }
            catch (Exception e)
            {
                await Context.Channel.SendMessageAsync($"Could not find Mafia game with Id: {id}");

                return;
            }

            game.Vote(Context.User.Id, Context.Message.MentionedUsers.Select(s => (IUser)s).ToList());

            var collection = Context.Database.GetCollection <MafiaGame>();

            collection.Update(game);
        }