diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..9d7c696 Binary files /dev/null and b/.DS_Store differ diff --git a/cogs/basic.py b/cogs/basic.py index f1f85d7..06baea6 100644 --- a/cogs/basic.py +++ b/cogs/basic.py @@ -195,7 +195,7 @@ class Basic(commands.Cog): else: position = await player.add_track(tracks[0]) texts = await get_lang(interaction.guild.id, "live", "trackLoad_pos", "trackLoad") - await interaction.response.send_message((f"`{texts[0]}`" if tracks[0].is_stream else "") + (texts[1].format(tracks[0].title, tracks[0].uri, tracks[0].author, tracks[0].formatted_length, position) if position >= 1 and player.is_playing else texts[2].format(tracks[0].title, tracks[0].uri, tracks[0].author, tracks[0].formatted_length)), allowed_mentions=False) + await interaction.followup.send((f"`{texts[0]}`" if tracks[0].is_stream else "") + (texts[1].format(tracks[0].title, tracks[0].uri, tracks[0].author, tracks[0].formatted_length, position) if position >= 1 and player.is_playing else texts[2].format(tracks[0].title, tracks[0].uri, tracks[0].author, tracks[0].formatted_length)), allowed_mentions=False) except voicelink.QueueFull as e: await interaction.followup.send(e) diff --git a/function.py b/function.py index 9dbf1b0..6e09f5e 100644 --- a/function.py +++ b/function.py @@ -78,11 +78,15 @@ def langs_setup() -> None: return -def time(millis:int) -> str: - seconds=(millis/1000)%60 - minutes=(millis/(1000*60))%60 - hours=(millis/(1000*60*60))%24 - if hours > 1: +def time(millis: int) -> str: + seconds = (millis // 1000) % 60 + minutes = (millis // (1000 * 60)) % 60 + hours = (millis // (1000 * 60 * 60)) % 24 + days = millis // (1000 * 60 * 60 * 24) + + if days > 0: + return "%d days, %02d:%02d:%02d" % (days, hours, minutes, seconds) + elif hours > 0: return "%d:%02d:%02d" % (hours, minutes, seconds) else: return "%02d:%02d" % (minutes, seconds) diff --git a/ipc/methods.py b/ipc/methods.py index fd6cdcb..e153e0f 100644 --- a/ipc/methods.py +++ b/ipc/methods.py @@ -619,11 +619,11 @@ async def getSettings(bot: commands.Bot, data: Dict) -> Dict: guild = bot.get_guild(guild_id) if not guild: - return error_msg("Vocard don't have access to required guild.", user_id=user_id, level="error") + return error_msg("Vocard don't have access to requested guild.", user_id=user_id, level="error") member = guild.get_member(user_id) if not member: - return error_msg("You are not in the required guild.", user_id=user_id, level="error") + return error_msg("You are not in the requested guild.", user_id=user_id, level="error") if not member.guild_permissions.manage_guild: return error_msg("You don't have permission to access the settings.", user_id=user_id, level='error') @@ -768,7 +768,7 @@ async def process_methods(ipc_client, bot: commands.Bot, data: Dict) -> None: return player = await connect_channel(member, bot) - if player.channel.id != member.voice.channel.id: + if not player or player.channel.id != member.voice.channel.id: return env["player"] = player