Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XKCD Cog Breaks Program #86

Closed
LeoSaucedo opened this issue Jul 20, 2021 · 1 comment · Fixed by #87
Closed

XKCD Cog Breaks Program #86

LeoSaucedo opened this issue Jul 20, 2021 · 1 comment · Fixed by #87
Assignees
Labels
bug Something isn't working

Comments

@LeoSaucedo
Copy link
Owner

When Cogs.Xkcd is included in the cogs for Rikka, this error is thrown:

Jul 18 22:12:37 ip-172-31-80-202 python[45745]: Traceback (most recent call last):
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/opt/rikka/rikka-bot/.env/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 607, in _load_from_module_spec
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:     spec.loader.exec_module(lib)
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "<frozen importlib._bootstrap_external>", line 848, in exec_module
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/opt/rikka/rikka-bot/Cogs/Xkcd.py", line 10, in <module>
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:     class Xkcd(commands.Cog):
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/opt/rikka/rikka-bot/Cogs/Xkcd.py", line 11, in Xkcd
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:     required_response_fields: list[str] = ['year', 'month', 'day', 'alt', 'num']
Jul 18 22:12:37 ip-172-31-80-202 python[45745]: TypeError: 'type' object is not subscriptable
Jul 18 22:12:37 ip-172-31-80-202 python[45745]: The above exception was the direct cause of the following exception:
Jul 18 22:12:37 ip-172-31-80-202 python[45745]: Traceback (most recent call last):
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/opt/rikka/rikka-bot/robot.py", line 111, in <module>
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:     bot.load_extension(cog)
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/opt/rikka/rikka-bot/.env/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 664, in load_extension
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:     self._load_from_module_spec(spec, name)
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/opt/rikka/rikka-bot/.env/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 610, in _load_from_module_spec
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:     raise errors.ExtensionFailed(key, e) from e
Jul 18 22:12:37 ip-172-31-80-202 python[45745]: discord.ext.commands.errors.ExtensionFailed: Extension 'Cogs.Xkcd' raised an error: TypeError: 'type' object is not subscriptable
Jul 18 22:12:37 ip-172-31-80-202 python[45745]: Exception ignored in: <function ClientSession.__del__ at 0x7fed9fa20af0>Jul 18 22:12:37 ip-172-31-80-202 python[45745]: Traceback (most recent call last):
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/opt/rikka/rikka-bot/.env/lib/python3.8/site-packages/aiohttp/client.py", line 314, in __del__
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/usr/lib/python3.8/asyncio/base_events.py", line 1740, in call_exception_handler
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/usr/lib/python3.8/logging/__init__.py", line 1475, in error
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/usr/lib/python3.8/logging/__init__.py", line 1589, in _log
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/usr/lib/python3.8/logging/__init__.py", line 1599, in handle
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/usr/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/usr/lib/python3.8/logging/__init__.py", line 954, in handle
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/usr/lib/python3.8/logging/__init__.py", line 1186, in emit
Jul 18 22:12:37 ip-172-31-80-202 python[45745]:   File "/usr/lib/python3.8/logging/__init__.py", line 1176, in _open
Jul 18 22:12:37 ip-172-31-80-202 python[45745]: NameError: name 'open' is not defined
Jul 18 22:12:37 ip-172-31-80-202 systemd[1]: rikka.service: Main process exited, code=exited, status=1/FAILURE
Jul 18 22:12:37 ip-172-31-80-202 systemd[1]: rikka.service: Failed with result 'exit-code'.

Environment Details:

Python 3.8.10 (default, Jun  2 2021, 10:49:15)
[GCC 9.4.0] on linux

We should make sure our changes are consistent with the current python version being used by the bot.

@LeoSaucedo LeoSaucedo added the bug Something isn't working label Jul 20, 2021
@KueZie KueZie self-assigned this Jul 20, 2021
@KueZie KueZie closed this as completed Jul 20, 2021
@KueZie KueZie linked a pull request Jul 20, 2021 that will close this issue
@KueZie
Copy link
Collaborator

KueZie commented Jul 20, 2021

Fixed with PR #87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants