#๐ I need help on import "request" could not be resolved from source.
38 messages ยท Page 1 of 1 (latest)
@hollow cobalt
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.
requests is a thrid party package (not part of the stdlib - "standard library", which comes with Python). You need to install it.
The command: python3 -m pip install requests
should do that, run in the terminal window at the bottom of your VSCode window. If you're on Windows, say py instead of python3, I think.
The error you see in that screenshot is specific to VS Code and the Pylance extension, not directly related to Python.
Pylance is saying one of two things:
- The module is not installed in the environment it's looking at.
- Pylance is looking at the wrong environment.
Once VS Code has the right environment selected, then Pylance will be able to read the packages you've pip-installed and show intellisense completions.
which one i have to select on here
Probably the first one, the .venv?
letme try
uh okay it solved i did on 3rd
god bless you guys
thanks again
and i have 1 more question can i run my code on microsft excel? like if i type the token and discord channel and what i want to sent in that excel
is it possible to do? or i just have to do in vsc
Why would you want to use Excel as an input for a Discord bot?
Environment variables would be simpler. Such as with:
!pypi python-dotenv
mini spammer
Oh, that's why. Probably shouldn't be doing that, regardless.
i will use it on my server not for disturbing anyone
i play 1 game and there is items i want to sell , and i wanted to spam a channel like 2 per hours like sell item at blablabla
Sounds like you are making a cron job with a notification, then.
Anyway, env variables would be the simplest means to authenticate the bot and your chosen server without exposing the token in a github repo, for example (as long as you don't commit the .env file)
not with bot with discord token is it possible?
You would use discord token to authenticate a bot account, yes.
okey can i show you what i type on the vsc and if you know about that can you tell its normal or not?
there is not much turkish guide on youtube with that conent so i wanted to get help from servers
So you're asking, essentially, to use some token from Discord to make a POST request that sends a message to your given server?
I mean, you could just use a webhook and send messages to it, then.
oh can i?
Create the webhook within the server channel, copy that URL, and play around with POSTing to it from your own app.
oh i see know i wrote you wrong its not my discord channel its discord channel own by a the game i play im sorry i wrote wrong my english is not enough
If you're asking to send messages to a channel on a server you don't own, you might ask them to create a webhook for you.
Otherwise, no. Spamming messages in this way would probably violate Discord Terms of Service.
@signal fractal
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.