Esempio n. 1
0
        public async void duel(IGuildUser user)
        {
            if (user == Context.User)
            {
                await ReplyAsync("Are you that lonely?");

                return;
            }

            await ReplyAsync($"Hey {user.Mention}, {Context.User.Mention} is dueling you to a Tic Tac Toe match!\n" +
                             "Answer 'yes' if you want to accept the duel and whatever else to refuse.");

            var msg = await interactiveService.WaitForMessageAsync(user, Context.Channel as IMessageChannel);

            if (msg.Content.ToLower() == "yes")
            {
                tttService.Start(Context.User.Id, user.Id);
                await ReplyAsync("Duel started !\n" +
                                 "To play (if it's your turn), type 'Chaya tictactoe play <col> <line>'.");

                await PrintGrid();

                var currentPlayer = Context.Guild.GetUser(tttService.ticTacToe.CurrentPlayer.PlayerId);
                await ReplyAsync($"{currentPlayer.Mention}, it's your turn !");
            }
            else
            {
                await ReplyAsync("Such a pussy");
            }
        }
Esempio n. 2
0
        public async Task StreamCommand()
        {
            var streamsMsg = await musicService.PrintStreams(Context.Channel);

            // Wait for the user's response
            var userMsg = await interactiveService.WaitForMessageAsync(Context.User, Context.Channel, 4000);

            if (userMsg == null)
            {
                await streamsMsg.DeleteAsync();

                return;
            }

            if (int.TryParse(userMsg.Content, out int streamId))
            {
                await streamsMsg.DeleteAsync();

                await musicService.PlayStream(Context, streamId);
            }
            else
            {
                await streamsMsg.ModifyEmbedMessageAsync(null, "Wrong number of the stream.", Colors.RED);
            }
        }