nextcord / nextcord

A Python wrapper for the Discord API forked from discord.py
https://docs.nextcord.dev
MIT License
1.19k stars 189 forks source link

Welcome screen edit invalid emoji #74

Closed ooliver1 closed 3 years ago

ooliver1 commented 3 years ago
Traceback (most recent call last):
  File "/home/ooliver/projects/tooty-beta/env/lib/python3.8/site-packages/jishaku/features/python.py", line 145, in jsk_python
    async for send, result in AsyncSender(executor):
  File "/home/ooliver/projects/tooty-beta/env/lib/python3.8/site-packages/jishaku/functools.py", line 109, in _internal
    value = await base.asend(self.send_value)
  File "/home/ooliver/projects/tooty-beta/env/lib/python3.8/site-packages/jishaku/repl/compilation.py", line 140, in traverse
    async for send, result in AsyncSender(func(*self.args)):
  File "/home/ooliver/projects/tooty-beta/env/lib/python3.8/site-packages/jishaku/functools.py", line 109, in _internal
    value = await base.asend(self.send_value)
  File "<repl>", line 3, in _repl_coroutine
    await wc.edit(
  File "/home/ooliver/projects/tooty-beta/env/lib/python3.8/site-packages/nextcord/welcome_screen.py", line 198, in edit
    data = await self._state.http.edit_welcome_screen(self._guild.id, kwargs)
  File "/home/ooliver/projects/tooty-beta/env/lib/python3.8/site-packages/nextcord/http.py", line 336, in request
    raise HTTPException(response, data)
nextcord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In welcome_channels: Invalid emoji for welcome channel.

&jsk py

wc = await _guild.welcome_screen()
await wc.edit(
    welcome_channels=[
        discord.WelcomeChannel(
            channel=_bot.get_channel(802586580766162967),
            description="general",
            emoji=":exclamation:"
        ),
        discord.WelcomeChannel(
            channel=_bot.get_channel(881874888590241832),
            description="general-2",
            emoji=":exclamation:"
        )
    ]
)

this is only an issue when PR 66 is merged

*same happened with <:name:id> custom emojis and raw unicode (\:car:)

TAG-Epic commented 3 years ago

It needs a Emoji or PartialEmoji.