Skip to content

Commit

Permalink
Add support for SimpleMenu to use custom select options
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Nov 24, 2024
1 parent 33e0eac commit 7ab48d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions redbot/core/utils/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ async def start(
Send the message ephemerally. This only works
if the context is from a slash command interaction.
"""
if self.use_select_menu and self.source.is_paginating():
self.remove_item(self.select_menu)
# we added a default one in init so we want to remove it and add any changes here
self.select_menu = self._get_select_menu()
self.add_item(self.select_menu)
self._fallback_author_to_ctx = True
if user is not None:
self.author = user
Expand All @@ -285,6 +290,11 @@ async def start_dm(self, user: discord.User):
user: `discord.User`
The user that will be direct messaged by the bot.
"""
if self.use_select_menu and self.source.is_paginating():
self.remove_item(self.select_menu)
# we added a default one in init so we want to remove it and add any changes here
self.select_menu = self._get_select_menu()
self.add_item(self.select_menu)
self.author = user
kwargs = await self.get_page(self.current_page)
self.message = await user.send(**kwargs)
Expand Down

0 comments on commit 7ab48d9

Please sign in to comment.