Не могу правильно настроить initial_channels в twitchio - PullRequest
1 голос
/ 11 марта 2020

Привет, я создаю бота для дергания, используя модуль twitchio. У меня проблема с initial_channels, не знаю, что я делаю неправильно. Вот мой код

from twitchio.ext import commands

client_key = 'XXX'
oauth_key  = 'XXX'

class bot(commands.Bot):

    def __init__(self):
        super().__init__(irc_token=oauth_key, client_id=client_key, nick='MrShark', prefix='!',
                         initial_channels=["recogn1zzze"])

    async def event_ready(self):
        print(f'Ready | {self.nick}')

    async def event_message(self, message):
        print(message.content)
        await self.handle_commands(message)

    @commands.command(name='test')
    async def my_command(self, ctx):
        await ctx.send(f'Hello {ctx.author.name}!')


bot = bot()
bot.run()

А вот что я получил

Task exception was never retrieved
future: <Task finished coro=<WebsocketConnection.join_action() done, defined at C:\Users\recog\AppData\Local\Programs\Python\Python37-32\lib\site-packages\twitchio\websocket.py:543> exception=KeyError('recogn1zzze')>
Traceback (most recent call last):
  File "C:\Users\recog\AppData\Local\Programs\Python\Python37-32\lib\site-packages\twitchio\websocket.py", line 558, in join_action
    cache = self._channel_cache[channel]['channel']._users
KeyError: 'recogn1zzze'
Task exception was never retrieved
future: <Task finished coro=<WebsocketConnection.join_action() done, defined at C:\Users\recog\AppData\Local\Programs\Python\Python37-32\lib\site-packages\twitchio\websocket.py:543> exception=KeyError('recogn1zzze')>
Traceback (most recent call last):
  File "C:\Users\recog\AppData\Local\Programs\Python\Python37-32\lib\site-packages\twitchio\websocket.py", line 558, in join_action
    cache = self._channel_cache[channel]['channel']._users
KeyError: 'recogn1zzze'

Как это решить?

...