#Is there a Limit for edits on a Message? If so any workaround possible?

1 messages · Page 1 of 1 (latest)

hollow patrol
#

So i have the following Code:


    global message  # Use the global message variable


    # Filter and ignore the InsecureRequestWarning
    warnings.filterwarnings("ignore", category=requests.packages.urllib3.exceptions.InsecureRequestWarning)

    response = requests.get(URL, verify=False)
    if response.ok:
        html_content = response.text
        server1, server2 = ns.parse_server_info(html_content)
        modified_content = html_content.replace("<br/>", "\n")
        if message is None:
            # If the message is not set, send a new message
            message = await channel.send(modified_content)
        else:
            # If the message is already set, edit it with the new content
            await message.edit(content=modified_content)

    else:
        await channel.send(f'Failed to retrieve website information. Status code: {response.status_code}')

    # Schedule the next update after 30 seconds
    await asyncio.sleep(30)
    await send_website_info(channel)```

The intention is that the bot is sendin the information form my Website to a channel. It works as intended but only for a couple of hours. Is there a limit for message edits on Discord? If so do we have an option to like get a work arround?
narrow basaltBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

flat glade
#
  1. there is a rate limit for message edits too
hollow patrol
flat glade
#

yup it is an async version of requests that is non blocking

hollow patrol
#

and is there a way to work arround with the message edits? Maybe with creating an Embed?

shadow lance
#

theres no way to work around it - its better to work with them instead and space out your edits

hollow patrol
#

alright tysm