コード例 #1
0
        private static async Task MessageReceivedAsync(SocketMessage message)
        {
            if (message.Content != "!10man")
            {
                return;
            }

            if (message.Channel.Id == TenManChatId)
            {
                var tenManRole = _guild.GetRole(TenManRoleId);

#if DEBUG
                var botMessage = await message.Channel
                                 .SendMessageAsync("Setting up a 10 manner!\nCheck the 10 Man Status Channel for the list! React to this message in order to be added to the list!")
                                 .ConfigureAwait(true);
#else
                var botMessage = await message.Channel
                                 .SendMessageAsync(
                    $"Setting up a 10 manner!\n{tenManRole.Mention}\ncheck the 10 Man Status Channel for the list! React to this message in order to be added to the list!")
                                 .ConfigureAwait(true);
#endif

                _lastBotTenManMessageId = botMessage.Id;

                MatchList.SendList();
            }
        }
コード例 #2
0
        private static Task ClientConnectedAsync()
        {
            return(Task.Run(() =>
            {
                _guild = _discordClient.GetGuild(GuildId);

                DownloadUsers();

                MatchList.Initialize(_guild);
                RoleAssigner.Initialize(_guild);
            }));
        }
コード例 #3
0
        private static void UpdateMatchList(SocketGuildUser user, bool addUser)
        {
            if (addUser)
            {
                MatchList.AddToList(user);
            }
            else
            {
                MatchList.RemoveFromList(user);
            }

            MatchList.UpdateListAsync().ConfigureAwait(true);
        }