Make messages ephemeral and bump discord.py
Make certain bot responses ephemeral to avoid spamming channels (debug command and missing-permission reply). Bump discord.py from 2.7.0 to 2.7.1 in requirements. Remove an unused Config().get_playlist_config() assignment in updatePlaylist to clean up dead code.
This commit is contained in:
@@ -337,7 +337,7 @@ class Settings(commands.Cog, name="settings"):
|
|||||||
@app_commands.command(name="debug")
|
@app_commands.command(name="debug")
|
||||||
async def debug(self, interaction: discord.Interaction):
|
async def debug(self, interaction: discord.Interaction):
|
||||||
if interaction.user.id not in voicelink.Config().bot_access_user:
|
if interaction.user.id not in voicelink.Config().bot_access_user:
|
||||||
return await interaction.response.send_message("You are not able to use this command!")
|
return await interaction.response.send_message("You are not able to use this command!", ephemeral=True)
|
||||||
|
|
||||||
memory = psutil.virtual_memory()
|
memory = psutil.virtual_memory()
|
||||||
disk = psutil.disk_usage(func.ROOT_DIR)
|
disk = psutil.disk_usage(func.ROOT_DIR)
|
||||||
|
|||||||
2
main.py
2
main.py
@@ -191,7 +191,7 @@ class CommandCheck(discord.app_commands.CommandTree):
|
|||||||
|
|
||||||
channel_perm = interaction.channel.permissions_for(interaction.guild.me)
|
channel_perm = interaction.channel.permissions_for(interaction.guild.me)
|
||||||
if not channel_perm.read_messages or not channel_perm.send_messages:
|
if not channel_perm.read_messages or not channel_perm.send_messages:
|
||||||
await interaction.response.send_message("I don't have permission to read or send messages in this channel.")
|
await interaction.response.send_message("I don't have permission to read or send messages in this channel.", ephemeral=True)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
discord.py==2.7.0
|
discord.py==2.7.1
|
||||||
motor==3.6.0
|
motor==3.6.0
|
||||||
dnspython==2.2.1
|
dnspython==2.2.1
|
||||||
tldextract==3.2.1
|
tldextract==3.2.1
|
||||||
|
|||||||
@@ -508,7 +508,6 @@ async def updatePlaylist(bot: commands.Bot, data: Dict) -> Dict:
|
|||||||
if playlist['type'] in ['share', 'link']:
|
if playlist['type'] in ['share', 'link']:
|
||||||
return error_msg("You cannot add songs to a linked playlist through Vocard.", user_id=user_id, level='error')
|
return error_msg("You cannot add songs to a linked playlist through Vocard.", user_id=user_id, level='error')
|
||||||
|
|
||||||
max_p, max_t, _ = Config().get_playlist_config()
|
|
||||||
if len(playlist['tracks']) >= max_t:
|
if len(playlist['tracks']) >= max_t:
|
||||||
return error_msg(f"You have reached the limit! You can only add {max_t} songs to your playlist.", user_id=user_id)
|
return error_msg(f"You have reached the limit! You can only add {max_t} songs to your playlist.", user_id=user_id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user