1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00
This commit is contained in:
Steffo 2018-07-31 23:41:05 +02:00
parent fef7ec4c94
commit fd95619c39

View file

@ -279,7 +279,7 @@ def requires_voice_client(func):
def requires_rygdb(func, optional=False): def requires_rygdb(func, optional=False):
async def new_func(channel: discord.Channel, author: discord.Member, params: typing.List[str], *args, **kwargs): async def new_func(channel: discord.Channel, author: discord.Member, params: typing.List[str], *args, **kwargs):
session = await loop.run_in_executor(executor, db.Session.__init__) session = db.Session()
dbuser = await loop.run_in_executor(executor, dbuser = await loop.run_in_executor(executor,
session.query(db.Discord) session.query(db.Discord)
.filter_by(discord_id=author.id) .filter_by(discord_id=author.id)
@ -492,7 +492,7 @@ async def cmd_dump_voice_player_error(channel: discord.Channel, author: discord.
@command @command
async def cmd_register(channel: discord.Channel, author: discord.Member, params: typing.List[str]): async def cmd_register(channel: discord.Channel, author: discord.Member, params: typing.List[str]):
session = await loop.run_in_executor(executor, db.Session()) session = db.Session()
if len(params) < 1: if len(params) < 1:
await client.send_message(channel, "⚠️ Non hai specificato un username!\n" await client.send_message(channel, "⚠️ Non hai specificato un username!\n"
"Sintassi corretta: `!register <username_ryg>`") "Sintassi corretta: `!register <username_ryg>`")
@ -607,7 +607,7 @@ async def queue_play_next_video():
voice_player = await now_playing.create_player() voice_player = await now_playing.create_player()
voice_player.start() voice_player.start()
if now_playing.enqueuer is not None: if now_playing.enqueuer is not None:
session = await loop.run_in_executor(executor, db.Session.__init__) session = db.Session()
enqueuer = await loop.run_in_executor(executor, session.query(db.Discord).filter_by(discord_id=now_playing.enqueuer.id).one_or_none) enqueuer = await loop.run_in_executor(executor, session.query(db.Discord).filter_by(discord_id=now_playing.enqueuer.id).one_or_none)
played_music = db.PlayedMusic(enqueuer=enqueuer, played_music = db.PlayedMusic(enqueuer=enqueuer,
filename=now_playing.file, filename=now_playing.file,