예제 #1
0
        private async Task Client_MessageReceived(SocketMessage arg)
        {
            if (arg.Content.Length != 2)
            {
                return;
            }
            (int x, int y) = (getCoord(arg.Content.Substring(0, 1)), getCoord(arg.Content.Substring(1, 1)));
            if (x == -1 || y == -1)
            {
                return;
            }
            var selected = Games.FirstOrDefault(x => x.Message.Channel.Id == arg.Channel.Id);

            if (selected == null)
            {
                return;
            }
            await Handle(selected, arg.Author as SocketGuildUser, (x, y));

            try
            {
                await arg.DeleteAndTrackAsync("Removed pursuant to tictactoe game");
            } catch { }
        }