mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 13:34:40 +00:00
Work ongoing - rich presence and ai assistant
This commit is contained in:
+10
-8
@@ -605,7 +605,7 @@ class MusicModule(commands.Cog):
|
||||
)
|
||||
async def batch_download(self, ctx):
|
||||
content_type = ctx.message.attachments[0].content_type
|
||||
check = re.search ("text\/plain; *charset=(.*)", content_type, re.IGNORECASE)
|
||||
check = re.search("text\/plain; *charset=(.*)", content_type, re.IGNORECASE)
|
||||
await ctx.reply("Kurwa. Aleś mi roboty narobił... No nic. Ku radości. Skal!")
|
||||
async with ctx.typing():
|
||||
if check:
|
||||
@@ -619,16 +619,20 @@ class MusicModule(commands.Cog):
|
||||
self.logger.info(link)
|
||||
pat = r"^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$"
|
||||
self.logger.info("Verification")
|
||||
if re.match(pat, link) and (re.match(".*youtube.*", link) or re.match(".*youtu.be.*", link)):
|
||||
if re.match(pat, link) and (
|
||||
re.match(".*youtube.*", link) or re.match(".*youtu.be.*", link)
|
||||
):
|
||||
self.logger.info("%s to link do jutuba", link)
|
||||
dir_path, files = await music_functions.get_file(
|
||||
dir_path, files = await music_functions.get_file(
|
||||
ctx, "Youtube", link
|
||||
)
|
||||
if files:
|
||||
for file_iter in files:
|
||||
global MUZYKA # pylint: disable=global-variable-not-assigned
|
||||
MUZYKA["queue"].insert(0, file_iter)
|
||||
music_functions.MUSIC_FILE_LIST.update_file_list(file_iter)
|
||||
music_functions.MUSIC_FILE_LIST.update_file_list(
|
||||
file_iter
|
||||
)
|
||||
MUZYKA["requester"].insert(0, ctx.author)
|
||||
await ctx.send(f"Dodałem do listy {file_iter}")
|
||||
self.logger.info("Jutub udany")
|
||||
@@ -668,10 +672,9 @@ class MusicModule(commands.Cog):
|
||||
)
|
||||
self.logger.info("Spotifaj udany")
|
||||
|
||||
|
||||
elif re.match(pat, link):
|
||||
self.logger.info("%s to link do czegos", link)
|
||||
sciezka,files = await music_functions.get_file(
|
||||
sciezka, files = await music_functions.get_file(
|
||||
ctx, "Pornol", link
|
||||
)
|
||||
if files:
|
||||
@@ -689,7 +692,6 @@ class MusicModule(commands.Cog):
|
||||
self.logger.info("Spierdalaj")
|
||||
await ctx.message.reply("Spierdalaj")
|
||||
|
||||
|
||||
async def disconnect(self, ctx):
|
||||
"""
|
||||
Asynchronous Python function that disconnects the voice client if it is connected and
|
||||
@@ -799,7 +801,7 @@ class MusicModule(commands.Cog):
|
||||
|
||||
async def setup(bot):
|
||||
logger = logging.getLogger("discord")
|
||||
music_functions.MUSIC_FILE_LIST.refresh_file_list()
|
||||
await music_functions.MUSIC_FILE_LIST.refresh_file_list()
|
||||
logger.info("Playlist generation")
|
||||
await bot.add_cog(MusicModule(bot, "discord"))
|
||||
logger.info("Loading music commands module done")
|
||||
|
||||
Reference in New Issue
Block a user