Categories > Coding > Python >

[REL] Threaded discord webhook spammer with ratelimit detection.

Posts: 283

Threads: 48

Joined: May, 2022

Reputation: -4

Posted

This is your generic python webhook spammer but I added ratelimit detection which waits the response provided ratelimit time and then continues with the spamming.

 

import threading
import requests
import time
webhook = "webhookurl"
message = "hello!"
spam_amount = 500
thread_amount = 100
def spam_webhook():
    for x in range(spam_amount):    
        request = requests.post(webhook, json={"content": message})
        if request.status_code == 429:
            response_json = request.json()
            print(response_json)
            if response_json["message"] == "The resource is being rate limited.":
                print(f"[spammer] detected ratelimit. waiting {response_json['retry_after'] / 1000} seconds")
                time.sleep(response_json["retry_after"] / 1000)

for thread_idx in range(thread_amount):
    new_thread = threading.Thread(target=spam_webhook)
    new_thread.start()

  • 0

https://media.discordapp.net/attachments/1044764388546068510/1051935933836050482/Signature_4.png

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )