Skip to content

Error in prefixhandling found in logs #73

@Ev-1

Description

@Ev-1

Scrolling through the logs I found this error. It did not persist, there might be a big in how prefixes are stored and presented to discord.py

[2022-11-06 10:25:23] [ERROR   ] discord.client: Ignoring exception in on_message
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1296, in get_context
    if origin.content.startswith(tuple(prefix)):
TypeError: tuple for startswith must only contain str, not list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "/app/bot.py", line 65, in on_message
    await self.process_commands(message)
  File "/app/bot.py", line 68, in process_commands
    ctx = await self.get_context(message, cls=LocalizedContext)
  File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1310, in get_context
    raise TypeError(
TypeError: Iterable command_prefix or list returned from get_prefix must contain only strings, not list
[2022-11-06 10:25:30] [ERROR   ] discord.client: Ignoring exception in on_message
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1296, in get_context
    if origin.content.startswith(tuple(prefix)):
TypeError: tuple for startswith must only contain str, not list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "/app/bot.py", line 65, in on_message
    await self.process_commands(message)
  File "/app/bot.py", line 68, in process_commands
    ctx = await self.get_context(message, cls=LocalizedContext)
  File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1310, in get_context
    raise TypeError(
TypeError: Iterable command_prefix or list returned from get_prefix must contain only strings, not list

Metadata

Metadata

Assignees

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