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

Commit a5fe116

Browse files
committed
Update 0.1.1
Added `discord-interactions` callback
1 parent b32f9a0 commit a5fe116

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

discord_slash_components_bridge/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@
66

77
class SlashCommand(_SlashCommand):
88
_components_callback = {}
9+
10+
911
async def _on_component(self, to_use):
1012
ctx = ComponentContext(self.req, to_use, self._discord, self.logger)
1113
self._discord.dispatch("component", ctx)
1214

15+
# discord-interactions callback
16+
callback = self.get_component_callback(
17+
ctx.origin_message_id, ctx.custom_id, ctx.component_type
18+
)
19+
if callback is not None:
20+
self._discord.dispatch("component_callback", ctx, callback)
21+
await self.invoke_component_callback(callback, ctx)
22+
23+
# discord-components callback
1324
if self._components_callback.get(ctx.custom_id):
1425
callback_info = self._components_callback[ctx.custom_id]
1526
if callback_info["uses"] == 0:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.0"
1+
__version__ = "0.1.1"

0 commit comments

Comments
 (0)