mirror of
https://github.com/RafaelSolVargas/Vulkan.git
synced 2025-10-29 16:57:23 +00:00
Deleting not used files
This commit is contained in:
parent
0c20f68c2b
commit
15f8ea7cb2
@ -1,24 +0,0 @@
|
||||
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:
|
||||
"""Callback to when Button is clicked"""
|
||||
# Return to Discord that this command is being processed
|
||||
await interaction.response.defer()
|
||||
|
||||
handler = PrevHandler(interaction, self.__bot)
|
||||
response = await handler.run()
|
||||
|
||||
if response and response.view is not None:
|
||||
await interaction.followup.send(embed=response.embed, view=response.view)
|
||||
elif response:
|
||||
await interaction.followup.send(embed=response.embed)
|
||||
@ -1,22 +0,0 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
from Handlers.LoopHandler import LoopHandler
|
||||
from Music.VulkanBot import VulkanBot
|
||||
|
||||
|
||||
class LoopAllButton(Button):
|
||||
def __init__(self, bot: VulkanBot):
|
||||
super().__init__(label="Loop All", style=ButtonStyle.secondary, emoji=VEmojis().LOOP_ALL)
|
||||
self.__bot = bot
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
await interaction.response.defer()
|
||||
|
||||
handler = LoopHandler(interaction, self.__bot)
|
||||
response = await handler.run('all')
|
||||
|
||||
if response and response.view is not None:
|
||||
await interaction.followup.send(embed=response.embed, view=response.view)
|
||||
elif response:
|
||||
await interaction.followup.send(embed=response.embed)
|
||||
@ -1,22 +0,0 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
from Handlers.LoopHandler import LoopHandler
|
||||
from Music.VulkanBot import VulkanBot
|
||||
|
||||
|
||||
class LoopOffButton(Button):
|
||||
def __init__(self, bot: VulkanBot):
|
||||
super().__init__(label="Loop Off", style=ButtonStyle.secondary, emoji=VEmojis().LOOP_OFF)
|
||||
self.__bot = bot
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
await interaction.response.defer()
|
||||
|
||||
handler = LoopHandler(interaction, self.__bot)
|
||||
response = await handler.run('off')
|
||||
|
||||
if response and response.view is not None:
|
||||
await interaction.followup.send(embed=response.embed, view=response.view)
|
||||
elif response:
|
||||
await interaction.followup.send(embed=response.embed)
|
||||
@ -1,22 +0,0 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
from Handlers.LoopHandler import LoopHandler
|
||||
from Music.VulkanBot import VulkanBot
|
||||
|
||||
|
||||
class LoopOneButton(Button):
|
||||
def __init__(self, bot: VulkanBot):
|
||||
super().__init__(label="Loop One", style=ButtonStyle.secondary, emoji=VEmojis().LOOP_ONE)
|
||||
self.__bot = bot
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
await interaction.response.defer()
|
||||
|
||||
handler = LoopHandler(interaction, self.__bot)
|
||||
response = await handler.run('one')
|
||||
|
||||
if response and response.view is not None:
|
||||
await interaction.followup.send(embed=response.embed, view=response.view)
|
||||
elif response:
|
||||
await interaction.followup.send(embed=response.embed)
|
||||
@ -1,22 +0,0 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
from Handlers.PauseHandler import PauseHandler
|
||||
from Music.VulkanBot import VulkanBot
|
||||
|
||||
|
||||
class PauseButton(Button):
|
||||
def __init__(self, bot: VulkanBot):
|
||||
super().__init__(label="Pause", style=ButtonStyle.secondary, emoji=VEmojis().PAUSE)
|
||||
self.__bot = bot
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
await interaction.response.defer()
|
||||
|
||||
handler = PauseHandler(interaction, self.__bot)
|
||||
response = await handler.run()
|
||||
|
||||
if response and response.view is not None:
|
||||
await interaction.followup.send(embed=response.embed, view=response.view)
|
||||
elif response:
|
||||
await interaction.followup.send(embed=response.embed)
|
||||
@ -1,22 +0,0 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
from Music.VulkanBot import VulkanBot
|
||||
from Handlers.ResumeHandler import ResumeHandler
|
||||
|
||||
|
||||
class PlayButton(Button):
|
||||
def __init__(self, bot: VulkanBot):
|
||||
super().__init__(label="Play", style=ButtonStyle.secondary, emoji=VEmojis().PLAY)
|
||||
self.__bot = bot
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
await interaction.response.defer()
|
||||
|
||||
handler = ResumeHandler(interaction, self.__bot)
|
||||
response = await handler.run()
|
||||
|
||||
if response and response.view is not None:
|
||||
await interaction.followup.send(embed=response.embed, view=response.view)
|
||||
elif response:
|
||||
await interaction.followup.send(embed=response.embed)
|
||||
@ -1,22 +0,0 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
from Music.VulkanBot import VulkanBot
|
||||
from Handlers.SkipHandler import SkipHandler
|
||||
|
||||
|
||||
class SkipButton(Button):
|
||||
def __init__(self, bot: VulkanBot):
|
||||
super().__init__(label="Skip", style=ButtonStyle.secondary, emoji=VEmojis().SKIP)
|
||||
self.__bot = bot
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
await interaction.response.defer()
|
||||
|
||||
handler = SkipHandler(interaction, self.__bot)
|
||||
response = await handler.run()
|
||||
|
||||
if response and response.view is not None:
|
||||
await interaction.followup.send(embed=response.embed, view=response.view)
|
||||
elif response:
|
||||
await interaction.followup.send(embed=response.embed)
|
||||
@ -1,22 +0,0 @@
|
||||
from Handlers.QueueHandler import QueueHandler
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
from Music.VulkanBot import VulkanBot
|
||||
|
||||
|
||||
class SongsButton(Button):
|
||||
def __init__(self, bot: VulkanBot):
|
||||
super().__init__(label="Songs", style=ButtonStyle.secondary, emoji=VEmojis().QUEUE)
|
||||
self.__bot = bot
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
await interaction.response.defer()
|
||||
|
||||
handler = QueueHandler(interaction, self.__bot)
|
||||
response = await handler.run()
|
||||
|
||||
if response and response.view is not None:
|
||||
await interaction.followup.send(embed=response.embed, view=response.view)
|
||||
elif response:
|
||||
await interaction.followup.send(embed=response.embed)
|
||||
@ -1,22 +0,0 @@
|
||||
from discord import ButtonStyle, Interaction
|
||||
from discord.ui import Button
|
||||
from Config.Emojis import VEmojis
|
||||
from Music.VulkanBot import VulkanBot
|
||||
from Handlers.StopHandler import StopHandler
|
||||
|
||||
|
||||
class StopButton(Button):
|
||||
def __init__(self, bot: VulkanBot):
|
||||
super().__init__(label="Stop", style=ButtonStyle.secondary, emoji=VEmojis().STOP)
|
||||
self.__bot = bot
|
||||
|
||||
async def callback(self, interaction: Interaction) -> None:
|
||||
await interaction.response.defer()
|
||||
|
||||
handler = StopHandler(interaction, self.__bot)
|
||||
response = await handler.run()
|
||||
|
||||
if response and response.view is not None:
|
||||
await interaction.followup.send(embed=response.embed, view=response.view)
|
||||
elif response:
|
||||
await interaction.followup.send(embed=response.embed)
|
||||
@ -1,43 +0,0 @@
|
||||
from discord import Message
|
||||
from discord.ui import View
|
||||
from Config.Emojis import VEmojis
|
||||
from UI.Buttons.PauseButton import PauseButton
|
||||
from UI.Buttons.BackButton import BackButton
|
||||
from UI.Buttons.SkipButton import SkipButton
|
||||
from UI.Buttons.StopButton import StopButton
|
||||
from UI.Buttons.SongsButton import SongsButton
|
||||
from UI.Buttons.PlayButton import PlayButton
|
||||
from UI.Buttons.LoopAllButton import LoopAllButton
|
||||
from UI.Buttons.LoopOneButton import LoopOneButton
|
||||
from UI.Buttons.LoopOffButton import LoopOffButton
|
||||
from Music.VulkanBot import VulkanBot
|
||||
|
||||
emojis = VEmojis()
|
||||
|
||||
|
||||
class PlayerView(View):
|
||||
def __init__(self, bot: VulkanBot, timeout: float = 6000):
|
||||
super().__init__(timeout=timeout)
|
||||
self.__bot = bot
|
||||
self.__message: Message = None
|
||||
self.add_item(BackButton(self.__bot))
|
||||
self.add_item(PauseButton(self.__bot))
|
||||
self.add_item(PlayButton(self.__bot))
|
||||
self.add_item(StopButton(self.__bot))
|
||||
self.add_item(SkipButton(self.__bot))
|
||||
self.add_item(SongsButton(self.__bot))
|
||||
self.add_item(LoopOneButton(self.__bot))
|
||||
self.add_item(LoopOffButton(self.__bot))
|
||||
self.add_item(LoopAllButton(self.__bot))
|
||||
|
||||
async def on_timeout(self) -> None:
|
||||
# Disable all itens and, if has the message, edit it
|
||||
try:
|
||||
self.disable_all_items()
|
||||
if self.__message is not None and isinstance(self.__message, Message):
|
||||
await self.__message.edit(view=self)
|
||||
except Exception as e:
|
||||
print(f'[ERROR EDITING MESSAGE] -> {e}')
|
||||
|
||||
def set_message(self, message: Message) -> None:
|
||||
self.__message = message
|
||||
Loading…
x
Reference in New Issue
Block a user