#๐ Discord bot
283 messages ยท Page 1 of 1 (latest)
@unkempt rain
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Im tryna make a discord bot
and pip and python is being recognized
but i have python in my vsc
its something on my pc
because my friend has the same code on a different bot and it is working
I tried venv and venv works but then it just messes up the whole code
it was legit working 2 days ago
then a popup that sad
"would you like to update pip or python or discord.py (it was one of the three) " and i was stressed out so i just put yes and now its broken
what editor are you using ?
what is the applicaion you are using to use python
the reason i ask is that i know pycharm not VSC sorry
what operating system do you have installed?
windows 10
okay, open your terminal and type in this command:
py --version
afterwards, run this command:
py -m pip --version
ok
Unable to create process using 'C:\Users\Caleb\AppData\Local\Programs\Python\Python313\python.exe --version': The system cannot find the file specified.
Unable to create process using 'C:\Users\Caleb\AppData\Local\Programs\Python\Python313\python.exe -m pip --version': The system cannot find the file specified.
what in the fuck...
okay uh... try uninstalling python
all of em, definitely. There's conflicting stuff going on with your path...
alright
oh yeah i seen people telling me about path but i never really knew how to use it
ok its uninstalled
now what
do i reinstall it?
yes try reinstalling the version of python that you need for your project
so basically, your path is like a "shortcut". Usually in a shell, you need to be specific with a command. What a path does it says "using these shortcuts, try to find a matching command". If you have multiple versions of a program installed and on your path, it could present issues.
its doing the same thing
ooh
its using python 313
i have 311
theres not even a 313 in the folder it lists
๐ญ
@inland flint
u there
didn't you say that you uninstalled it
yes
it says
Unable to create process using 'C:\Users\Caleb\AppData\Local\Programs\Python\Python313\python.exe -m pip --version': The system cannot find the file specified.
and i dont even have python 313 installed
did you download a new python or not
did you move it to that folder? if you didn't not 100% sure but that might fix it
!dashmpip
When trying to install a package via pip, it's recommended to invoke pip as a module: python -m pip install your_package.
Why would we use python -m pip instead of pip?
Invoking pip as a module ensures you know which pip you're using. This is helpful if you have multiple Python versions. You always know which Python version you're installing packages to.
Note
The exact python command you invoke can vary. It may be python3 or py, ensure it's correct for your system.
tried using py?
Unable to create process using 'C:\Users\Caleb\AppData\Local\Programs\Python\Python313\python.exe -m pip --version': The system cannot find the file specified.
i dont even have 313
its something with my path
i fucked up my path
Is Python313 on it?
You may need to restart your cmd after modifying it
What does py -0p do?
idk what that means
i havent coded python in a year and a half
"easier" and "necessary" are two different things
you might want to reset your cohere token, cause it's public now, btw
wheres a cohere token
Lol
you should really reset that
Go to dashboard or something
If you have premium subscription or something, someone can DDoS with your token and bankrupt you
Lol
how do i do that
Does pythons 3.12 and 3.13 show up in Apps?
Uninstall them.
And I meant Settings > Apps
Idk you bought it
it's what replaced Add/Remove Programs
I have never heard of Cohere
lmao
i dont have anything important in cohere
i jst made a trial key
which is completely free
@inland bear
press ok
Why do you have so many versions installed?
i really dont know lmao
my friend was tryna help me
he clearly didnt know a lot
They don't. The question you should ask is "why did you uninstall so many python versions without the uninstaller?"
they told me to do that
rerun the installers and choose to repair installation, then you can properly uninstall it.
alright
hi im back, sorry i had to do some work
oh boy okay uhhh
oh jeez
okay uh
go to this location in your folders:
C:\Users\noahj\AppData\Local\Programs\Python (but use your username instead of mine)
i did
how many installations are listed?
i dont see launcher
that's okay
pip 22.3.1 from C:\Users\Caleb\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip (python 3.11)\
great!!!!
there we go
alright
i think i got it from here
lemme see rq
wait
pip still isnt recogonized
:/
'pip' is not recognized as an internal or external command,
operable program or batch file.
Is Python\Python311\Scripts on your PATH?
no
can you teach me how to do that in dms
cus i dont want to leak something again
i dont feel safe anymore
Rerun the installer and make sure "Add scripts to PATH" is checked
Add Python to environment variables
ok
IT WORKED
OMG TYSm
wait
lemme see if my bot works
tysm
wait dm me unalive
you can do it here
Traceback (most recent call last):
File "C:\Users\Caleb\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\http.py", line 300, in static_login
data = await self.request(Route('GET', '/users/@me'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Caleb\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\http.py", line 254, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\Users\Caleb\Downloads\bots\vtz_bot.py", line 380, in <module>
bot.run(TOKEN)
File "C:\Users\Caleb\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 723, in run
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Caleb\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 702, in runner
await self.start(*args, **kwargs)
File "C:\Users\Caleb\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 665, in start
await self.login(*args, bot=bot)
File "C:\Users\Caleb\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 511, in login
await self.http.static_login(token.strip(), bot=bot)
File "C:\Users\Caleb\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\http.py", line 304, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
i dont want to leak anything
Are you using dotenv?
no
your discord token is bad.
Aparently not.
any spaces in your string?
Did you copy the whole token?
yes
theres no errors
except for that when i run it
and the script should be working cus i used it yesterday
until i updated something today
Try switching to using dotenv
aight
import os
import dotenv
dotenv.load_dotenv()
TOKEN = os.environ["TOKEN"]
!pip python-dotenv
& C:/Users/Caleb/AppData/Local/Programs/Python/Python311/python.exe c:/Users/Caleb/Downloads/bots/vtz_bot.py
Traceback (most recent call last):
File "c:\Users\Caleb\Downloads\bots\vtz_bot.py", line 17, in <module>
TOKEN = os.environ["TOKEN"]
~~~~~~~~~~^^^^^^^^^
File "<frozen os>", line 679, in getitem
KeyError: 'TOKEN'
You also need to create a file named .env ```properties
TOKEN=<your token here>
i did
Did you save?
Please react with โ
to upload your file(s) to our paste bin, which is more accessible for some users.
Get a new token. It may have been invalidated.
alright
lemme reset my pass
ok
i got a new token
put it in dotenv
and it still doin this
Please react with โ
to upload your file(s) to our paste bin, which is more accessible for some users.
Does your token have quotes in the .env file?
Should look like this without the periods.```
M.jM4.NDk0.NzU2.NTIx.Mzc3Nzky.CunGFQ.wUILz7z6HoJzVeq6pyHPmVgQgV4
(It's not a real token)
yes
no
yes looks like that
Something about your token is wrong
it cant be
i just copied it from the logs
and i tried it on an alt
it says the same thing
The logs?
yes
my code doesnt have 700 lines either
so its something in the pythons files
\Lib\site-packages\discord\client.py
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
its a self bot lmao
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
mine isnt malicious
They're against discord TOS
It just means we can't help you anymore.
thats fine
Don't continue to ask for help for it and you won't be banned.
i just didnt know it was bannable
ill rework it into a normal bot
thanks for the help tho :/
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.