python-discord-webhook icon indicating copy to clipboard operation
python-discord-webhook copied to clipboard

Edit multiple webhooks message for long periods of time

Open kass507 opened this issue 2 years ago • 0 comments

How can you edit a message or embed, on a laptop that takes more than 2 hours or 2 days (for example.)

But my intention is to send a message, save the data in a json, based on whether it meets certain conditions, edit it. But the condition can happen from 2 hours after to 2 days later. And it is not only a message to be edited, it may happen that up to 20 per day must be edited. But in example, it only exits to edit it in a short time, without exiting the function

from discord_webhook import DiscordWebhook
from time import sleep

webhook = DiscordWebhook(url='your webhook url', content='Webhook content before edit')
sent_webhook = webhook.execute()
webhook.content = 'After Edit'
sleep(10)
sent_webhook = webhook.edit(sent_webhook)

kass507 avatar May 04 '22 07:05 kass507