corpnewt/CorpBot.py

Gamelookup

iDutchy opened this issue · 4 comments

Hey, I added the gamelookup cog, but it doesnt work... I got an API key from their website, but where do I put it? how do I format it? As what do I save it?

It goes in a file at the root of the CorpBot directory called igdbKey.txt. It needs no special formatting - just like the token.txt.

Okay, I added that. But it doesnt work... I debugged the command and it gave me this:

`Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/discord/ext/commands/core.py", line 62, in wrapped
ret = await coro(*args, **kwargs)
File "/usr/bin/CharlesBot/cogs/gamelookup.py", line 202, in gamelookup
'cover','platforms','url']
File "/usr/local/lib/python3.7/site-packages/igdb_api_python/igdb.py", line 70, in games
r = self.call_api("games", args)
File "/usr/local/lib/python3.7/site-packages/igdb_api_python/igdb.py", line 61, in call_api
r = self.getRequest(url)
File "/usr/local/lib/python3.7/site-packages/igdb_api_python/igdb.py", line 30, in getRequest
r.body = json.loads(r.text)
File "/usr/local/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

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

Traceback (most recent call last):
File "/usr/bin/CharlesBot/cogs/jishaku/cog.py", line 664, in jsk_debug
await alt_ctx.command.invoke(alt_ctx)
File "/usr/local/lib/python3.7/site-packages/discord/ext/commands/core.py", line 615, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/usr/local/lib/python3.7/site-packages/discord/ext/commands/core.py", line 71, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: JSONDecodeError: Expecting value: line 1 column 1 (char 0)`

The module expects json data returned from the api call - looks like it's returning nothing. Something still isn't set up correctly.

Weird ... I added the cog and the igdbKey.txt... I got an API key too.. 🤔