misskey/src/docs/en-US/create-plugin.md
syuilo d6e3ec3218
New Crowdin updates (#7036)
* New translations pages.md (English)

* New translations pages.md (English)

* New translations pages.md (English)

* New translations deck.md (English)

* New translations deck.md (English)

* New translations deck.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations ja-JP.yml (Chinese Traditional)

* New translations keyboard-shortcut.md (English)

* New translations ja-JP.yml (German)

* New translations ja-JP.yml (Chinese Traditional)

* New translations ja-JP.yml (English)

* New translations keyboard-shortcut.md (English)

* New translations api.md (English)

* New translations create-plugin.md (English)

* New translations stream.md (English)

* New translations deck.md (English)

* New translations api.md (English)

* New translations reversi-bot.md (English)

* New translations reversi-bot.md (English)

* New translations reversi-bot.md (English)

* New translations reversi-bot.md (English)

* New translations stream.md (English)

* New translations reversi-bot.md (English)

* New translations reversi-bot.md (English)

* New translations stream.md (English)

* New translations api.md (English)

* New translations stream.md (English)

* New translations create-plugin.md (English)

* New translations create-plugin.md (English)

* New translations create-plugin.md (English)

* New translations create-plugin.md (English)

* New translations create-plugin.md (English)

* New translations aiscript.md (English)

* New translations create-plugin.md (English)

* New translations ja-JP.yml (French)

* New translations ja-JP.yml (Korean)

* New translations ja-JP.yml (Arabic)

* New translations ja-JP.yml (Spanish)

* New translations ja-JP.yml (German)

* New translations ja-JP.yml (Japanese, Kansai)

* New translations ja-JP.yml (Kannada)

* New translations ja-JP.yml (Kabyle)

* New translations ja-JP.yml (Ukrainian)

* New translations ja-JP.yml (Russian)

* New translations ja-JP.yml (English)

* New translations ja-JP.yml (Chinese Simplified)

* New translations ja-JP.yml (Chinese Traditional)

* New translations ja-JP.yml (French)

* New translations ja-JP.yml (English)

* New translations ja-JP.yml (Chinese Simplified)

* New translations ja-JP.yml (Chinese Traditional)

* New translations ja-JP.yml (Japanese, Kansai)

* New translations ja-JP.yml (Ukrainian)

* New translations ja-JP.yml (German)

* New translations ja-JP.yml (Spanish)

* New translations ja-JP.yml (Russian)

* New translations ja-JP.yml (Korean)

* New translations ja-JP.yml (German)

* New translations ja-JP.yml (English)

* New translations api.md (English)

* New translations api.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations api.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations api.md (English)

* New translations stream.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations ja-JP.yml (Chinese Traditional)

* New translations stream.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations stream.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations stream.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations stream.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations stream.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations stream.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations reaction.md (Chinese Traditional)

* New translations stream.md (English)

* New translations stream.md (English)

* New translations ja-JP.yml (Chinese Simplified)

* New translations ja-JP.yml (Chinese Traditional)

* New translations stream.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations stream.md (English)

* New translations ja-JP.yml (Chinese Traditional)

* New translations ja-JP.yml (Chinese Traditional)

* New translations timelines.md (Chinese Simplified)

* New translations ja-JP.yml (Chinese Simplified)

* New translations create-plugin.md (Chinese Simplified)

* New translations follow.md (Chinese Simplified)

* New translations timelines.md (Chinese Simplified)

* New translations deck.md (Chinese Simplified)

* New translations follow.md (Chinese Simplified)

* New translations deck.md (Chinese Simplified)

* New translations mfm.md (Chinese Simplified)

* New translations ja-JP.yml (Chinese Simplified)

* New translations follow.md (Chinese Simplified)

* New translations keyboard-shortcut.md (Chinese Simplified)

* New translations ja-JP.yml (Russian)

* New translations ja-JP.yml (Chinese Traditional)

* New translations ja-JP.yml (Russian)

* New translations ja-JP.yml (English)

* New translations ja-JP.yml (German)

* New translations ja-JP.yml (English)

* New translations ja-JP.yml (Thai)

* New translations aiscript.md (Thai)

* New translations api.md (Thai)

* New translations create-plugin.md (Thai)

* New translations custom-emoji.md (Thai)

* New translations follow.md (Thai)

* New translations keyboard-shortcut.md (Thai)

* New translations mute.md (Thai)

* New translations pages.md (Thai)

* New translations reaction.md (Thai)

* New translations reversi-bot.md (Thai)

* New translations stream.md (Thai)

* New translations theme.md (Thai)

* New translations timelines.md (Thai)

* New translations deck.md (Thai)

* New translations mfm.md (Thai)

* New translations ja-JP.yml (Chinese Simplified)

* New translations ja-JP.yml (Chinese Simplified)

* New translations keyboard-shortcut.md (Chinese Simplified)

* New translations keyboard-shortcut.md (Chinese Simplified)

* New translations stream.md (Chinese Simplified)

* New translations keyboard-shortcut.md (Chinese Simplified)

* New translations keyboard-shortcut.md (Chinese Simplified)

* New translations keyboard-shortcut.md (Chinese Simplified)

* New translations ja-JP.yml (Chinese Simplified)

* New translations custom-emoji.md (Chinese Simplified)

* New translations ja-JP.yml (Chinese Simplified)

* New translations ja-JP.yml (Chinese Simplified)

* New translations mute.md (Chinese Simplified)

* New translations pages.md (Chinese Simplified)

* New translations ja-JP.yml (French)

* New translations ja-JP.yml (English)

* New translations ja-JP.yml (Chinese Simplified)

* New translations ja-JP.yml (Ukrainian)

* New translations ja-JP.yml (Chinese Traditional)
2020-12-31 19:45:30 +09:00

3.5 KiB

Creating plugins

If you use the plugin function of the Misskey web client, you can expand the web client with a variety of different functionality. This page will list metadata definitions for plugin creation as well as an AiScript API reference for plugins.

Metadata

Plugins must define default plugin metadata via the AiScript metadata format. Metadata is an object containing the following properties:

name

Plugin name

author

Plugin author

version

Plugin version.Please enter a number.

description

Plugin description

permissions

Permissions required by the plugin.Used when making requests to the Misskey API.

config

An object representing the plugin's settings. Set the keys to setting names and the values to one of the below properties.

type

A string representing the setting's value type.Selected from one of the below types. string number boolean

label

Setting name to do display to the user

description

Description of the setting

default

Default value of the setting

API Reference

API built directly into the AiScript standard itself will not be listed.

Mk:dialog(title text type)

Display a dialog.You can select one of the below types. info success warn error question If no type is selected, "info" is chosen by default.

Mk:confirm(title text type)

Display a confirmation dialog.You can select one of the below types. info success warn error question If no type is selected, "question" is chosen by default. If the user presses "OK" true will be returned, if they press "Cancel" false will be returned.

Mk:api(endpoint params)

Sends a request to the Misskey API.Specify the endpoint name as the first parameter and the request parameters as the second argument.

Mk:save(key value)

Persistently saves any given value under a given key.The saved value will remain even after the AiScript context ends and can be loaded with Mk:load.

Mk:load(key)

Reads the value of the given key that was previously saved with Mk:save.

Plugin:register_post_form_action(title fn)

Add an action to the post form.Enter an action name as the first parameter, and a callback function for when the action is executed as second parameter. A post form object is passed to the callback function as first argument.

Plugin:register_note_action(title fn)

Add an item to the note menu.Enter an item name as the first parameter, and a callback function for when the menu item is pressed as second parameter. A note object of the targeted note is passed to the callback function as first parameter.

Plugin:register_user_action(title fn)

Add an item to the user menu.Enter an item name as the first parameter, and a callback function for when the menu item is pressed as second parameter. A user object of the selected user is passed to the callback function as first parameter.

Plugin:register_note_view_interruptor(fn)

Modify the data of notes displayed in the UI. A note object is passed to the callback function as first parameter. The note will be modified based on the note object returned by the callback function.

Plugin:register_note_post_interruptor(fn)

Modify the data of notes about to be posted. A note object is passed to the callback function as first parameter. The note will be modified based on the note object returned by the callback function.

Plugin:open_url(url)

Opens the URL given as first argument in a new browser tab.

Plugin:config

An object containing the plugin settings.The values entered in the plugin definition are saved under the setting keys.