Beispiel #1
0
        protected override void OnVisibleChanged(EventArgs e)
        {
            base.OnVisibleChanged(e);

            if (Visible && !Disposing)
            {
                dataGridView1.DataSource = LeagueUtil.GetLeague(0);
            }
        }
        public async Task <IEnumerable <object> > GetSummoners()
        {
            var user = await _users.GetUserAsync();

            return(user.Summoners.Select(summoner => new
            {
                region = summoner.Region.ToUpperInvariant(),
                summonerName = summoner.Name,
                league = LeagueUtil.Stringify(summoner.LeagueInfo),
                active = summoner.IsActive
            }));
        }
        private string GetMailmessage(User user, Summoner summoner)
        {
            const string pattern = @"*I'm a bot whose purpose is to deliver League of Legends flairs.*

----

> **This message is to notify you that the flair `{flair}` has been delivered to your Reddit account.**

> **From time to time, we'll check if your rank changes and update your flair. You won't hear back from me again. Thanks.**

----

[Report a problem](https://www.reddit.com/message/compose?to=kivinkujata&subject=Issue+with+FeralFlair) | 
[Author](https://www.reddit.com/message/compose?to=kivinkujata&subject=Ranked+Flairs) |
[GitHub](https://github.com/jessehallam/RedditRankedFlairs) | {version}";

            return(pattern.Replace("{flair}", LeagueUtil.Stringify(summoner.LeagueInfo))
                   .Replace("{version}", _config.FlairBotVersion));
        }
        private async Task <string> GetFlairTextAsync(User user)
        {
            var summoner = await _summoners.GetActiveSummonerAsync(user);

            return(summoner == null ? "" : LeagueUtil.Stringify(summoner.LeagueInfo));
        }