From 04a51e3695420b2b22af50115f71b479997f4af9 Mon Sep 17 00:00:00 2001 From: fanyx Date: Tue, 23 Jan 2024 17:57:37 +0100 Subject: [PATCH] Small cleanups, clarification on sync command --- main.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/main.py b/main.py index cabe4df..dcd903b 100755 --- a/main.py +++ b/main.py @@ -1,14 +1,12 @@ #!/bin/env python3 from typing import Literal, Optional -from emoji import emojize from yaml import safe_load import discord from discord.ext import commands from discord.ext.commands import Greedy, Context -from discord import app_commands, Embed +from discord import app_commands -from src.roles import AddRoleButton, RemoveRoleButton from src.ui import RoleSelectView class Bot(commands.Bot): @@ -34,18 +32,13 @@ roles = app_commands.Group(name="roles", description="Manage role dialogues") @commands.guild_only() @roles.command(name="create") async def roles_create_button(interaction: discord.Interaction): - await interaction.response.send_message( - view=RoleSelectView(), - embed=Embed( - title="Available Roles:", - description="\n".join([ - f"{interaction.client.get_emoji(role['emoji'])} {interaction.guild.get_role(role['id']).mention}" - for role in interaction.client.config['roles'] - ]) - ) - ) + await interaction.response.send_message(view=RoleSelectView()) -# Sync using ,sync ~ +# Sync using ,sync [~, *, ^] +# https://about.abstractumbra.dev/discord.py/2023/01/29/sync-command-example.html +# ~ -> Current guild +# * -> Global +# ^ -> Clear global tree, sync to current guild @client.command() @commands.guild_only() @commands.is_owner()