EQUENOS / dislash.py

A Python wrapper for discord slash-commands and buttons, designed to extend discord.py.

Home Page:https://dislashpy.readthedocs.io/en/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I think I found a Bug

BlazenBoi opened this issue · comments

When you try to make a dropdown menu inside of the on_dropdown event it seems to break with this error

"Ignoring exception in on_socket_response
Traceback (most recent call last):
File "C:\Users\runne\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\runne\AppData\Local\Programs\Python\Python39\lib\site-packages\dislash\slash_commands\slash_client.py", line 1050, in _on_socket_response
await self._process_interaction(payload["d"])
File "C:\Users\runne\AppData\Local\Programs\Python\Python39\lib\site-packages\dislash\slash_commands\slash_client.py", line 1141, in _process_interaction
inter = MessageInteraction(self.client, payload)
File "C:\Users\runne\AppData\Local\Programs\Python\Python39\lib\site-packages\dislash\interactions\message_interaction.py", line 46, in init
channel_id = int(msg_data["channel_id"])
KeyError: 'channel_id'"

"@bot.event
async def on_dropdown(inter: MessageInteraction):
if inter.component.custom_id == "HelpModuleMenu":
values = [option.value for option in inter.select_menu.selected_options]
labels = [option.label for option in inter.select_menu.selected_options]
value = values[0]
optionst = ["Test1", "Test2", "Test3"]
options = []
for module in optionst:
options.append(SelectOption(f"{module}", f"{module}"))
await inter.create_response(f"{value} Module has been Selected. Please pick a Command to get the help for that Command.", components=[
SelectMenu(
custom_id="HelpCommandMenu",
placeholder="Choose a minimum of 1 options",
max_values=1,
options=options
)
], ephemeral = True)
elif inter.component.custom_id == "HelpCommandMenu":
values = [option.value for option in inter.select_menu.selected_options]
labels = [option.label for option in inter.select_menu.selected_options]
value = values[0]
await inter.create_response(f"{value} Module has been Selected. Please pick a Command to get the help for that Command.", ephemeral = True)
else:
pass"