Exemplo n.º 1
0
        public async void OAuthMisskeyAsync()
        {
            if (AccessToken == "misskey is not need token" && i == 0)
            {
                user = await app.Authorize();

                i++;
            }

            string TootMessage = Toot_Input.Text;

            if (TootMessage.Length > 500)
            {
                MessageBox.Show("文字数超過です。減らしてください。",
                                "エラー",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            // Let's post a message to Misskey
            await user.Request("notes/create", new Dictionary <string, object> {
                { "text", TootMessage }
            });

            Toot_Input.Clear();
        }
Exemplo n.º 2
0
        public void Toot(string mode)
        {
            registeredApp = ApplicaionManager.RegistApp(host, "MegaPad", Scope.Read | Scope.Write | Scope.Follow).Result;
            var client = new MastodonClient(host, AccessToken);


            string TootMessage = Toot_Input.Text;

            if (TootMessage.Length > 500)
            {
                MessageBox.Show("文字数超過です。減らしてください。",
                                "エラー",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }


            if (TootMessage == "")
            {
                return;
            }
            if (mode == "公開")
            {
                client.PostNewStatus(status: TootMessage, visibility: Mastodot.Enums.Visibility.Public);
            }
            else if (mode == "非公開")
            {
                client.PostNewStatus(status: TootMessage, visibility: Mastodot.Enums.Visibility.Unlisted);
            }
            else
            {
                client.PostNewStatus(status: TootMessage, visibility: Mastodot.Enums.Visibility.Private);
            }

            Toot_Input.Clear();
        }
Exemplo n.º 3
0
 private void 大ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Toot_Input.SelectAll();
     Toot_Input.SelectionFont = new Font("MS UI Gothic", 12);
 }