matt1484 / bl3_auto_vip

Borderlands3 Auto VIP/Shift Code Redemption System
Apache License 2.0
81 stars 19 forks source link

Add reddit bot to maintain codes #14

Open matt1484 opened 4 years ago

matt1484 commented 4 years ago

We should implement a bot that users can mention like: u/bl3_code_bot <code_type> <code> and it will then verify the code is valid via its own VIP account (and the repo) and then add it to a global list for users to pull from.

BradLugo commented 4 years ago

I can probably write the bot. Few questions though:

matt1484 commented 4 years ago

You can have the bot code wherever, I know where the current list is, but I would like it to have its own list, maybe via a private repo that only it can edit, and yes I will create the accounts for both

BradLugo commented 4 years ago

You can have the bot code wherever

It's up to you. I just need to know where to put it

a private repo that only it can edit

We can piggyback off the solution we come up for user authorization when we figure that out.

I just realized another issue: where do you want to host the reddit bot? We could probably use the storage on wherever this thing is running to also store the global list

matt1484 commented 4 years ago

Keep it in the repo, I was thinking Heroku since it’s free. I’ll look into how to store the data and have it persist somewhere

matt1484 commented 4 years ago

So Heroku has postgres for free if we keep it under 10000 rows which seems very doable for the codes https://elements.heroku.com/addons/heroku-postgresql

BradLugo commented 4 years ago

I can test this with a local postgres docker instance then. You cool with me using turnage/graw for this bot?

matt1484 commented 4 years ago

Yeah definitely use graw

BradLugo commented 4 years ago

What are the code types? And do codes have a consistent regex I should match or should I just do (\S+|.*?$)?

matt1484 commented 4 years ago

Vip code types are currently pax, email, creator, boost, diamond, and vault. All codes are one word no spaces

matt1484 commented 4 years ago

Shift code types are psn, pc, xbox (will need these when we add shift code support but you can ignore for now). All codes are 25 randoms alphanumeric characters, typically in groups of 5 separated by hyphens

BradLugo commented 4 years ago

I think we should create a separate repo for this. The docker workflow and database migrations I'm using are making it awkward to work within this repo

matt1484 commented 4 years ago

works for me

BradLugo commented 4 years ago

Can you create that? bl3-auto-reddit-bot or something

squatto commented 4 years ago

IMO you can close this issue and not worry about it. #36 changes the SHIFT code source to shift.orcicorn.com which is actively (and very well) maintained. I'm going to also change the VIP code source to the JSON feed from that same site, so you should never have to track or maintain codes yourself 👍