#slash commands + bot.wait_for

1 messages · Page 1 of 1 (latest)

obtuse pine
#

msg.content = '', but it isnt empty
without slashcommands its totally work


@bot.command(description="plays music from favorites")
async def play_from_favorites(ctx):
    global queuee
    check = lambda m: m.author.id == ctx.author.id and m.channel.id == ctx.channel.id
    sqlite_connection = sqlite3.connect('i_love_it.db')
    cursor = sqlite_connection.cursor()
    cursor.execute(f"""SELECT name FROM sqlitedb_developers WHERE userid = {ctx.author.id}
        ;""")
    record = cursor.fetchone()
    if record == None:
        await ctx.respond(embed=Embed(title=f'У вас нет понравившихся треков!'))
        return
    desc = ''
    steps = 0
    allsongs = record[0].split('":<? ')
    for i in allsongs:
        steps += 1
        desc += f"{steps}. {i} \n "
    messagege = await ctx.respond(embed=Embed(title=f'Выберите номер трека, {ctx.author.name}', description=desc))
    try:
        msg = await bot.wait_for(event = 'message', check = check, timeout = 15)
        await msg.delete()
    except asyncio.TimeoutError: 
        await ctx.respond(f"Время ответа вышло", delete_after=3)
        return
    print(int(msg.content))
    try:      
        request = allsongs[int(msg.content) - 1]
    except:
        await ctx.respond(f"Произошла некая ошибка! Перепроверьте ваш ввод.", delete_after=3)
        return            
    await play(context=ctx, url=request.split("(")[-1][:-1:])
#

can someone help, please

warm glen
#

Do you have the message content intent?

obtuse pine
#

oh

#

im forgot

#

about it

#

thanks