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

Hi, I am facing a problem #2

Open
rcmf-9266 opened this issue Jan 26, 2022 · 15 comments
Open

Hi, I am facing a problem #2

rcmf-9266 opened this issue Jan 26, 2022 · 15 comments

Comments

@rcmf-9266
Copy link

rcmf-9266 commented Jan 26, 2022

Hi, i tried to run bot.py but got this error, may i know how to solve it? Thanks

C:\EinsteinBot-master>python -u bot.py
Traceback (most recent call last):
File "C:\EinsteinBot-master\bot.py", line 3, in
import discord
ModuleNotFoundError: No module named 'discord' @jckli

@rcmf-9266
Copy link
Author

rcmf-9266 commented Jan 26, 2022

Hi, i tried to run bot.py but got this error, may i know how to solve it? Thanks

C:\EinsteinBot-master>python -u bot.py Traceback (most recent call last): File "C:\EinsteinBot-master\bot.py", line 3, in import discord ModuleNotFoundError: No module named 'discord' @jckli

I've solved that but got this error instead ;(

C:\Users\ACER\EinsteinBot>pip install discord.ui
Requirement already satisfied: discord.ui in c:\users\acer\appdata\local\programs\python\python39\lib\site-packages (5.1.6)

C:\Users\ACER\EinsteinBot>python bot.py
Traceback (most recent call last):
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 606, in _load_from_module_spec
spec.loader.exec_module(lib)
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users\ACER\EinsteinBot\cogs\info.py", line 13, in
class Link(discord.ui.View):
AttributeError: module 'discord' has no attribute 'ui'

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

Traceback (most recent call last):
File "C:\Users\ACER\EinsteinBot\bot.py", line 21, in
bot.load_extension(f"cogs.{name}")
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
self._load_from_module_spec(spec, name)
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.info' raised an error: AttributeError: module 'discord' has no attribute 'ui'

@vDucky
Copy link

vDucky commented Jan 26, 2022

Hi, im going through the same issue as well and have no clue what to do lol

@vDucky
Copy link

vDucky commented Jan 26, 2022

Hi, i tried to run bot.py but got this error, may i know how to solve it? Thanks

C:\EinsteinBot-master>python -u bot.py Traceback (most recent call last): File "C:\EinsteinBot-master\bot.py", line 3, in import discord ModuleNotFoundError: No module named 'discord' @jckli

are u running it on vsc?

@vDucky
Copy link

vDucky commented Jan 27, 2022

Hey so i've done everything i could do and the solution i found that work for me was to use this command:

pip3 install -r requirements.txt

@vDucky
Copy link

vDucky commented Jan 27, 2022

and then try running it after

@rcmf-9266
Copy link
Author

Hey so i've done everything i could do and the solution i found that work for me was to use this command:

pip3 install -r requirements.txt

Thanks, this worked and the bot is now online. But when i run any commands it doesnt work and showed errors. You have this problem?
image

@rcmf-9266
Copy link
Author

and then try running it after

@vDucky Tried many ways sstill have error as shown in the picture above. Below is the error code in powershell when i run /help

PS C:\Users\ACER\EinsteinBot> python -u bot.py
Bot is online
Ignoring exception in command <discord.commands.SlashCommand name=help>:
Traceback (most recent call last):
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 94, in wrapped
ret = await coro(arg)
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 721, in _invoke
await self.callback(self.cog, ctx, **kwargs)
File "C:\Users\ACER\EinsteinBot\cogs\slashCommands.py", line 17, in help_slash
await callCommand(info.Information.help, self, ctx)
File "C:\Users\ACER\EinsteinBot\core\utils.py", line 48, in callCommand
await command(ctx)
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 486, in call
return await self.callback(self.cog, context, *args, **kwargs) # type: ignore
File "C:\Users\ACER\EinsteinBot\cogs\info.py", line 33, in help
embed.set_author(name="EinsteinBot", icon_url=self.bot.user.avatar.url)
AttributeError: 'NoneType' object has no attribute 'url'

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

Traceback (most recent call last):
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\bot.py", line 512, in process_application_commands
await ctx.command.invoke(ctx)
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 261, in invoke
await injected(ctx)
File "C:\Users\ACER\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 100, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.commands.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'NoneType' object has no attribute 'url'

