Skip to content

IndexError responding to !topic in a channel with no topic set #178

@alanbriolat

Description

@alanbriolat

As the title says, the !topic command in a channel with no topic causes the following exception:

Traceback (most recent call last):
  File "/app/src/csbot/events.py", line 255, in _finish_async_handler
    await future
  File "/app/src/csbot/core.py", line 172, in fire_command
    await maybe_future_result(f(event), log=self.log)
  File "/app/src/csbot/plugin.py", line 56, in __call__
    return getattr(self.obj, self.name)(*args, **kwargs)
  File "/app/src/csbot/plugins/topic.py", line 89, in topic
    topic = self._get_topic(e['channel'])
  File "/app/src/csbot/plugins/topic.py", line 71, in _get_topic
    return self.topics[channel][-1]
IndexError: deque index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions