Ejemplo n.º 1
0
        private static async ValueTask FetchReactions(Misskey mi)
        {
            var note = await mi.ApiAsync <Note>("notes/show", new
            {
                noteId = "7zzafqsm9a",
            });

            Console.WriteLine("Note ID: " + note.Id);
            Console.WriteLine("Note Created At: " + note.CreatedAt);
            Console.WriteLine("CW: " + note.Cw ?? "null");
            Console.WriteLine("Body: " + note.Text ?? "null");
            Console.WriteLine("Reactions: ");
            int c = 0;

            foreach (var kv in note.Reactions)
            {
                Console.Write(" {0}: {1}", kv.Key, kv.Value);
                c++;
                if (c == 5)
                {
                    c = 0;
                    Console.WriteLine();
                }
            }
        }
Ejemplo n.º 2
0
 private static async ValueTask SummonError(Misskey mi)
 {
     try
     {
         var note = await mi.ApiAsync <Note>("notes/show", new
         {
             noteId = "m",
         });
     }
     catch (MisskeyApiException e)
     {
         Console.WriteLine(e.Error.Message);
     }
 }
Ejemplo n.º 3
0
        private static async ValueTask GetMeta(Misskey mi)
        {
            try
            {
                var meta = await mi.ApiAsync <Meta>("meta");

                Console.WriteLine($"インスタンス名: {meta.Name}");
                Console.WriteLine($"バージョン: {meta.Version}");
                Console.WriteLine($"説明: {meta.Description}");
                Console.WriteLine($"管理者: {meta.MaintainerName}");
                Console.WriteLine($"管理者メール: {meta.MaintainerEmail}");
                Console.WriteLine($"LTL: {(meta.DisableLocalTimeline ? "いいえ" : "はい")}");
                Console.WriteLine($"GTL: {(meta.DisableGlobalTimeline ? "いいえ" : "はい")}");
                Console.WriteLine($"登録可能: {(meta.DisableRegistration ? "いいえ" : "はい")}");
                Console.WriteLine($"メール: {(meta.EnableEmail ? "はい" : "いいえ")}");
                Console.WriteLine($"Twitter認証: {(meta.EnableTwitterIntegration ? "はい" : "いいえ")}");
                Console.WriteLine($"Discord認証: {(meta.EnableDiscordIntegration ? "はい" : "いいえ")}");
                Console.WriteLine($"GitHub認証: {(meta.EnableGithubIntegration ? "はい" : "いいえ")}");
            }
            catch (MisskeyApiException e)
            {
                Console.WriteLine(e.Error.Message);
            }
        }