Comments (95)
@VIDRA4444 You need to install the version of the library specified in requirements.txt "pip install -r requirements.txt"
In your case, you need to remove the discord.py version 2.2.2 library "pip uninstall discord.py" and then install discord.py version 2.1.0 "pip install discord.py==2.1.0"
from discordbot-edgegpt.
Hi there was an error during startup:
discord.client logging in using static token
Traceback (most recent call last):
File "D:\Programs_for_python\DiscordBot-EdgeGPT-main\venv\lib\site-packages\discord\client.py", line 828, in run
asyncio.run(runner())
File "D:\Users\AndraX\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\Users\AndraX\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "D:\Programs_for_python\DiscordBot-EdgeGPT-main\venv\lib\site-packages\discord\client.py", line 817, in runner
await self.start(token, reconnect=reconnect)
File "D:\Programs_for_python\DiscordBot-EdgeGPT-main\venv\lib\site-packages\discord\client.py", line 746, in start
await self.connect(reconnect=reconnect)
File "D:\Programs_for_python\DiscordBot-EdgeGPT-main\venv\lib\site-packages\discord\client.py", line 672, in connect
raise PrivilegedIntentsRequired(exc.shard_id) from None
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
python-BaseExceptionI tried switching the dependency as mentioned in "discord.errors.PrivilegedIntentsRequired" but it doesn't work for me
Here is the solution.
from discordbot-edgegpt.
Okay, I figured it out and installed the discord.py library, now the error is different: [30;1m2023-03-23 01:55:54[0m [31mERROR [0m [35m__main__[0m -> discord.py version 2.2.2 is installed but does not match the requirements
from discordbot-edgegpt.
Hi there was an error during startup:
discord.client logging in using static token
Traceback (most recent call last):
File "D:\Programs_for_python\DiscordBot-EdgeGPT-main\venv\lib\site-packages\discord\client.py", line 828, in run
asyncio.run(runner())
File "D:\Users\AndraX\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\Users\AndraX\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "D:\Programs_for_python\DiscordBot-EdgeGPT-main\venv\lib\site-packages\discord\client.py", line 817, in runner
await self.start(token, reconnect=reconnect)
File "D:\Programs_for_python\DiscordBot-EdgeGPT-main\venv\lib\site-packages\discord\client.py", line 746, in start
await self.connect(reconnect=reconnect)
File "D:\Programs_for_python\DiscordBot-EdgeGPT-main\venv\lib\site-packages\discord\client.py", line 672, in connect
raise PrivilegedIntentsRequired(exc.shard_id) from None
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
python-BaseException
I tried switching the dependency as mentioned in "discord.errors.PrivilegedIntentsRequired" but it doesn't work for me
from discordbot-edgegpt.
@VIDRA4444 You need to install the version of the library specified in requirements.txt "pip install -r requirements.txt"
In your case, you need to remove the discord.py version 2.2.2 library "pip uninstall discord.py" and then install discord.py version 2.1.0 "pip install discord.py==2.1.0"
Having done as you said, I got this error: [30;1m2023-03-23 13:39:27[0m [31mERROR [0m [35m__main__[0m -> python-dotenv version 1.0.0 is installed but does not match the requiremen
from discordbot-edgegpt.
Oh my God, I'm already tired... I installed the correct version of dotenv, but a new error popped up...
File "C:\Users\1111\Desktop\bot\DiscordBot-EdgeGPT-main\bot.py", line 9, in
load_dotenv()
TypeError: load_dotenv() missing 1 required positional argument: 'dotenv_path'
from discordbot-edgegpt.
Do you change file name .env.dev to .env?
from discordbot-edgegpt.
from discordbot-edgegpt.
yes. file is .env
from discordbot-edgegpt.
I update repo, you can try again.
from discordbot-edgegpt.
I update repo, you can try again.
Do I need to reinstall the zip?
from discordbot-edgegpt.
Yes, and reinstall the package
from discordbot-edgegpt.
from discordbot-edgegpt.
;(
from discordbot-edgegpt.
well,I guess you should change load_dotenv() to load_dotenv(dotenv_path= input_your_.env_path)
from discordbot-edgegpt.
from discordbot-edgegpt.
I'm sorry if I'm dumb. I don't understand much about code.
from discordbot-edgegpt.
dotenv_path = "./.env"
from discordbot-edgegpt.
Warning (from warnings module):
File "C:\Users\1111\AppData\Local\Programs\Python\Python310\lib\site-packages\dotenv.py", line 18
warnings.warn("can't read %s - it doesn't exist." % dotenv_path)
UserWarning: can't read C:Users\1111\AppData\Local\Programs\Python\Python310\Lib\site-packages\dotenv.env - it doesn't exist.
�[30;1m2023-03-23 15:19:05�[0m �[31mERROR �[0m �[35m__main__�[0m -> discord.py version 2.1.0 is installed but does not match the requirements
from discordbot-edgegpt.
I put this in, can you please tell me what I need to change?
from discordbot-edgegpt.
Warning (from warnings module): File "C:\Users\1111\AppData\Local\Programs\Python\Python310\lib\site-packages\dotenv.py", line 18 warnings.warn("can't read %s - it doesn't exist." % dotenv_path) UserWarning: can't read C:Users\1111\AppData\Local\Programs\Python\Python310\Lib\site-packages\dotenv.env - it doesn't exist. �[30;1m2023-03-23 15:19:05�[0m �[31mERROR �[0m �[35m__main__�[0m -> discord.py version 2.1.0 is installed but does not match the requirements
I updated the version of discord.py to 2.2.2 and you can see the change in requirements.txt.
from discordbot-edgegpt.
I put this in, can you please tell me what I need to change?
you can trydotenv_path = "./.env"
or dotenv_path=r"your_path"
from discordbot-edgegpt.
okay! �[30;1m2023-03-23 15:28:40�[0m �[31mERROR �[0m �[35m__main__�[0m -> python-dotenv version 0.2.0 is installed but does not match the requirements
from discordbot-edgegpt.
Okay, I know what I should fix
from discordbot-edgegpt.
Modify your bot.py code to look like this
import discord
import os
import src.log
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv(dotenv_path="./.env")
bot = commands.Bot(command_prefix='!', intents = discord.Intents.all())
# init loggger
logger = src.log.setup_logger(__name__)
@bot.event
async def on_ready():
logger.info(f'{bot.user} is now running!')
for Filename in os.listdir('./cogs'):
if Filename.endswith('.py'):
await bot.load_extension(f'cogs.{Filename[:-3]}')
print("Bot is Up and Ready!")
try:
synced = await bot.tree.sync()
print(f"Synced {len(synced)} commands")
except Exception as e:
print(e)
@bot.command()
async def load(ctx, extension):
await bot.load_extension(f'cogs.{extension}')
await ctx.send(f'Loaded {extension} done.')
@bot.command()
async def unload(ctx, extension):
await bot.unload_extension(f'cogs.{extension}')
await ctx.send(f'Un-Loaded {extension} done.')
@bot.command()
async def reload(ctx, extension):
await bot.reload_extension(f'cogs.{extension}')
await ctx.send(f'Re-Loaded {extension} done.')
@bot.command()
async def clean(ctx):
open('discord_bot.log', 'w').close()
await ctx.send(f'Has been emptied')
if __name__ == '__main__':
bot.run(os.getenv("DISCORD_BOT_TOKEN"))
from discordbot-edgegpt.
from discordbot-edgegpt.
Can I see your bot.py?
from discordbot-edgegpt.
from discordbot-edgegpt.
hm..so strange, open .env file, and try to change DISCORD_BOT_TOKEN=your_token
toDISCORD_BOT_TOKEN="your_token"
from discordbot-edgegpt.
from discordbot-edgegpt.
damn! the bot is working, although previously it was not even online
from discordbot-edgegpt.
: )
from discordbot-edgegpt.
from discordbot-edgegpt.
no response
from discordbot-edgegpt.
from discordbot-edgegpt.
he's online, but there are a lot of errors and he doesn't respond to any commands
from discordbot-edgegpt.
Are you sure you have the edgegpt package installed?
from discordbot-edgegpt.
yes
from discordbot-edgegpt.
I think your edgegpt package path is wrong
from discordbot-edgegpt.
Okay and... what should I do?
from discordbot-edgegpt.
confirm your edgegpt package info, like this:
(py_3-9-16) C:\Users\dd861\pyhon\discord bot EdgeGPT>pip show EdgeGPT
Name: EdgeGPT
Version: 0.1.3
Summary: Reverse engineered Edge Chat API
Home-page: https://github.com/acheong08/EdgeGPT
Author: Antonio Cheong
Author-email: [email protected]
License: GNU General Public License v2.0
Location: c:\users\dd861\anaconda3\envs\py_3-9-16\lib\site-packages
Requires: asyncio, certifi, httpx, prompt-toolkit, regex, requests, rich, websockets
Required-by:
from discordbot-edgegpt.
from discordbot-edgegpt.
This seems to be no problem, hm...
from discordbot-edgegpt.
Here are the current startup errors
from discordbot-edgegpt.
Mybe you can reinstall all package, and try again
from discordbot-edgegpt.
All packages??? Python, dotenv, edge?
from discordbot-edgegpt.
okay! �[30;1m2023-03-23 15:28:40�[0m �[31mERROR �[0m �[35m__main__�[0m -> python-dotenv version 0.2.0 is installed but does not match the requirements
Are you sure the error is not in the code? Last time I had an error only with dotenv, but now the whole screen is red
from discordbot-edgegpt.
Then try to install python-dotenv latest version first
from discordbot-edgegpt.
you should try this
from discordbot-edgegpt.
I think this is a problem with py3.10, because I don't have this error with py3.9.
from discordbot-edgegpt.
from discordbot-edgegpt.
Something new...
from discordbot-edgegpt.
Can you send a previous version of the code?
from discordbot-edgegpt.
Have you set the cookies.json
file?
from discordbot-edgegpt.
from discordbot-edgegpt.
There may be something wrong with your cookies, try re-exporting cookies from http://bing.com/chat
from discordbot-edgegpt.
I put in a new cookie, nothing has changed
from discordbot-edgegpt.
Can you send a previous version of the code?
from discordbot-edgegpt.
Basically, only bot.py was modified
from discordbot-edgegpt.
I know, I need a previous version of it, before the one you recently fixed.
from discordbot-edgegpt.
import discord
import os
import src.log
import sys
import pkg_resources
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
bot = commands.Bot(command_prefix='!', intents = discord.Intents.all())
# init loggger
logger = src.log.setup_logger(__name__)
def check_verion() -> None:
# Read the requirements.txt file and add each line to a list
with open('requirements.txt') as f:
required = f.read().splitlines()
# For each library listed in requirements.txt, check if the corresponding version is installed
for package in required:
# Use the pkg_resources library to get information about the installed version of the library
package_name, package_verion = package.split('==')
installed = pkg_resources.get_distribution(package_name)
# Extract the library name and version number
name, version = installed.project_name, installed.version
# Compare the version number to see if it matches the one in requirements.txt
if package != f'{name}=={version}':
logger.error(f'{name} version {version} is installed but does not match the requirements')
sys.exit()
@bot.event
async def on_ready():
logger.info(f'{bot.user} is now running!')
for Filename in os.listdir('./cogs'):
if Filename.endswith('.py'):
await bot.load_extension(f'cogs.{Filename[:-3]}')
print("Bot is Up and Ready!")
try:
synced = await bot.tree.sync()
print(f"Synced {len(synced)} commands")
except Exception as e:
print(e)
@bot.command()
async def load(ctx, extension):
await bot.load_extension(f'cogs.{extension}')
await ctx.send(f'Loaded {extension} done.')
@bot.command()
async def unload(ctx, extension):
await bot.unload_extension(f'cogs.{extension}')
await ctx.send(f'Un-Loaded {extension} done.')
@bot.command()
async def reload(ctx, extension):
await bot.reload_extension(f'cogs.{extension}')
await ctx.send(f'Re-Loaded {extension} done.')
@bot.command()
async def clean(ctx):
open('discord_bot.log', 'w').close()
await ctx.send(f'Has been emptied')
if __name__ == '__main__':
check_verion()
bot.run(os.getenv("DISCORD_BOT_TOKEN"))
from discordbot-edgegpt.
from discordbot-edgegpt.
Do you know what you can do about it? The requirements state that doten should be 0.20.0, but the code asks for 1.0
from discordbot-edgegpt.
modify requirements.txt:
discord.py==2.2.2
python-dotenv==1.0.0
PyYAML==6.0
EdgeGPT==0.1.3
from discordbot-edgegpt.
from discordbot-edgegpt.
Do you know what you can do about it? The requirements state that doten should be 0.20.0, but the code asks for 1.0
Because the version you installed is 1.0.0, but check_version() is checked against the contents of requirements.txt.
from discordbot-edgegpt.
ya, modify python-dotenv==0.20.0
to python-dotenv==1.0.0
from discordbot-edgegpt.
from discordbot-edgegpt.
from discordbot-edgegpt.
dotenv_path = "./.env"
from discordbot-edgegpt.
from discordbot-edgegpt.
same error
from discordbot-edgegpt.
from discordbot-edgegpt.
same, modify requirements.txt, PyYAML==6.0
-> PyYAML==6.0bl
from discordbot-edgegpt.
I knew, so I changed it, but nothing changed.
from discordbot-edgegpt.
from discordbot-edgegpt.
hmm....I think you still do not use check_version (), anyway, this is only a check, not necessary
from discordbot-edgegpt.
I don't understand.
from discordbot-edgegpt.
remove check_version() from here
from discordbot-edgegpt.
from discordbot-edgegpt.
😢
from discordbot-edgegpt.
modify DISCORD_BOT_TOKEN=your_token to DISCORD_BOT_TOKEN="your_token"
from discordbot-edgegpt.
from discordbot-edgegpt.
from discordbot-edgegpt.
ah... It's already fixed.
from discordbot-edgegpt.
from discordbot-edgegpt.
hmm... modify like this
if __name__ == '__main__':
check_verion()
bot.run("your discord token")
from discordbot-edgegpt.
from discordbot-edgegpt.
modify your bot.py:
import discord
import os
import src.log
from discord.ext import commands
bot = commands.Bot(command_prefix='!', intents = discord.Intents.all())
# init loggger
logger = src.log.setup_logger(__name__)
@bot.event
async def on_ready():
logger.info(f'{bot.user} is now running!')
for Filename in os.listdir('./cogs'):
if Filename.endswith('.py'):
await bot.load_extension(f'cogs.{Filename[:-3]}')
print("Bot is Up and Ready!")
try:
synced = await bot.tree.sync()
print(f"Synced {len(synced)} commands")
except Exception as e:
print(e)
@bot.command()
async def load(ctx, extension):
await bot.load_extension(f'cogs.{extension}')
await ctx.send(f'Loaded {extension} done.')
@bot.command()
async def unload(ctx, extension):
await bot.unload_extension(f'cogs.{extension}')
await ctx.send(f'Un-Loaded {extension} done.')
@bot.command()
async def reload(ctx, extension):
await bot.reload_extension(f'cogs.{extension}')
await ctx.send(f'Re-Loaded {extension} done.')
@bot.command()
async def clean(ctx):
open('discord_bot.log', 'w').close()
await ctx.send(f'Has been emptied')
if __name__ == '__main__':
bot.run("your token")
from discordbot-edgegpt.
from discordbot-edgegpt.
Update EdgeGPT==0.1.5, I see this package has just been updated
from discordbot-edgegpt.
from discordbot-edgegpt.
Thanks a lot for trying to help man, but I'm already very tired, you and I have spent about 3 hours on this case, but all the errors new and new... Should I close the topic? I don't want to continue...
from discordbot-edgegpt.
OK
from discordbot-edgegpt.
Thank you so much again! I appreciate your help. Good luck to you!
from discordbot-edgegpt.
Related Issues (20)
- 'NoneType' object is not iterable HOT 2
- On mobile, when using the image creation, only the first image is displayed. HOT 13
- Error: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('https://www.bing.com/images/kblob') HOT 18
- Nothing works HOT 2
- i can't run the code HOT 11
- Timeout HOT 2
- Error, help HOT 15
- Error when try use "/bing hello" HOT 14
- Add .env CHANNEL_ID for response.py or image_create.py HOT 5
- When Bing closes the conversation, unable to start a new one until bot is restarted HOT 2
- Image request timed out HOT 3
- Error: 'NoneType' object is not iterable HOT 11
- More verbose errors HOT 9
- Error:'ascii' codec can't encode character '\xe0' in position 218: ordinal not in range(128) HOT 1
- AttributeError: 'NoneType' object has no attribute 'reset' HOT 3
- Any way to solve "ERROR: 'NoneType' object is not iterable"? HOT 1
- Where does the CAPTCHA pop up when the "ERROR: CaptchaChallenge: User needs to solve CAPTCHA to continue." error is being displayed? HOT 9
- How to solve "ERROR: Throttled: Request is throttled."? HOT 1
- HUGE error right here HOT 2
- how to solve this error? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discordbot-edgegpt.