feat(ticket): add claim, add member, persistent management view
All checks were successful
ci / ci (push) Successful in 47s
All checks were successful
ci / ci (push) Successful in 47s
- ClaimButton: staff claim/unclaim with log - AddMemberButton: UserSelect to add member to ticket channel - TicketManagementView: persistent LayoutView with all 3 buttons - claimed_by field in TicketData - Buttons registered as persistent views for bot restart survival
This commit is contained in:
parent
80daeae55c
commit
4d1e265848
3 changed files with 135 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ from discord.ext import commands
|
|||
|
||||
from tickets import storage
|
||||
from tickets.data import TicketCategory
|
||||
from tickets.ui import PanelCreateButton
|
||||
from tickets.ui import AddMemberButton, ClaimButton, CloseButton, PanelCreateButton
|
||||
|
||||
logger = logging.getLogger("vision")
|
||||
|
||||
|
|
@ -130,12 +130,21 @@ class ConfigSetLogButton(discord.ui.Button):
|
|||
await interaction.response.send_message("Selectionnez le canal de logs :", view=view, ephemeral=True)
|
||||
|
||||
|
||||
class TicketManagementView(discord.ui.LayoutView):
|
||||
def __init__(self):
|
||||
super().__init__(timeout=None)
|
||||
container = discord.ui.Container()
|
||||
container.add_item(discord.ui.ActionRow(ClaimButton(), AddMemberButton(), CloseButton()))
|
||||
self.add_item(container)
|
||||
|
||||
|
||||
class TicketSystem(commands.Cog):
|
||||
ticket = app_commands.Group(name="ticket", description="Systeme de tickets")
|
||||
|
||||
def __init__(self, bot: commands.Bot):
|
||||
self.bot = bot
|
||||
self.bot.add_view(PanelView())
|
||||
self.bot.add_view(TicketManagementView())
|
||||
|
||||
@commands.Cog.listener()
|
||||
async def on_ready(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue