#๐Ÿ”’ can someone help

106 messages ยท Page 1 of 1 (latest)

lone warrenBOT
#

@opaque flare

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

opaque flare
#

im getting the error
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "<stdin>", line 4, in main
File "<stdin>", line 3, in check_code
NameError: name 'requests' is not defined

import string
import random
import time

# Configure your Discord webhook URL here
WEBHOOK_URL = 'DISCORD WEEBHOOK HERE'

def generate_random_string(length=16):
    characters = string.ascii_letters + string.digits
    random_string = ''.join(random.choice(characters) for _ in range(length))
    return random_string

def check_code(code):
    url = f"https://discordapp.com/api/v9/entitlements/gift-codes/{code}?with_application=false&with_subscription_plan=true"
    response = requests.get(url)
    return response

def send_to_discord(webhook_url, code):
    data = {
        "content": f"Valid code found: {code}"
    }
    response = requests.post(webhook_url, json=data)
    return response

def main():
    while True:
        code = generate_random_string()
        response = check_code(code)
        if response.status_code == 200:
            send_to_discord(WEBHOOK_URL, code)
        time.sleep(1)  # To prevent spamming the server, adjust the sleep time as needed

if __name__ == "__main__":
    main()
weak summit
weak summit
opaque flare
#

now what

weak summit
#

Not sure what you did, but you should already have pip installed.

#

Just do python3 -m pip install "requests"

opaque flare
#

it says invalid syntax

weak summit
#

You run that in a system shell, not a Python shell. Show a screenshot of what you ran.

opaque flare
weak summit
#

Use py instead of python3 then. Do you have Python installed?

opaque flare
#

yes

weak summit
#

Ya, so use py instead.

opaque flare
#

worked

weak summit
#

Yay

opaque flare
#

lemme check the code

#

i think it worked

#

it says this

weak summit
#

Oh, don't run code like that. That will be a mess.

opaque flare
#

how

#

then

weak summit
#

The >>> indicates that you're in a REPL, which is meant to run single lines of code at a time.

#

Not whole programs.

opaque flare
#

oh

#

so how do i run it

#

i make a txt file?

#

and change it to py?

weak summit
#

Yep

opaque flare
#

alr

weak summit
#

Then python your_script.py to run it.

opaque flare
#

wdym

weak summit
#

After you put the code into a text file, you need to give it to Python to run it.

opaque flare
#

wait

#

can i screenshare to u?

#

im not sure what to do

weak summit
#

I can't really join a call right now.

Have you created a text file and put the code in? Start there.

opaque flare
#

yes

#

i did that

#

now what

weak summit
#

Where did you save the file?

opaque flare
#

in a folder

weak summit
#

If you right click in that directory, is there an option "Open in terminal"?

opaque flare
#

no

#

there isnt'

weak summit
#

Ok, then, open the terminal back up, and use cd to navigate to the Downloads directory.

opaque flare
#

now what

#

i opened terminal

weak summit
#

And used cd?

opaque flare
#

it didnt do nun

weak summit
#

cd means "change directory". It's the terminal equivilent to double clicking a directory.

#

You need to give it the path to move to.

#

In this case, cd Downloads.

opaque flare
#

ok now what

weak summit
#

Then cd "New Folder"

opaque flare
#

now what

weak summit
#

Whoops, cd "New folder".

opaque flare
#

yes

#

i did that

weak summit
#

Now py "New Text Document.py"

opaque flare
#

yes

#

now what

weak summit
#

That's it. That runs the code.

opaque flare
#

what do i do now

#

do i click on the file?

weak summit
#

I'm not sure what you mean. Your code ran/is running.

opaque flare
#

oh

#

do i just wait now?

weak summit
#

Does it just show a blank terminal now under the command you ran?

opaque flare
#

this is what it shows

weak summit
#

Ya, so your code is running.

opaque flare
#

ok

#

i dont have to anything?

weak summit
#

I have no idea what your code is meant to be doing, so idk.

opaque flare
#

its meant to generate nitro

weak summit
#

I don't know what that means.

slow tendon
#

That's not a thing

opaque flare
#

how is it not

#

it is

#

it can generate

#

like

#

it generates random 16 number alpha numeric values

#

and theres a small chance

#

it works

weak summit
#

Oh, it's trying to brute force gift codes?

opaque flare
#

yes

slow tendon
#

It's not a thing, that's not how this works...

#

also

weak summit
#

!rule 5

lone warrenBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

slow tendon
#

.rule 5

#

oops

opaque flare
#

โ˜ ๏ธ

#

lol

#

does it work tho?

lone warrenBOT
#

:warning: The owner of this post is no longer in the server.

fading sandal
#

๐Ÿ˜‚

lone warrenBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.