mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-17 15:22:10 +00:00
Safeguard against commands being used in dms
This commit is contained in:
@@ -342,9 +342,10 @@ async def on_message(message):
|
|||||||
if isinstance(message.channel, discord.DMChannel):
|
if isinstance(message.channel, discord.DMChannel):
|
||||||
channel = client.get_channel(1064888712565100614)
|
channel = client.get_channel(1064888712565100614)
|
||||||
await channel.send("Słyszałem ja żem że: " + message.content)
|
await channel.send("Słyszałem ja żem że: " + message.content)
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
channel = message.channel
|
channel = message.channel
|
||||||
await client.process_commands(message)
|
await client.process_commands(message)
|
||||||
|
|
||||||
message.content = message.content.lower()
|
message.content = message.content.lower()
|
||||||
|
|
||||||
@@ -1077,8 +1078,10 @@ async def get_file(ctx, source, link):
|
|||||||
dir_path = None
|
dir_path = None
|
||||||
item_type, item_id = spotify.parse_spotify_url(link)
|
item_type, item_id = spotify.parse_spotify_url(link)
|
||||||
if item_id:
|
if item_id:
|
||||||
file_list = spotify.fetch_tracks(spotify_ctrl, item_type, link)
|
coro = asyncio.to_thread(spotify.fetch_tracks, args=(spotify_ctrl, item_type, link))
|
||||||
directory_name = spotify.get_item_name(spotify_ctrl, item_type, item_id)
|
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_data = {"urls": []}
|
||||||
url_dict = {}
|
url_dict = {}
|
||||||
url_dict["save_path"] = Path(
|
url_dict["save_path"] = Path(
|
||||||
|
|||||||
Reference in New Issue
Block a user