小编Bab*_*lup的帖子

Discord.py create_custom_emojis用法

我正在用Discord.py做一个机器人,我对如何使用该函数有些疑问,create_custom_emojis()因为无论做什么,我都会收到HTTP错误400。

这是我创建表情符号的代码:

with open("data/emojis/image.png", "rb") as image:
    image_byte = image.read()
    emoji = await self.bot.create_custom_emoji(server, name="emo", image=image_byte)
Run Code Online (Sandbox Code Playgroud)

我得到的错误是:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python35\lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "C:\Users\armel\Downloads\Discord bot\Red-DiscordBot\cogs\moga.py", line 385, in read_feeds
    message = await self._feed_check(server, chan_id, name, infos)
  File "C:\Users\armel\Downloads\Discord bot\Red-DiscordBot\cogs\moga.py", line 198, in _feed_check
    await self.create_custom_emojis(server)
  File "C:\Users\armel\Downloads\Discord bot\Red-DiscordBot\cogs\moga.py", line 189, in create_custom_emojis
    emoji = await self.bot.create_custom_emoji(server, name=name, image=image_byte)
  File "lib\discord\client.py", line 2519, in create_custom_emoji
    data = yield …
Run Code Online (Sandbox Code Playgroud)

python discord

5
推荐指数
1
解决办法
1451
查看次数

标签 统计

discord ×1

python ×1