Example #1
0
        async Task JoinAsync([Remainder] string queue)
        {
            await RemoveCommandMessageAsync();

            if (IsVerified)
            {
                if (!coordinatorService.HasLane(SocketGuildUser))
                {
                    await ReplyAsync("please set your lane role before trying to join the queue");

                    return;
                }
                if (queue == "dq")
                {
                    await coordinatorService.AddToDuoQueue(SocketGuildUser, true);
                    await ReplyAsync($"{SocketGuildUser.Nickname ?? SocketGuildUser.Username} joined the {coordinatorService.GetTier(SocketGuildUser).Name.ToUpper()} duo queue as {coordinatorService.GetLane(SocketGuildUser).Name.ToUpper()}");
                }
                else if (queue == "fq")
                {
                    await coordinatorService.AddToFlexQueue(SocketGuildUser, true);
                    await ReplyAsync($"{SocketGuildUser.Nickname ?? SocketGuildUser.Username} joined the {coordinatorService.GetTier(SocketGuildUser).Name.ToUpper()} flex queue as {coordinatorService.GetLane(SocketGuildUser).Name.ToUpper()}");
                }
                else if (queue == string.Empty)
                {
                    await ReplyAsync("please use 'dq' for duo queue and 'fq' for flex queue");
                }
                else
                {
                    await ReplyAsync("you have entered an invalid parameter. please use 'dq' for duo queue and 'fq' for flex queue");
                }
            }
            else
            {
                await ReplyAsync("you don't have permission to do that");
            }
        }