alexloney / reddit_marvel_snap_card_bot

u/MarvelSnapCardBot2 on Reddit
MIT License
2 stars 0 forks source link

Need Help #26

Open x1xvictorx1x opened 3 months ago

x1xvictorx1x commented 3 months ago

I honestly dont know how to run it i downloaded the folder placed it in the desktop and then tryed running that command and get this message "C:\Users\User\AppData\Local\Programs\Python\Python38\python.exe: can't open file 'snap_bot/main.py': [Errno 2] No such file or directory PS C:\Users\User"

alexloney commented 2 months ago

It requires a little setup to run, I'll try to go into as much detail as I can here to describe the process.

  1. Clone the repository
    > git clone https://github.com/alexloney/reddit_marvel_snap_card_bot.git
    Cloning into 'reddit_marvel_snap_card_bot'...
    remote: Enumerating objects: 313, done.
    remote: Counting objects: 100% (95/95), done.
    remote: Compressing objects: 100% (56/56), done.
    remote: Total 313 (delta 63), reused 54 (delta 39), pack-reused 218
    Receiving objects: 100% (313/313), 77.81 KiB | 12.97 MiB/s, done.
    Resolving deltas: 100% (161/161), done.
  2. Change into the newly created directory
    > cd reddit_marvel_snap_card_bot
  3. Register your bot with Reddit which may be done at this URL. You'll need to "Create an app" and fill out the information. It should be a "script" and the "redirect uri" is irrelevant for this bot, so you could have that be anything, such as "https://example.com". Save the details (client_id and client_secret) as you'll need them later.
  4. Copy the config.json.sample file to config.json
    > copy config.json.sample config.json
        1 file(s) copied.
  5. Fill out the details in config.json. The result should look something like this:
    {
    "client_id": "xxxxxxxxxxxxxxxxxxxxxx",
    "client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "user_agent": "user_agent_string",
    "username": "username",
    "password": "xxxxxxxxxxxxxxxxxxxx"
    }
  6. Finally, run the program on the subreddit you would like to run it
    python snap_bot\main.py --config-file config.json --subreddit <subreddit>

    You should then see output similar to the following

    2024-05-07 09:52:18,582 INFO     Starting Reddit bot
    2024-05-07 09:52:18,584 INFO     Subreddit: <subreddit>
    2024-05-07 09:52:18,584 INFO     Config File:
    2024-05-07 09:52:18,584 INFO     DB Update Timeout: 86400
    2024-05-07 09:52:18,584 INFO     Max Fuzzing Distance: 2
    2024-05-07 09:52:18,584 INFO     Exact Match Threshold: 3
    2024-05-07 09:52:18,585 INFO     Dry Run: False
    2024-05-07 09:52:18,585 INFO     Debug: False
    2024-05-07 09:52:18,585 INFO     Client ID: xxxxxxxxxxxxxxxxxxxxxx
    2024-05-07 09:52:18,585 INFO     User Agent: user_agent_string
    2024-05-07 09:52:18,585 INFO     Reddit Username: username
    2024-05-07 09:52:18,585 INFO     Loading card lookup database
    2024-05-07 09:52:19,880 INFO     Next DB update in 86400s
    2024-05-07 09:52:19,880 INFO     Establishing Reddit connection (<subreddit>)
    2024-05-07 09:52:19,880 INFO     Using supplied id/secret/agent/user/pass
    2024-05-07 09:52:19,881 INFO     Reddit connection established

I have a few final notes for you:

Finally, if you're simply wanting this bot to run on your subreddit, you could also let me know what subreddit you would like for it to run on and I could set up my deployment to also handle that subreddit.