corpnewt / CorpBot.py

A very clumsy python bot for discord
MIT License
194 stars 93 forks source link

Gamelookup #71

Closed iDutchy closed 5 years ago

iDutchy commented 5 years ago

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?

corpnewt commented 5 years ago

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.

iDutchy commented 5 years ago

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)`

corpnewt commented 5 years ago

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

iDutchy commented 5 years ago

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