Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit 1c57f60

Browse files
committed
fix TypeError: 'EMPTY' is not a callable object
1 parent 4c201e8 commit 1c57f60

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ You can find more (and better) examples [here](https://github.com/discord-py-ui/
176176

177177
# Changelog
178178

179+
- <details>
180+
<summary>4.1.13</summary>
181+
182+
## **Fixed**
183+
- `TypeError: 'EMPTY' is not a callable object` in context commands
184+
185+
</details>
186+
179187
- <details>
180188
<summary>4.2.12</summary>
181189

discord_ui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@
4444

4545

4646
__title__ = "discord-ui"
47-
__version__ = "4.2.12"
47+
__version__ = "4.2.13"

discord_ui/receive.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@ def __init__(self, client, command, data, user, args = None, guild_ids = None, g
330330
class SlashedContext(Interaction, ContextCommand):
331331
def __init__(self, client, command: ContextCommand, data, user, param, guild_ids = None, guild_permissions = None) -> None:
332332
Interaction.__init__(self, client._connection, data, user)
333-
ContextCommand.__init__(self, None, "EMPTY", guild_ids=guild_ids, guild_permissions=guild_permissions)
334-
self.bot: Bot = client
333+
ContextCommand.__init__(self, data["data"]["type"], None, "EMPTY", guild_ids=guild_ids, guild_permissions=guild_permissions)
335334
self._json = command.to_dict()
335+
self.bot: Bot = client
336336
self.guild_ids: List[int] = guild_ids
337337
"""The guild_ids where the command is available"""
338338
self.param: Union[Message, discord.Member, discord.User] = param
@@ -380,7 +380,7 @@ def __init__(self, *, state, channel, data):
380380
self._payload = data
381381

382382
self._state: ConnectionState = None
383-
super().__init__(state=state, channel=channel, data=data)
383+
discord.Message.__init__(self, state=state, channel=channel, data=data)
384384
self.components: List[Union[Button, LinkButton, SelectMenu]] = []
385385
"""The components in the message
386386

discord_ui/slash/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,8 @@ def options(self, value):
584584

585585
class UserCommand(ContextCommand):
586586
def __init__(self, callback, name=MISSING, guild_ids = MISSING, default_permission = True, guild_permissions = MISSING) -> None:
587-
super().__init__(CommandType.USER, callback, name, guild_ids, default_permission, guild_permissions)
587+
ContextCommand.__init__(self, CommandType.USER, callback, name, guild_ids, default_permission, guild_permissions)
588588

589589
class MessageCommand(ContextCommand):
590590
def __init__(self, callback, name=MISSING, guild_ids = MISSING, default_permission = True, guild_permissions = MISSING) -> None:
591-
super().__init__(CommandType.MESSAGE, callback, name, guild_ids, default_permission, guild_permissions)
591+
ContextCommand.__init__(self, CommandType.MESSAGE, callback, name, guild_ids, default_permission, guild_permissions)

0 commit comments

Comments
 (0)