Compare commits

..

No commits in common. "7275c83e98685fd8ae5c3d217c600ff1ddc95697" and "0499339b000aed63257aed7087667d4281df28c5" have entirely different histories.

2 changed files with 4 additions and 8 deletions

10
main.py
View File

@ -1,5 +1,6 @@
#!/bin/env python3
from typing import Literal, Optional
from emoji import emojize
from yaml import safe_load
import discord
@ -7,6 +8,7 @@ from discord.ext import commands
from discord.ext.commands import Greedy, Context
from discord import app_commands
from src.roles import AddRoleButton, RemoveRoleButton
from src.ui import RoleSelectView
class Bot(commands.Bot):
@ -29,17 +31,11 @@ roles = app_commands.Group(name="roles", description="Manage role dialogues")
# Commands
## Group: roles
@commands.guild_only()
@commands.has_permissions(administrator=True)
@roles.command(name="create")
async def roles_create_button(interaction: discord.Interaction):
await interaction.response.send_message(view=RoleSelectView())
# 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
# Sync using ,sync ~
@client.command()
@commands.guild_only()
@commands.is_owner()

View File

@ -9,7 +9,7 @@ class RoleSelectView(View):
super().__init__(timeout=None)
self.add_item(
AddRoleButton(
style=ButtonStyle.secondary,
style=ButtonStyle.primary,
label="Add Roles",
emoji=PartialEmoji.from_str(emojize(":check_mark_button:")),
custom_id="role_select:add"