@vDucky
Copy link

vDucky commented Jan 27, 2022

Hey so i've done everything i could do and the solution i found that work for me was to use this command:
pip3 install -r requirements.txt

Thanks, this worked and the bot is now online. But when i run any commands it doesnt work and showed errors. You have this problem? image

yes, if u looked at one of the other threads, its apparently a bug they need to fix with the cheinstein parceling

@Dineshomapathi
Copy link

Hi guy the bot is working just fine for me what i did like below

1st login to your discord dev and do all the below as given instruction in readme

  1. Go to Discord Developer Portal website and create a new application by clicking on New Application.
  2. After creating the application, click the application and copy the Application ID by clicking on Copy and save it for later.
  3. Then on the left sidebar, click Bot.
  4. Create a new bot by clicking on Add Bot.
  5. Copy the token of the bot by clicking on Copy and save it for later.

** important copy and keep your bot token and application id **

then

  1. Download a web browser extension that allows you to download cookies.

install the extension based what browser you're using.

  1. Go to Chegg.com and sign in.

Ones sign in click the extension icon
image

then click the circle red part it will export the cookies then create cookies.txt file inside the place where the code is and paste this cookie inside and save.

image

then go to what is my user agent website on the browser that you copy the cookie. The website called WhatMyUserAgent we will only need the user agent from this site. Save this user agent somewhere as it is going to be used later.

image

press copy and keep in a notepad for now

now you should have total of 4 important stuff which is

  1. Bot token
  2. Application id
  3. cookie.txt
  4. user agent

now what you have to do is since you'all would have download the repo can skip 1st step

  1. Clone this repository.
  2. Go into the folder that you cloned and create a new file called config.json.

image

  1. Copy the following into the file:
{
    "prefix": "THE BOTS PREFIX GOES HERE (ANYTHING YOU WANT)",
    "token": "THE BOTS TOKEN GOES HERE (NOT THE CLIENT ID)",
    "userAgent": "YOUR USER AGENT GOES HERE (REFER TO STEP 4 FROM CHEGG SETUP)"
}

image

before you run the command you have to install the requirement files using this command

pip install -r requirements.txt or pip3 install -r requirements.txt

then invite the bot to your discord server

https://discord.com/oauth2/authorize?client_id=YOURAPPIDHERE&scope=applications.commands%20bot&permissions=139586751552

at your app id here paste your application id you save before and invite the bot to the server

Thats it! Run the bot in your command line from the folder you cloned using:

python -u bot.py

@Raymond9266 @vDucky

@vDucky
Copy link

vDucky commented Feb 4, 2022

image
Hi, I understand that it works, however when I search up a question for it, it comes back with an error. @Dineshomapathi

@Dineshomapathi
Copy link

Dineshomapathi commented Feb 4, 2022

@vDucky Hi when you install pip3 install -r requirements.txt did you encounter any problem ?
since mine I use /search (url) and your machine have GIT https://git-scm.com/ installed ? due to pip3 install -r requirements.txt got few requirement using GIT to retrieve some library

@vDucky
Copy link

vDucky commented Feb 5, 2022

image
I restarted all over from the beginning and it is still continuing with the same issue. This is what I am getting in terminal. @Dineshomapathi

@avtar312
Copy link

avtar312 commented Feb 14, 2022

Screenshot_2022-02-13-21-33-08-358_com discord
I get these when my bot run.. Not showing complete answer, and in many time write something was wrong

@elbirsoufiane
Copy link

Screenshot_2022-02-13-21-33-08-358_com discord I get these when my bot run.. Not showing complete answer, and in many time write something was wrong

Hi. Is your bot at this time working?

@jckli
Copy link
Member

jckli commented Feb 28, 2022

Screenshot_2022-02-13-21-33-08-358_com discord I get these when my bot run.. Not showing complete answer, and in many time write something was wrong

Hi. Is your bot at this time working?

The bot (my personal bot) works perfectly for all the questions I throw at it. There are some specific questions that do not work (one being the answer type mentioned here #1 ), however most work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants