Safeguard against commands being used in dms

This commit is contained in:
2024-04-12 13:41:44 +02:00
parent 281ab9a4d3
commit 714fcc9e1d
+6 -3
View File
@@ -342,9 +342,10 @@ async def on_message(message):
if isinstance(message.channel, discord.DMChannel):
channel = client.get_channel(1064888712565100614)
await channel.send("Słyszałem ja żem że: " + message.content)
return
else:
channel = message.channel
await client.process_commands(message)
await client.process_commands(message)
message.content = message.content.lower()
@@ -1077,8 +1078,10 @@ async def get_file(ctx, source, link):
dir_path = None
item_type, item_id = spotify.parse_spotify_url(link)
if item_id:
file_list = spotify.fetch_tracks(spotify_ctrl, item_type, link)
directory_name = spotify.get_item_name(spotify_ctrl, item_type, item_id)
coro = asyncio.to_thread(spotify.fetch_tracks, args=(spotify_ctrl, item_type, link))
file_list = await coro
coro = asyncio.to_thread(spotify.get_item_name, args=(spotify_ctrl, item_type, item_id))
directory_name = await coro
url_data = {"urls": []}
url_dict = {}
url_dict["save_path"] = Path(