mastodon_import_emoji

授权协议 AGPL-3.0 License
开发语言 JavaScript
所属分类 程序开发、 Emoji 表情相关
软件类型 开源软件
地区 不详
投 递 者 裴嘉许
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Mastodon custom emoji importer

Usage

Run from inside your Mastodon ("live") directory:bundle exec rails runner import_emoji.rb [options] [command]

Options

--prefix [prefix]Prefix shortcodes of all imported emoji with a string

--dry-runDon't actually save anything to the database

--match [regexp]Only import emoji with shortcodes that match the given regularexpression

--lowerConvert all shortcodes to lowercase

--squareAdd padding to images to ensure a 1:1 aspect ratio

--minsizeImages smaller than this size (format WxH) are padded to be thissize

--hideHide imported emoji from the emoji picker

--no-overwritingBy default, the script will remove any custom emoji with thesame shortcode as a new one before adding the new one. Thisdisables that functionality, and will not import anyemoji with conflicting shortcodes.

--convert-gifConvert animated GIF to animated PNG. Requires gif2apng to beinstalled.

Commands

steamgame [appid|title]Import all emotes from a Steam game, either given its numericAppID, or the (start of) the game name. Requires the nokogiriRuby gem.

steamprofile [steam64id]Import all Steam emotes available to a user given their profileID (find that here).

twitchchannel [channel]Import the emotes available to subscribers of the given Twitch.tvchannel, or available to all if no channel is given.

twitchsubscriptions [username]Import the Twitch.tv emotes available to a user given their loginname.

files [path]Import all PNG files in the given directory (recursive), usingeach file name as a shortcode.

slackImport all of the custom emoji from a Slack team. Get an API keyat https://api.slack.com/apps/.../oauth and export it in theSLACK_API_TOKEN environment variable. Requires theslack-ruby-client gem.

discordImport all of the custom emoji from a Discord server. Get a bottoken at https://discordapp.com/developers/applications/me/...and export it in the DISCORD_API_TOKEN environment variable, andjoin the bot to your channel with the client IDhere.Requires the discordrb gem.

mastodon [base url]Copy all custom emoji from an existing Mastodon instance, viaits public API.

hashflags [time]Import all Twitter promoted hashtag emoji, limited to campaignsactive at the given date and time, or now if no time is given.

emojipack [path or url]Import an "emojipack" YAML from the given URL or file path.Requires the safe_yaml gem.

Examples

import_emoji.rb --prefix tf --minsize 20x20 steamgame 440Import Steam emotes for Team Fortress 2, and add a "tf" prefix toeach shortcode, and expand each image to 20x20 pixels

import_emoji.rb --match "^[a-zA-Z0-9_]{2,}$" --lower twitchchannelImport Twitch.tv global emotes (but only with alphanumeric codes)and make the codes lowercase

import_emoji.rb --hide files monstrous_specification_0.1.0_png64/emoji/Import all emoji from the (downloaded and extracted) MonstrousSpecification emoji set, but hide them from the picker by default.