youtube download

This commit is contained in:
2023-05-06 03:16:26 +02:00
parent 71ff713417
commit 0749f742c3
27 changed files with 417 additions and 74 deletions

View File

@ -1,7 +1,7 @@
from discord import Member, Bot, Cog, ApplicationContext
from discord.commands import slash_command
from logging import Logger
from discord import ApplicationContext, Bot, Cog, default_permissions, slash_command
from framework.redis import Redis
@ -12,6 +12,7 @@ class Greetings(Cog):
self.redis = redis
@slash_command()
@default_permissions(administrator=True)
async def redis_set(self, context: ApplicationContext, key: str, value: str):
self.logger.info(f"redis set {value} at {key}")
await self.redis.set(key, value)
@ -19,6 +20,7 @@ class Greetings(Cog):
await context.respond(f"redis set {value} at {key}")
@slash_command()
@default_permissions(administrator=True)
async def redis_get(self, context: ApplicationContext, key: str):
self.logger.info(f"redis get {key}")
value = await self.redis.get(key)

View File

@ -1,8 +1,7 @@
from discord import Bot, Cog, ApplicationContext
from discord.commands import slash_command
from entity import Entry
from logging import Logger
from discord import ApplicationContext, Bot, Cog, slash_command
from service import QueueManager
from usecase import Sources
@ -19,17 +18,8 @@ class Music(Cog):
@slash_command(name="play")
async def play(self, context: ApplicationContext, query: str):
async with self.queueManager(context.guild_id) as queue:
test = await self.sources.processQuery(query)
interaction = await context.respond(f"searching {query} ...")
entries = await self.sources.processQuery(interaction, query)
queue.add(entries)
queue.add(
Entry(
title="title",
artist="artist",
album="album",
thumbnail="thumb",
link="fdsdfsd",
requesterId=context.author.id,
)
)
await context.respond(str(test))
await interaction.edit_original_response(content=entries[0].title.name)