This is a simple application that identifies comments on Reddit that match a given pattern and (in future) will respond to them.
It is designed to be run on a server, and can be configured to target any subreddit. It is written in Python 3, and uses the PRAW library.
- Clone the repository
- Install the requirements with
pip install -r requirements.txt
- Create a Reddit account for the bot
- Configure the .env file based on the .env.example file
- Run the bot file with
python bot.py
- The bot will check the subreddit for new comments periodically
- If the comment matches the pattern, it will record the comment ID and the user who made the comment
- If the comment does not match the pattern, it will do nothing
- The bot will then sleep for a given amount of time (default 10 seconds)
- The bot will then repeat the process
- to be added
Risks | Mitigation |
---|---|
The bot could be banned from the subreddit | The bot will only respond to comments that match a given pattern |
The bot could respond to the same comment multiple times | Handled by the ReplaysLolAPI |
The bot could respond to a comment that is not a replay | Handled by pattern matching/ReplaysLolAPI |
Storage of credentials | Handled by .env file, not stored in plain text |
The bot could be used to spam the subreddit | The bot will only respond to comments that match a given pattern |
The bot could be used to spam the replays.lol API | The bot will only respond to comments that match a given pattern |
The bot could respond to users who do not want it to | Implement blacklist? |
Supports hosting on Windows and Ubuntu.
https://u.gg/lol/profile/euw1/:Name/overview
https://blitz.gg/lol/profile/euw1/:Name
https://na.op.gg/summoners/na/:Name
- Add support for other patterns
- Add support for other responses
- Determine request/response schema for ReplaysLolAPI
- Create endpoint to carry out the replay recording
- Host replay recording