Y
Y
Yury Bondaruk2021-10-23 17:41:59
Python
Yury Bondaruk, 2021-10-23 17:41:59

How to add alias commands to twitchio?

There is a code:

@bot.command(name='song')
async def test(ctx):
    status = vk_api.status.get(user_id=204788937)
    audio = status["text"]
    
    if audio != '':
        await ctx.channel.send(f'@{ctx.author.name}, ' + audio)
        print('[CoomanBot] Command is called. Now playing: songname' )
    else:
        await ctx.channel.send(f'@{ctx.author.name}, сейчас никакой трек не включён, либо музыка играет не из VK.')
        print('[CoomanBot] Command is called. Nothing playing now')


How can alternative commands be added, like name=['song', 'music']? With the usual addition of a sheet, it gives an error. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question