#the indented bullet points in this are messed up whee
Explore tagged Tumblr posts
transienturl · 2 years ago
Text
discord bot framework
idea 0 (current setup): bunch of replits. it's limited, sure, but the instant collaboration is hard to beat.
idea 1:
enforced collaboration: github repo aways contains deployed code. no deploying to prod from your own pc ad-hoc.
deploys must be done using github action
discord secrets must all be in github
adding a new bot should take as few actions as possible
single repository with folder of files?
must copy discord secret into github; push code changes with new file (in that order). secret names must stay in sync with code referencing them (error prone).
must be able to test code. 2 options:
run test bots on pc. use ngrok. devs would make a test bot and run e.g. "npm run localTest --botName" to simulate one of the bots. con: they would have to update the ngrok.io url in their test bot config in the discord panel every time they did this.
2 branches, dev and deploy; both are deployed and every bot also has a dev version. just push to dev and see what happens. con: every time you add a bot you have to make 2 bots and add 2 sets of secrets (very manual, possibly error prone).
idea 2: do all deployments from dev pcs, actually, who cares. put discord secrets (and deployment secrets) in a .env file and don't check it in; just mail the thing between devs. effectively, each dev is local and must remember to collaborate with github (and mail the .env) manually.
deploys are done via locally run package script, referencing env. secrets are in one place.
to add a new bot, add new files and new secrets, run e.g. "npm run deploy --botName", done. deplpy script can check if you did the secrets right.
one bot is actually a tester; run "npm run deployToTestBot --botName" to copy a bot's code to the tester bot
con: if devs get out of sync with each other everything becomes Confusing
idea 3: like idea 2, but github codespaces. of course, this is basically just fancy replit now. cons: free tier usage limitations; not sure if you can use github desktop in a codespace and I don't want to teach commandline git; do you have to run npm install every time? etc.
0 notes