Closed berlin320 closed 1 year ago
You need to check if the message has attachments.
For example:
if message.attachments:
for attachment in message.attachments:
send_message(content=attachment.url, username=..., user_avatar=..., webhook=...)
You need to check if the message has attachments.
For example:
if message.attachments: for attachment in message.attachments: send_message(content=attachment.url, username=..., user_avatar=..., webhook=...)
the bot is working for some images but not for some, I am so confused.
Summary
I was using for cloning my one server to another, the bot used to work fine until few days back when it just stopped sending images. It works fine for messages including gifs tho.
Reproduction Steps
Still figuring it out.
Code
No response
Expected Results
import discord import json import requests
just sharing the imp part
def send_message(content, username, user_avatar, webhook): data = { "content": content, "username": username, "avatar_url": user_avatar } response = requests.post(webhook, json=data) return True
Actual Results
should send the images (content)
System Information
Running on pc / replit / heroku. Same issue all places
Checklist
Additional Information
No response