0

Можете показать, на этом примере, пожалуйста

@commands.command(name='play', description=config.HELP_YT_LONG, help=config.HELP_YT_SHORT, aliases=['p', 'yt', 'pl'])
async def _play_song(self, ctx, *, track: str):

    current_guild = utils.get_guild(self.bot, ctx.message)
    audiocontroller = utils.guild_to_audiocontroller[current_guild]

    if(await utils.is_connected(ctx) == None):
        if await audiocontroller.uconnect(ctx) == False:
            return

    if track.isspace() or not track:
        return

    if await utils.play_check(ctx) == False:
        return

    # reset timer
    audiocontroller.timer.cancel()
    audiocontroller.timer = utils.Timer(audiocontroller.timeout_handler)

    if audiocontroller.playlist.loop == True:
        await ctx.send("Повтор включен! Используйте {}loop, чтобы отключить".format(config.BOT_PREFIX))
        return

    song = await audiocontroller.process_song(track)

    if song is None:
        await ctx.send(config.SONGINFO_ERROR)
        return

    if song.origin == linkutils.Origins.Default:

        if audiocontroller.current_song != None and len(audiocontroller.playlist.playque) == 0:
            await ctx.send(embed=song.info.format_output(config.SONGINFO_NOW_PLAYING))
        else:
            await ctx.send(embed=song.info.format_output(config.SONGINFO_QUEUE_ADDED))


    elif song.origin == linkutils.Origins.Playlist:
        await ctx.send(config.SONGINFO_PLAYLIST_QUEUED)
1
  • Пожалуйста, уточните вашу конкретную проблему или приведите более подробную информацию о том, что именно вам нужно. В текущем виде сложно понять, что именно вы спрашиваете. 17 дек 2021 в 21:18

1 ответ 1

0
@commands.command():
async def test(self, ctx):
    await ctx.message.add_reaction('✔️')

Если хотите сделать плеер, то лучше использовать lavalink

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.