Beispiel #1
0
        public WeeklyTable(IMessageChannel chnl)
        {
            var leagueTable = new Action(async() =>
            {
                var system = new string[] { "psn", "xbox" };
                foreach (var table in system)
                {
                    EmbedBuilder embed = new EmbedBuilder();
                    // TeamInfo.ClubInfo("psn","Leverkusen", ref embed);

                    TeamStanding.GetStandings(table, ref embed, "WeeklyTable");
                    await chnl.SendMessageAsync("", embed: embed.Build());
                }
            });

            Schedule(leagueTable).ToRunNow().AndEvery(1).Weeks().On(DayOfWeek.Wednesday).At(12, 0);
        }
Beispiel #2
0
        public async Task Standings(string league)
        {
            EmbedBuilder embed   = new EmbedBuilder();
            var          options = new RequestOptions {
                Timeout = 2
            };
            await Context.Message.DeleteAsync(options);

            if (Context.Channel.Id == Convert.ToUInt64(Environment.GetEnvironmentVariable("stats_channel")))
            {
                TeamStanding.GetStandings(league, ref embed, "Standings");
                await ReplyAsync("", embed : embed.Build());
            }
            else
            {
                await ReplyAsync(
                    $"{Context.User.Mention} you are using the command in the wrong channel, try again in " +
                    $"{MentionUtils.MentionChannel(Convert.ToUInt64(Environment.GetEnvironmentVariable("stats_channel")))}");
            }
        }