Why I can't use Python requests module on Replit anymore

I have made the project that can send discord messages using my account token but it recently doesn’t work anymore and i dont know what happened. I remember the last time it still worked is 03/10/2023. So anyone help me pls

Hi how are you doing?

1 Like

Do you have an error message or can you share your replit link?

1 Like

I just make a project that allow me send discord message using Python Replit.
This is my simple code:

import requests

url = “http s://discord.com/api/v9/channels/<channel_id>/messages”
headers = {
“Authorization”: “my_token”,
“Content-Type”: “application/json”
data = {
“content”: “Hello, World!”

response = requests.post(url, headers=headers, json=data)

But nothing happened :frowning:

For starters, there is a space between http and s

no, this website can not allow me have the link in post, so i add the space in

Can you print the response, what does it look like

It don’t have any error but nothing happen on discord. The code still work on google colab and Visual Studio Code on my laptop

If the code works but only breaks on Replit with no error, you may need to follow up with Replit or Discord. Maybe one of them blocked the other. In that case we wouldn’t be able to help you with the code.

1 Like