I would like to automate my account, yet am unable to do so without a API key

Hello! I have been trying to automate my account for quite a long time now. All my attempts have failed. I am aware that it is possible as I have seen several other bots. Perhaps G’Day bot. How could it have been created without a replit API key? I am very confused. Here is the code I wanted to use yet couldn’t as I couldn’t get an API key

If it can help you solve this, you may look at the code that did not work

Click to view code
import openai
import requests
import time
openai.api_key = "YOUR_OPENAI_API_KEY"
def generate_response(text):
    response = openai.Completion.create(
        engine="text-davinci-002",
        prompt=text,
        max_tokens=1024,
        n=1,
        stop=None,
        temperature=0.5,
    )
    return response["choices"][0]["text"]
def reply_to_comment(comment_id, response):
    headers = {
        "Authorization": "Bearer YOUR_REPLIT_SECRET_KEY",
    }
    data = {
        "content": response,
    }
    url = f"https://replit.com/api/v0/repls/{comment_id}/comments"
    requests.post(url, headers=headers, json=data)

def monitor_comments():
    headers = {
        "Authorization": "Bearer YOUR_REPLIT_SECRET_KEY",
    }
    url = "https://replit.com/api/v0/comments"
    while True:
        comments = requests.get(url, headers=headers).json()
        for comment in comments:
            if comment["repl_id"] in specified_repls:
                response = generate_response(comment["content"])
                if response:
                    reply_to_comment(comment["id"], response)
            elif "@your_bot_name" in comment["content"].lower():
                response = generate_response(comment["content"])
                if response:
                    reply_to_comment(comment["id"], response)
            else:
                response = comment["content"].lower()
                if response in dictionary:
                    reply_to_comment(comment["id"], dictionary[response])
        time.sleep(5)
specified_repls = [
    "repl1_id",
    "repl2_id",
    "repl3_id",
]

dictionary = {
    "hello": "Hi there!",
    "how are you?": "I'm doing well, thank you for asking!",
}

monitor_comments()
1 Like
  1. the api endpoint is replit.com/graphql
  2. No. To clarify, sorry. You cannot, it’s been banned so I can say the endpoint but other than that you are not allowed to automate your accounts anymore
2 Likes

I am already aware of the fact of it being banned. Like mentioned in the description, how are G’day and other bots functioning though?

I literally told you I can’t say anything -_-

Most of these bots are open-source (because they’re on Replit); you just have to know where to look. The Gdaybot site has a README that clearly states something to the effect of “if you fork and run this without moderator permission, you may get in big trouble”. So, although bots are really cool, they are most difficult to do without getting in trouble. The moderators are just trying to be helpful by stopping a bunch of spam on Replit.

1 Like

sigh you also can’t because most of the vital “things” (don’t say XD) are env vars so forking will delete those :confused:

2 Likes