alexloney / reddit_marvel_snap_card_bot

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

Reddit Marvel Snap Card Bot

Overview

A few days prior to this bot being created, I went to the /r/MarvelSnap subreddit and made a comment where I tagged a card using the [[card]] notation. Previously, when a card was tagged like this, the /u/MarvelSnapCardBot would reply with a comment including the card information. However, the comment simply remained there with no reply.

I then investigated the /u/MarvelSnapCardBot and found that it had not replied to any comments in about a month. I was unable to find the owner of the bot, the best I found was this post on /r/MarvelSnap where the bot introduced itself with details on how to use it. However, it did not seem to mention who created it, so I had no way of reaching out to the owner of the bot to inform them that it was not operational anymore.

From there, I decided to take on the project of building a replacement bot for /r/MarvelSnap as it seemed like a fun and interesting challenge. Additionally, the original bot had some shortcomings (such as the card had to be an exact match) that I wanted to take on and resolve.

Usage

This bot is intended to run as a Reddit bot, where it will monitor the /r/MarvelSnap subreddit and when a comment is made that contains the text [[card]], it will attempt to look up the card information and reply to the post with details about the card.

The bot uses marvelsnap.pro as the source of card data, so it will only be as up to date as marvelsnap.pro is.

Features

The following are the features that this bot offers:

TODO

Here are features that I am considering for changes/additons to the bot:

Deployment

This bot may be easily ran in two ways. You may run it directly from the command-line locally or you may run it from a Docker container. The local option is better for development/testing and the Docker option is better for long-term execution to provide persistent runtime

Command-line

python snap_bot/main.py --config config.json --subreddit MarvelSnap

Docker

docker pull ghcr.io/alexloney/reddit_marvel_snap_card_bot:latest
docker run --name reddit_marvel_snap_card_bot \
    --restart unless-stopped \
    -e SUBREDDIT="MarvelSnap" \
    -e CLIENT_ID="xxx" \
    -e CLIENT_SECRET="xxx" \
    -e USER_AGENT="xxx" \
    -e REDDIT_USERNAME="xxx" \
    -e REDDIT_PASSWORD="xxx" \
    -e TZ="America/Los_Angeles" \
    ghcr.io/alexloney/reddit_marvel_snap_card_bot:latest