This is the code for u/RemindMeBot on Reddit. Comment RemindMe! 2 weeks and the bot replies to confirm, then messages you when the time's up. It also supports recurring reminders, cake day reminders, and per-user time zones (info post).
I took it over from u/RemindMeBotWrangler in 2019 and rewrote it. It has about 1.1 million pending reminders and sends around 3,000 a day. I'm currently porting it to Reddit's Devvit platform in TypeScript.
It's one Python process running in a loop. It reads its inbox, picks up new comments with a trigger word, saves any new reminders, and sends whatever is due. Every 30 minutes it edits old confirmation comments whose "N others will be reminded" count is out of date, and every hour it updates stats and the r/AskHistorians remindme wiki page.
Comments come from a separate ingest process (not in this repo) that writes matching comments to a SQLite file passed in with --ingest_db. Without that, the bot only handles messages and username mentions.
Times go through dateparser.parse, then dateparser's search_dates, then parsedatetime, and are converted to the user's time zone.
Python, SQLAlchemy on SQLite, and PRAW through PrawWrapper, which also gives the pytest suite a fake Reddit to run against. Dates are parsed with a fork of dateparser and parsedatetime. Errors get posted to Discord with DiscordLogging, and it exports Prometheus metrics.
This code is published for reference. All rights reserved; please don't run your own copy of the bot.