mirror of
https://github.com/RafaelSolVargas/Vulkan.git
synced 2025-10-29 16:57:23 +00:00
Subclassing Button class for each button, changing context interface for handlers
This commit is contained in:
24
UI/Buttons/BackButton.py
Normal file
24
UI/Buttons/BackButton.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
from Handlers.PrevHandler import PrevHandler
|
||||
from Music.VulkanBot import VulkanBot
|
||||
|
||||
|
||||
class BackButton(Button):
|
||||
def __init__(self, bot: VulkanBot):
|
||||
super().__init__(label="Back", style=ButtonStyle.secondary, emoji=VEmojis().BACK)
|
||||
self.__bot = bot
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
await interaction.response.defer()
|
||||
|
||||
handler = PrevHandler(interaction, self.__bot)
|
||||
response = await handler.run()
|
||||
print(response)
|
||||
print(response.success)
|
||||
print(response.error)
|
||||
print(response.error)
|
||||
print(response.embed)
|
||||
if response.embed:
|
||||
await interaction.followup.send(embed=response.embed)
|
||||
11
UI/Buttons/LoopAllButton.py
Normal file
11
UI/Buttons/LoopAllButton.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
|
||||
|
||||
class LoopAllButton(Button):
|
||||
def __init__(self):
|
||||
super().__init__(label="Loop All", style=ButtonStyle.secondary, emoji=VEmojis().LOOP_ALL)
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
pass
|
||||
11
UI/Buttons/LoopOffButton.py
Normal file
11
UI/Buttons/LoopOffButton.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
|
||||
|
||||
class LoopOffButton(Button):
|
||||
def __init__(self):
|
||||
super().__init__(label="Loop Off", style=ButtonStyle.secondary, emoji=VEmojis().LOOP_OFF)
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
pass
|
||||
11
UI/Buttons/LoopOneButton.py
Normal file
11
UI/Buttons/LoopOneButton.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
|
||||
|
||||
class LoopOneButton(Button):
|
||||
def __init__(self):
|
||||
super().__init__(label="Loop One", style=ButtonStyle.secondary, emoji=VEmojis().LOOP_ONE)
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
pass
|
||||
11
UI/Buttons/PauseButton.py
Normal file
11
UI/Buttons/PauseButton.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
|
||||
|
||||
class PauseButton(Button):
|
||||
def __init__(self):
|
||||
super().__init__(label="Pause", style=ButtonStyle.secondary, emoji=VEmojis().PAUSE)
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
pass
|
||||
11
UI/Buttons/PlayButton.py
Normal file
11
UI/Buttons/PlayButton.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
|
||||
|
||||
class PlayButton(Button):
|
||||
def __init__(self):
|
||||
super().__init__(label="Play", style=ButtonStyle.secondary, emoji=VEmojis().PLAY)
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
pass
|
||||
11
UI/Buttons/SkipButton.py
Normal file
11
UI/Buttons/SkipButton.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
|
||||
|
||||
class SkipButton(Button):
|
||||
def __init__(self):
|
||||
super().__init__(label="Skip", style=ButtonStyle.secondary, emoji=VEmojis().SKIP)
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
pass
|
||||
11
UI/Buttons/SongsButton.py
Normal file
11
UI/Buttons/SongsButton.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
|
||||
|
||||
class SongsButton(Button):
|
||||
def __init__(self):
|
||||
super().__init__(label="Songs", style=ButtonStyle.secondary, emoji=VEmojis().QUEUE)
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
pass
|
||||
11
UI/Buttons/StopButton.py
Normal file
11
UI/Buttons/StopButton.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
|
||||
|
||||
class StopButton(Button):
|
||||
def __init__(self):
|
||||
super().__init__(label="Stop", style=ButtonStyle.secondary, emoji=VEmojis().STOP)
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
pass
|
||||
Reference in New Issue
Block a user