From 57ac2bc6a86950366c374cda38df33d1e9f838a3 Mon Sep 17 00:00:00 2001 From: Choco <94597336+ChocoMeow@users.noreply.github.com> Date: Wed, 2 Aug 2023 21:40:00 +0800 Subject: [PATCH] General clean code --- main.py | 1 + views/controller.py | 4 ++-- views/help.py | 10 +++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index d237991..beb3263 100644 --- a/main.py +++ b/main.py @@ -77,6 +77,7 @@ class Vocard(commands.Bot): print("------------------") func.tokens.client_id = self.user.id + func.local_langs.clear() async def on_command_error(self, ctx: commands.Context, exception, /) -> None: error = getattr(exception, 'original', exception) diff --git a/views/controller.py b/views/controller.py index 743e93b..06c087e 100644 --- a/views/controller.py +++ b/views/controller.py @@ -50,10 +50,10 @@ class ControlButton(discord.ui.Button): super().__init__(label=player.get_msg(label) if label else None, **kwargs) async def send(self, interaction: discord.Interaction, content: str, *, ephemeral: bool = False) -> None: - remove = self.player.settings.get("controller_msg", True) + stay = self.player.settings.get("controller_msg", True) return await interaction.response.send_message( content, - delete_after=None if (ephemeral or not remove) is True else 10, + delete_after=None if (not ephemeral or stay) is True else 10, ephemeral=ephemeral ) diff --git a/views/help.py b/views/help.py index bfd4d27..7fa0dd0 100644 --- a/views/help.py +++ b/views/help.py @@ -59,7 +59,7 @@ class HelpView(discord.ui.View): self.add_item(discord.ui.Button(label='Support', emoji=':support:915152950471581696', url=func.settings.invite_link)) self.add_item(discord.ui.Button(label='Invite', emoji=':invite:915152589056790589', url='https://discord.com/oauth2/authorize?client_id={}&permissions=2184260928&scope=bot%20applications.commands'.format(func.tokens.client_id))) - self.add_item(discord.ui.Button(label='Github', url='https://github.com/ChocoMeow/Vocard')) + self.add_item(discord.ui.Button(label='Github', emoji=':github:1098265017268322406', url='https://github.com/ChocoMeow/Vocard')) self.add_item(discord.ui.Button(label='Donate', emoji=':patreon:913397909024800878', url='https://www.patreon.com/Vocard')) self.add_item(HelpDropdown(self.categorys)) @@ -89,13 +89,9 @@ class HelpView(discord.ui.View): value="```py\nšŸ‘‰ News\n2. Tutorial\n{}```".format("".join(f"{i}. {c}\n" for i, c in enumerate(self.categorys, start=3))), inline=True) - update = "> Update Contents\n" \ - "āž„ More text support for other languages\n" \ - "āž„ Add author name in playing track msg\n" \ - "āž„ Fixed some commands\n\n" \ - "[Click Me For More Info](https://discord.com/channels/811542332678996008/811909963718459392/1063728318777671741)" \ + update = "Vocard is a simple music bot. It leads to a comfortable experience which is user-friendly, It supports YouTube, Soundcloud, Spotify, Twitch and more!" - embed.add_field(name="šŸ“° Latest News ()", value=update, inline=True) + embed.add_field(name="šŸ“° Information:", value=update, inline=True) embed.add_field(name="Get Started", value="```Join a voice channel and /play {Song/URL} a song. (Names, Youtube Video Links or Playlist links or Spotify links are supported on Vocard)```", inline=False) return embed