vertyco / vrt-cogs

Utility and fun cogs for Red
MIT License
49 stars 29 forks source link

[cartographer] incorrect allowed guild type in db #151

Closed Technetium1 closed 1 year ago

Technetium1 commented 1 year ago

Describe the bug Error in command 'cartographerset view'. Check your console or logs for details. Error 1:

Traceback (most recent call last):
  File "{HOME}/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "{HOME}/.local/share/Red-DiscordBot/data/TechBot/cogs/CogManager/cogs/cartographer/main.py", line 186, in view_settings
    allowed = ", ".join(self.db.allowed_guilds)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, int found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "{HOME}/redenv/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
    await ctx.command.invoke(ctx)
  File "{HOME}/redenv/lib/python3.11/site-packages/redbot/core/commands/commands.py", line 825, in invoke
    await super().invoke(ctx)
  File "{HOME}/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1650, in invoke
    await ctx.invoked_subcommand.invoke(ctx)
  File "{HOME}/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1029, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "{HOME}/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 244, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: sequence item 0: expected str instance, int found

Error 2:

Traceback (most recent call last):
  File "/home/tech/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tech/.local/share/Red-DiscordBot/data/TechBot/cogs/CogManager/cogs/cartographer/main.py", line 186, in view_settings
    allowed = ", ".join(self.db.allowed_guilds)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, int found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tech/redenv/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
    await ctx.command.invoke(ctx)
  File "/home/tech/redenv/lib/python3.11/site-packages/redbot/core/commands/commands.py", line 825, in invoke
    await super().invoke(ctx)
  File "/home/tech/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1650, in invoke
    await ctx.invoked_subcommand.invoke(ctx)
  File "/home/tech/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1029, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tech/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 244, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: sequence item 0: expected str instance, int found

**Cog Version*** Latest

To Reproduce Steps to reproduce the behavior:

  1. Install cartographer
  2. Allow more than one server
  3. Configure settings
  4. Attempt to view settings with [p]cartographerset view

Expected behavior

Screenshots N/A

Additional context

vertyco commented 1 year ago

Just pushed a fix. ty for reporting!

Technetium1 commented 1 year ago

Thanks for the quick fix! 😄