appu1232 / Discord-Selfbot

Discord selfbot made with Python using discord.py
GNU General Public License v3.0
512 stars 602 forks source link

Image search #5

Closed gidoBOSSftw5731 closed 7 years ago

gidoBOSSftw5731 commented 7 years ago

I got Normal search just fine but image search doesnt work...

Error in terminal:

  Ignoring exception in command i
Traceback (most recent call last):
  File "/home/gideon/.local/lib/python3.5/site-packages/discord/ext/commands/core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/gideon/Illyasveil/addons/google.py", line 236, in i
    if query[0].isdigit():
UnboundLocalError: local variable 'query' referenced before assignment

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

Traceback (most recent call last):
  File "/home/gideon/.local/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 848, in process_commands
    yield from command.invoke(ctx)
  File "/home/gideon/.local/lib/python3.5/site-packages/discord/ext/commands/core.py", line 369, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "/home/gideon/.local/lib/python3.5/site-packages/discord/ext/commands/core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnboundLocalError: local variable 'query' referenced before assignment
Ignoring exception in command None
appu1232 commented 7 years ago

Line 236? There's only 226 lines in the latest google.py cog. Turn off the bot and delete google.py. Go here: https://raw.githubusercontent.com/appu1232/Selfbot-for-Discord/master/cogs/google.py and Right click > Save as and then save it to where the google.py was. Try now and see if it works.

Also, judging by your folder structure Illyasveil/addons/ is your cogs folder? I'm guessing you may have been changing some stuff up. That's fine but if the above fix doesn't help then I suggest downloading a fresh copy of the bot with no changes and just port over your settings folder and see if the error persists.

gidoBOSSftw5731 commented 7 years ago

well, its a merge of Illyasveil and your bot since i like how Illyasveil works but your cmds are cool so im trying to do a merge, will report what happens in a sec

gidoBOSSftw5731 commented 7 years ago
Ignoring exception in command i
Traceback (most recent call last):
  File "/home/gideon/.local/lib/python3.5/site-packages/discord/ext/commands/core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/gideon/Illyasveil/addons/google.py", line 221, in i
    await self.bot.send_message(ctx.message.channel, content=None, embed=em.set_image(url=result['items'][item]['link']))
KeyError: 'items'

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

Traceback (most recent call last):
  File "/home/gideon/.local/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 848, in process_commands
    yield from command.invoke(ctx)
  File "/home/gideon/.local/lib/python3.5/site-packages/discord/ext/commands/core.py", line 369, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "/home/gideon/.local/lib/python3.5/site-packages/discord/ext/commands/core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'items'

new error and in discord it prints Google failed to respond.

appu1232 commented 7 years ago

This is a problem with your Google API Key and/or custom search engine ID. Make sure you followed the instructions properly in the README for setting up the API Key and the custom search engine ID. Google also takes up to a few hours after you have created both to properly register it so if you just did this recently give it some more time.

gidoBOSSftw5731 commented 7 years ago

k, ill wait a lil while, if its not up by tomorrow i'll drop back in here

gidoBOSSftw5731 commented 7 years ago

Got it working!