Skip to content

Instantly share code, notes, and snippets.

@1ort
Last active March 11, 2023 18:13
Show Gist options
  • Save 1ort/4b9a830800b431092e8bca03c4c8dac0 to your computer and use it in GitHub Desktop.
Save 1ort/4b9a830800b431092e8bca03c4c8dac0 to your computer and use it in GitHub Desktop.
disp = {
"button_1": (
"Вы выбрали организацию транспортировки.",
[
guild.get_role(config.ROLE_ID_TheHeadInnkeeper),
guild.get_role(config.ROLE_ID_TheRoyalFamily),
guild.get_role(config.ROLE_ID_Courier),
guild.get_role(config.ROLE_ID_Porter),
guild.get_role(config.ROLE_ID_Security),
guild.get_role(config.ROLE_ID_Technician),
],
"Организация Транспортировки | Guest Static",
2,
),
"button_2": ...,
"button_3": ...,
"button_4": ...,
"button_5": ...,
"button_6": ...,
"button_7": ...,
}
@client.event
async def on_interaction(interaction):
try:
message_text, roles, local_name, price = disp[interaction.data["custom_id"]]
except KeyError:
... # Обработка непредусмотренной кнопки
else:
await interaction.response.send_message(message_text, ephemeral=True)
await threader(local_name, roles, interaction)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment