自定义表情包是长毛象的一大特色,本文将介绍如何从其它长毛象实例复制表情包。

所需材料:

  • 有管理权的长毛象实例一个
  • 目标实例账号一枚

使用 API 获取表情包数据

使用 Custom emoji API 获取目标实例表情包数据。

In [1]:
import requests
import json

# base_url = "https://cmx.im"
base_url = "https://nebula.moe"
custom_emojis_api = base_url + "/api/v1/custom_emojis"
In [2]:
custom_emojis_api
Out[2]:
'https://nebula.moe/api/v1/custom_emojis'
In [3]:
resp = requests.get(custom_emojis_api, timeout=15)
emojis = resp.json()

整理表情包数据

整理 API 返回的数据,将其整理为长毛象发布使用的格式(:shortcode:)。

In [5]:
output = ''
i = 1
for emoji in emojis:
    if i % 7 == 0: 
        output = output + ':' + emoji['shortcode'] + ':' + ' ' + '\n'
    else:
        output = output + ':' + emoji['shortcode'] + ':' + ' '
    i = i + 1
print(output)
:huaji7: :0510: :0520: :0530: :0540: :0560: :0580: 
:0590: :1020: :2010: :weibo_v_2: :0610: :2040: :2020: 
:2030: :2060: :2100: :2110: :2145: :3010: :3020: 
:4010: :4030: :4041: :5030: :5060: :6061: :6530: 
:7012: :7021: :2050: :2080: :2090: :rainbowthink: :blobrainbow: 
:blobcatrainbow: :2101: :2152: :4120: :4310: :5000: :5150: 
:5160: :3030: :3040: :3060: :4021: :4040: :4100: 
:4110: :5161: :6060: :6070: :6121: :6500: :6520: 
:7000: :0140: :0150: :0160: :0170: :0171: :0180: 
:0181: :0190: :0200: :0241: :0220: :0230: :0240: 
:0350: :0330: :0260: :0250: :0270: :0280: :0290: 
:0300: :0310: :0320: :0331: :0340: :0360: :0390: 
:0400: :0430: :0370: :0391: :0410: :0450: :0460: 
:0120: :0431: :0451: :0490: :0600: :0461: :0462: 
:0470: :0130: :0480: :huaji: :facepalm: :doge: :weibo_v_4: 
:0000: :0010: :0020: :0030: :0040: :0050: :0060: 
:0070: :0080: :0090: :0100: :0110: :0500: :7045: 
:7046: :7050: :7080: :7081: :7200: :7230: :8010: 
:8020: :8040: :8051: :8060: :8080: :8081: :8082: 
:8083: :8090: :8091: :8100: :8111: :huaji2: :huaji3: 
:huaji4: :huaji5: :huaji6: :huaji8: :verified: :thinking_very_hard: :weibo_v_1: 
:wb_mem: :weibo_v_3: :patcat: :blobcat: :blobcatsurprised: :blobcatpeek: :blobcatthink: 
:nyan_cat: :verifinking: :owi: :thinkhappy: :night: 

发布嘟嘟

进行此步前,请确认你所管理的实例已经关注目标实例的账号。

比如说,我打算将嘟嘟星云的自定义表情复制至本人的实例,那么我需要一个嘟嘟星云上的账号,而且本人实例已经关注此账号。
发布嘟嘟前,确保目标实例账号(嘟嘟星云账号)所发的嘟嘟,你所管理的实例(本人的实例)能够接收的到。

发布嘟嘟

将上一步中得到的发布文本分次使用目标实例账号(嘟嘟星云账号)发布。

你所管理的实例(本人实例)如果已经收到目标实例账号(嘟嘟星云账号)所发的全部嘟嘟,那么本步完成。

管理后台一键复制

管理后台

进入管理后台,打开 Custom emojis 选项卡,点击自己喜欢表情的 Copy 按钮,一键复制。