New Crowdin updates (#7616)
* New translations troubleshooting.md (Indonesian)
* New translations troubleshooting.md (Chinese Traditional)
* New translations troubleshooting.md (German)
* New translations troubleshooting.md (Chinese Simplified)
* New translations troubleshooting.md (Ukrainian)
* New translations troubleshooting.md (Russian)
* New translations troubleshooting.md (Portuguese)
* New translations troubleshooting.md (Polish)
* New translations troubleshooting.md (Norwegian)
* New translations troubleshooting.md (Dutch)
* New translations troubleshooting.md (Korean)
* New translations troubleshooting.md (Italian)
* New translations report-issue.md (Korean)
* New translations report-issue.md (German)
* New translations links.md (Portuguese)
* New translations links.md (Kannada)
* New translations misskey.md (German)
* New translations misskey.md (Danish)
* New translations misskey.md (Czech)
* New translations misskey.md (Arabic)
* New translations misskey.md (Spanish)
* New translations misskey.md (French)
* New translations links.md (Japanese, Kansai)
* New translations links.md (Kabyle)
* New translations links.md (Haitian Creole)
* New translations links.md (Lojban)
* New translations misskey.md (Korean)
* New translations links.md (Uyghur)
* New translations links.md (Esperanto)
* New translations links.md (Thai)
* New translations links.md (Indonesian)
* New translations links.md (English)
* New translations links.md (Chinese Traditional)
* New translations links.md (Chinese Simplified)
* New translations links.md (Ukrainian)
* New translations links.md (Russian)
* New translations misskey.md (Italian)
* New translations misskey.md (Dutch)
* New translations report-issue.md (Danish)
* New translations misskey.md (Uyghur)
* New translations report-issue.md (Czech)
* New translations report-issue.md (Arabic)
* New translations report-issue.md (Spanish)
* New translations report-issue.md (French)
* New translations misskey.md (Japanese, Kansai)
* New translations misskey.md (Kabyle)
* New translations misskey.md (Haitian Creole)
* New translations misskey.md (Kannada)
* New translations misskey.md (Lojban)
* New translations misskey.md (Esperanto)
* New translations misskey.md (Norwegian)
* New translations misskey.md (Thai)
* New translations misskey.md (Indonesian)
* New translations misskey.md (English)
* New translations misskey.md (Chinese Traditional)
* New translations misskey.md (Chinese Simplified)
* New translations misskey.md (Ukrainian)
* New translations misskey.md (Russian)
* New translations misskey.md (Portuguese)
* New translations misskey.md (Polish)
* New translations widgets.md (Lojban)
* New translations reaction.md (Polish)
* New translations widgets.md (Esperanto)
* New translations pages.md (Esperanto)
* New translations reaction.md (Spanish)
* New translations reaction.md (French)
* New translations pages.md (Japanese, Kansai)
* New translations pages.md (Kabyle)
* New translations pages.md (Haitian Creole)
* New translations pages.md (Kannada)
* New translations pages.md (Lojban)
* New translations pages.md (Uyghur)
* New translations pages.md (Thai)
* New translations reaction.md (Czech)
* New translations pages.md (Indonesian)
* New translations pages.md (English)
* New translations pages.md (Chinese Traditional)
* New translations pages.md (Chinese Simplified)
* New translations pages.md (Ukrainian)
* New translations pages.md (Russian)
* New translations pages.md (Portuguese)
* New translations pages.md (Polish)
* New translations pages.md (Norwegian)
* New translations reaction.md (Arabic)
* New translations reaction.md (Danish)
* New translations pages.md (Korean)
* New translations reaction.md (Indonesian)
* New translations silence.md (French)
* New translations reaction.md (Japanese, Kansai)
* New translations reaction.md (Kabyle)
* New translations reaction.md (Haitian Creole)
* New translations reaction.md (Kannada)
* New translations reaction.md (Lojban)
* New translations reaction.md (Uyghur)
* New translations reaction.md (Esperanto)
* New translations reaction.md (Thai)
* New translations reaction.md (English)
* New translations reaction.md (German)
* New translations reaction.md (Chinese Traditional)
* New translations reaction.md (Chinese Simplified)
* New translations reaction.md (Ukrainian)
* New translations reaction.md (Russian)
* New translations reaction.md (Portuguese)
* New translations reaction.md (Norwegian)
* New translations reaction.md (Dutch)
* New translations reaction.md (Korean)
* New translations reaction.md (Italian)
* New translations pages.md (Dutch)
* New translations pages.md (Italian)
* New translations silence.md (Arabic)
* New translations mute.md (Kabyle)
* New translations note.md (Italian)
* New translations note.md (German)
* New translations note.md (Danish)
* New translations note.md (Czech)
* New translations note.md (Arabic)
* New translations note.md (Spanish)
* New translations note.md (French)
* New translations mute.md (Japanese, Kansai)
* New translations mute.md (Haitian Creole)
* New translations note.md (Dutch)
* New translations mute.md (Kannada)
* New translations mute.md (Lojban)
* New translations mute.md (Uyghur)
* New translations mute.md (Esperanto)
* New translations mute.md (Thai)
* New translations mute.md (Indonesian)
* New translations mute.md (English)
* New translations mute.md (Chinese Traditional)
* New translations mute.md (Chinese Simplified)
* New translations note.md (Korean)
* New translations note.md (Norwegian)
* New translations pages.md (German)
* New translations note.md (Lojban)
* New translations pages.md (Danish)
* New translations pages.md (Czech)
* New translations pages.md (Arabic)
* New translations pages.md (Spanish)
* New translations pages.md (French)
* New translations note.md (Japanese, Kansai)
* New translations note.md (Kabyle)
* New translations note.md (Haitian Creole)
* New translations note.md (Kannada)
* New translations note.md (Uyghur)
* New translations note.md (Polish)
* New translations note.md (Esperanto)
* New translations note.md (Thai)
* New translations note.md (Indonesian)
* New translations note.md (English)
* New translations note.md (Chinese Traditional)
* New translations note.md (Chinese Simplified)
* New translations note.md (Ukrainian)
* New translations note.md (Russian)
* New translations note.md (Portuguese)
* New translations silence.md (Spanish)
* New translations silence.md (Czech)
* New translations widgets.md (Thai)
* New translations timeline.md (Portuguese)
* New translations timeline.md (Esperanto)
* New translations timeline.md (Thai)
* New translations timeline.md (Indonesian)
* New translations timeline.md (English)
* New translations timeline.md (Chinese Traditional)
* New translations timeline.md (Chinese Simplified)
* New translations timeline.md (Ukrainian)
* New translations timeline.md (Russian)
* New translations timeline.md (Polish)
* New translations timeline.md (Lojban)
* New translations timeline.md (Norwegian)
* New translations timeline.md (Dutch)
* New translations timeline.md (Korean)
* New translations timeline.md (Italian)
* New translations timeline.md (German)
* New translations timeline.md (Danish)
* New translations timeline.md (Czech)
* New translations timeline.md (Arabic)
* New translations timeline.md (Spanish)
* New translations timeline.md (Uyghur)
* New translations timeline.md (Kannada)
* New translations theme.md (Japanese, Kansai)
* New translations widgets.md (Dutch)
* New translations widgets.md (Indonesian)
* New translations widgets.md (English)
* New translations widgets.md (Chinese Traditional)
* New translations widgets.md (Chinese Simplified)
* New translations widgets.md (Ukrainian)
* New translations widgets.md (Russian)
* New translations widgets.md (Portuguese)
* New translations widgets.md (Polish)
* New translations widgets.md (Norwegian)
* New translations widgets.md (Korean)
* New translations timeline.md (Haitian Creole)
* New translations widgets.md (Italian)
* New translations widgets.md (German)
* New translations widgets.md (Danish)
* New translations widgets.md (Czech)
* New translations widgets.md (Arabic)
* New translations widgets.md (Spanish)
* New translations widgets.md (French)
* New translations timeline.md (Japanese, Kansai)
* New translations timeline.md (Kabyle)
* New translations timeline.md (French)
* New translations theme.md (Kabyle)
* New translations silence.md (Danish)
* New translations silence.md (Chinese Traditional)
* New translations silence.md (Kabyle)
* New translations silence.md (Haitian Creole)
* New translations silence.md (Kannada)
* New translations silence.md (Lojban)
* New translations silence.md (Uyghur)
* New translations silence.md (Esperanto)
* New translations silence.md (Thai)
* New translations silence.md (Indonesian)
* New translations silence.md (English)
* New translations silence.md (Chinese Simplified)
* New translations theme.md (French)
* New translations silence.md (Ukrainian)
* New translations silence.md (Russian)
* New translations silence.md (Portuguese)
* New translations silence.md (Polish)
* New translations silence.md (Norwegian)
* New translations silence.md (Dutch)
* New translations silence.md (Korean)
* New translations silence.md (Italian)
* New translations silence.md (German)
* New translations silence.md (Japanese, Kansai)
* New translations theme.md (Spanish)
* New translations theme.md (Haitian Creole)
* New translations theme.md (Ukrainian)
* New translations theme.md (Kannada)
* New translations theme.md (Lojban)
* New translations theme.md (Uyghur)
* New translations theme.md (Esperanto)
* New translations theme.md (Thai)
* New translations theme.md (Indonesian)
* New translations theme.md (English)
* New translations theme.md (Chinese Traditional)
* New translations theme.md (Chinese Simplified)
* New translations theme.md (Russian)
* New translations theme.md (Arabic)
* New translations theme.md (Portuguese)
* New translations theme.md (Polish)
* New translations theme.md (Norwegian)
* New translations theme.md (Dutch)
* New translations theme.md (Korean)
* New translations theme.md (Italian)
* New translations theme.md (German)
* New translations theme.md (Danish)
* New translations theme.md (Czech)
* New translations troubleshooting.md (Japanese, Kansai)
2021-08-08 12:39:45 +00:00
|
|
|
|
# プラグインの作成
|
|
|
|
|
Misskey Webクライアントのプラグイン機能を使うと、クライアントを拡張し、様々な機能を追加できます。 ここではプラグインの作成にあたってのメタデータ定義や、AiScript APIリファレンスを掲載します。
|
|
|
|
|
|
|
|
|
|
## Metadatos
|
|
|
|
|
プラグインは、AiScriptのメタデータ埋め込み機能を使って、デフォルトとしてプラグインのメタデータを定義する必要があります。 メタデータは次のプロパティを含むオブジェクトです。
|
|
|
|
|
|
|
|
|
|
### name
|
|
|
|
|
プラグイン名
|
|
|
|
|
|
|
|
|
|
### author
|
|
|
|
|
プラグイン作者
|
|
|
|
|
|
|
|
|
|
### version
|
|
|
|
|
プラグインバージョン。数値を指定してください。
|
|
|
|
|
|
|
|
|
|
### description
|
|
|
|
|
プラグインの説明
|
|
|
|
|
|
|
|
|
|
### permissions
|
|
|
|
|
プラグインが要求する権限。MisskeyAPIにリクエストする際に用いられます。
|
|
|
|
|
|
|
|
|
|
### config
|
|
|
|
|
プラグインの設定情報を表すオブジェクト。 キーに設定名、値に以下のプロパティを含めます。
|
|
|
|
|
|
|
|
|
|
#### type
|
|
|
|
|
設定値の種類を表す文字列。以下から選択します。 string number boolean
|
|
|
|
|
|
|
|
|
|
#### label
|
|
|
|
|
ユーザーに表示する設定名
|
|
|
|
|
|
|
|
|
|
#### description
|
|
|
|
|
設定の説明
|
|
|
|
|
|
|
|
|
|
#### default
|
|
|
|
|
設定のデフォルト値
|
|
|
|
|
|
|
|
|
|
## APIリファレンス
|
|
|
|
|
AiScript標準で組み込まれているAPIは掲載しません。
|
|
|
|
|
|
|
|
|
|
### Mk:dialog(title text type)
|
|
|
|
|
ダイアログを表示します。typeには以下の値が設定できます。 info success warn error question 省略すると info になります。
|
|
|
|
|
|
|
|
|
|
### Mk:confirm(title text type)
|
|
|
|
|
確認ダイアログを表示します。typeには以下の値が設定できます。 info success warn error question 省略すると question になります。 ユーザーが"OK"を選択した場合は true を、"キャンセル"を選択した場合は false が返ります。
|
|
|
|
|
|
|
|
|
|
### Mk:api(endpoint params)
|
|
|
|
|
Misskey APIにリクエストします。第一引数にエンドポイント名、第二引数にパラメータオブジェクトを渡します。
|
|
|
|
|
|
|
|
|
|
### Mk:save(key value)
|
|
|
|
|
任意の値に任意の名前を付けて永続化します。永続化した値は、AiScriptコンテキストが終了しても残り、Mk:loadで読み取ることができます。
|
|
|
|
|
|
|
|
|
|
### Mk:load(key)
|
|
|
|
|
Mk:saveで永続化した指定の名前の値を読み取ります。
|
|
|
|
|
|
|
|
|
|
### Plugin:register_post_form_action(title fn)
|
|
|
|
|
投稿フォームにアクションを追加します。第一引数にアクション名、第二引数にアクションが選択された際のコールバック関数を渡します。 コールバック関数には、第一引数に投稿フォームオブジェクトが渡されます。
|
|
|
|
|
|
|
|
|
|
### Plugin:register_note_action(title fn)
|
|
|
|
|
ノートメニューに項目を追加します。第一引数に項目名、第二引数に項目が選択された際のコールバック関数を渡します。 コールバック関数には、第一引数に対象のノートオブジェクトが渡されます。
|
|
|
|
|
|
|
|
|
|
### Plugin:register_user_action(title fn)
|
|
|
|
|
ユーザーメニューに項目を追加します。第一引数に項目名、第二引数に項目が選択された際のコールバック関数を渡します。 コールバック関数には、第一引数に対象のユーザーオブジェクトが渡されます。
|
|
|
|
|
|
|
|
|
|
### Plugin:register_note_view_interruptor(fn)
|
|
|
|
|
UIに表示されるノート情報を書き換えます。 コールバック関数には、第一引数に対象のノートオブジェクトが渡されます。 コールバック関数の返り値でノートが書き換えられます。
|
|
|
|
|
|
|
|
|
|
### Plugin:register_note_post_interruptor(fn)
|
|
|
|
|
ノート投稿時にノート情報を書き換えます。 コールバック関数には、第一引数に対象のノートオブジェクトが渡されます。 コールバック関数の返り値でノートが書き換えられます。
|
|
|
|
|
|
|
|
|
|
### Plugin:open_url(url)
|
|
|
|
|
第一引数に渡されたURLをブラウザの新しいタブで開きます。
|
|
|
|
|
|
|
|
|
|
### Plugin:config
|
|
|
|
|
プラグインの設定が格納されるオブジェクト。プラグイン定義のconfigで設定したキーで値が入ります。
|