Compare commits
4 Commits
0499339b00
...
7275c83e98
Author | SHA1 | Date |
---|---|---|
fanyx | 7275c83e98 | |
fanyx | 04a51e3695 | |
fanyx | 13cc7a7f8a | |
fanyx | dfa2ce0eb0 |
10
main.py
10
main.py
|
@ -1,6 +1,5 @@
|
|||
#!/bin/env python3
|
||||
from typing import Literal, Optional
|
||||
from emoji import emojize
|
||||
from yaml import safe_load
|
||||
|
||||
import discord
|
||||
|
@ -8,7 +7,6 @@ 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):
|
||||
|
@ -31,11 +29,17 @@ 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 ~
|
||||
# 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()
|
||||
|
|
Loading…
Reference in New Issue