Slash Commands with ViewMenu showing error on Discord Client
Dynamixus opened this issue Β· comments
Describe the bug
Whenever I run a ViewMenu command as a Slash Command, the bot sends an Ephemeral Message saying
The application did not respond
I'm following the basic format. The command is a hybrid_command, and while the Slash Command raises an Error, the prefix command works without any issue.
Minimal Reproducible Code
from reactionmenu import ViewMenu, ViewSelect, Page, ViewButton
from datetime import datetime, timedelta
import discord
from discord import app_commands
from discord.ext import commands
from discord.ext.commands import Context
class General(commands.Cog, name="general"):
def __init__(self, bot):
self.bot = bot
@commands.hybrid_command(name = "uwu", description = "...")
@checks.not_blacklisted()
async def uwu(self, context: Context) -> None:
menu = ViewMenu(context, menu_type = ViewMenu.TypeEmbed, disable_items_on_timeout = False, remove_items_on_timeout = True, timeout = 600.0)
page1 = discord.Embed(
title="uwu1",
description="...",
color=0x752C18,
timestamp=datetime.now(),
)
page2 = discord.Embed(
title="uwu2",
description="...",
color=0x752C18,
timestamp=datetime.now(),
)
menu.add_page(page1)
menu.add_page(page2)
menu.add_button(ViewButton(style=discord.ButtonStyle.primary, emoji='π', label='x', custom_id = ViewButton.ID_GO_TO_FIRST_PAGE))
menu.add_button(ViewButton(style=discord.ButtonStyle.primary, emoji='π', label='y', custom_id = ViewButton.ID_GO_TO_LAST_PAGE))
menu.add_button(ViewButton(style=discord.ButtonStyle.danger, label = "Close", custom_id = ViewButton.ID_END_SESSION))
await menu.start()
Traceback
None
Library Version
- Python v3.10.0-final
- discord.py v2.3.1-final
- aiohttp v3.8.4
- system info: Windows 10 10.0.19044
Required Checklist
- I am using discord.py 2.0 or higher
- I am using reactionmenu 3.1.0 or higher
- I have the required intents enabled
Additional Comments
No response
This has been fixed as of v3.1.4. It has not been released to PyPI. It's planned to officially release in a few weeks, maybe the end of the month. In the mean time, you can install the development version of v3.1.4 by checking out the how to install section of the readme.
Thank you for reporting the issue! π