Exemple #1
0
        public async Task Reply(Status status, CalculatedMusic music)
        {
            var sb = new StringBuilder();

            sb.Append("@");
            sb.AppendLine(status.User.ScreenName);

            sb.Append("曲名: ");
            sb.Append(music.Name);
            sb.Append(" (");
            sb.Append(music.CalculatedDifficulty.ToString().ToUpper());
            sb.AppendLine(")");

            sb.Append("譜面定数: ");
            var constant = music.Constant[music.CalculatedDifficulty];

            sb.Append(constant.HasValue ? constant.Value.ToString("f1") : "未調査");
            sb.Append(" (Lv ");
            sb.Append(music.Level[music.CalculatedDifficulty]);
            sb.AppendLine(")");

            sb.Append("ノーツ数: ");
            var notes = music.Notes[music.CalculatedDifficulty];

            sb.AppendLine(notes.HasValue ? notes.ToString() : "未調査");

            if (music.AcceptancesForSSS != null)
            {
                sb.Append("SSS許容: ");

                foreach (var(acceptance, i) in music.AcceptancesForSSS.Select((x, i) => (x, i)))
                {
                    if (i > 0)
                    {
                        sb.Append(", ");
                    }

                    sb.Append("J");
                    sb.Append(acceptance.AcceptableJustice);
                    sb.Append(" A");
                    sb.Append(acceptance.AcceptableAttack);
                }

                sb.AppendLine();
                sb.Append("9900許容: J");
                sb.Append(music.AcceptanceFor9900.AcceptableJustice);
            }

            var text = sb.ToString();
            await _twitter.Tweet(text, status.Id);
        }
Exemple #2
0
        public string Tweet([FromBody] TwitterConsumer consumer)
        {
            var fact  = GetFact();
            var image = GetImage();

            _twitter.Setup(new TokensWrapper(consumer));
            _twitter.Tweet(fact, image);

            return(fact);
        }