-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjusting so funcationality is restored.
- Loading branch information
Showing
7 changed files
with
38 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bot = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import discord | ||
from discord.ui import Select | ||
|
||
|
||
class UpdateSelector(Select): | ||
def __init__(self, search_results, information): | ||
self.search_results = search_results | ||
self.information = information | ||
max_options = 10 | ||
options = [ | ||
discord.SelectOption( | ||
label=f"{user['paymentPerson']} | {user['server']} ({user['status']})", | ||
value=str(idx), | ||
description=f"Discord: {user['primaryDiscord'] if user['primaryDiscord'] else 'N/A'} | Email: {user['primaryEmail']}", | ||
emoji="👤" | ||
) | ||
for idx, user in enumerate(search_results[:max_options]) | ||
] | ||
max_values = min(len(search_results), max_options) | ||
super().__init__(placeholder="Please select the user", options=options, min_values=1, max_values=max_values) | ||
|
||
async def callback(self, interaction: discord.Interaction): | ||
selected_user_indices = [int(value) for value in self.values] | ||
selected_users = [self.search_results[idx] for idx in selected_user_indices] | ||
self.information.setdefault('users', []).extend(selected_users) | ||
|
||
if self.information['what'] == 'payment': | ||
await self.view.handle_payment(interaction, selected_users) | ||
elif self.information['what'] == 'move': | ||
await self.view.handle_move(interaction, selected_users) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters