Skip to content
The Chat Archive
gpt-3.5-turbo-0125· OpenAI WildChat-4.8M (AI2)

if valstat == 200: print(f"CODE FOUND! {code} Token: {token}") with open('success.txt',…

  1. User

    if valstat == 200: print(f"CODE FOUND! {code} | Token: {token}")

        with open('success.txt', 'w') as file:
            file.write(f"Token: {token}\nCode: {code}")
            
        time.sleep(2)
        input("Press enter to exit..")
        sys.exit()
    

    Modify this code to also send a request to a discord webhook with the code and token

  2. Assistant

    import requests import sys import time

    if valstat == 200: print(f"CODE FOUND! {code} | Token: {token}")

    with open('success.txt', 'w') as file:
        file.write(f"Token: {token}\nCode: {code}")
    
    # Sending request to Discord webhook
    webhook_url = 'YOUR_DISCORD_WEBHOOK_URL'
    headers = {'Content-Type': 'application/json'}
    data = {'content': f'New Code Found!\nToken: {token}\nCode: {code}'}
    response = requests.post(webhook_url, headers=headers, json=data)
    
    if response.status_code == 204:
        print('Webhook request sent successfully')
    else:
        print('Failed to send webhook request')
    
    time.sleep(2)
    input("Press enter to exit..")
    sys.exit()