コード例 #1
0
        public async Task InviteDotaAsync()
        {
            var           users         = _rotnBotUserService.GetAll();
            StringBuilder stringBuilder = new StringBuilder();

            foreach (var user in users)
            {
                if (user.DotaNotificationsOn)
                {
                    stringBuilder.Append(MentionUtils.MentionUser(user.DiscordUserId) + " ");
                }
            }
            stringBuilder.Append("DOTA?");
            await ReplyAsync(stringBuilder.ToString());
        }
コード例 #2
0
ファイル: PointsModule.cs プロジェクト: DaltonKirk/RotnBot
        public async Task ShowLeaderBoardAsync()
        {
            RotnBotUser[] users = _rotnBotUserService.GetAll();

            users = users.OrderByDescending(e => e.Points).ToArray();

            EmbedBuilder embedBuilder = new EmbedBuilder();

            embedBuilder.Title = "Points Leaderboard";

            foreach (var user in users)
            {
                var socketUser = Context.Client.GetUser(user.DiscordUserId);
                if (socketUser != null)
                {
                    embedBuilder.AddField(socketUser.ToString(), user.Points);
                }
            }

            await ReplyAsync("", false, embedBuilder.Build());
        }