How do I add temprole to any user in an automated way using djs14??

I know I can use dyno bot or carl bot for it but I want to automate it. Writing my own temprole feature feels like peeling off skin from the side of my fingernails. I tried to do this but it wont work for obvious reasons because carl bot ignores my bot.I know I can use dyno bot or carl bot for it but I want to automate it. Writing my own temprole feature feels like peeling off skin from the side of my fingernails. I tried to do this but it wont work for obvious reasons because carl bot ignores my bot.
46 Replies
d.js toolkit
d.js toolkit7mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
BigBrainAFK
BigBrainAFK7mo ago
so do you have any code of your attempts to write this yourself?
Devvvvvv
DevvvvvvOP7mo ago
the image above? yes that message is written using code that checks for a certain action, just that carl bot ignores my message
BigBrainAFK
BigBrainAFK7mo ago
so your bot already knows who to give the roles to. at that point just add the roles via your bot and have some automated cron like jobs to remove them after the time, of 30mins in the screenshot, instead of using a secondary bot
Devvvvvv
DevvvvvvOP7mo ago
I thought it is the same as me doing it manually, how would it be innefficient?? @Qjuh cron job is like a thread?
chewie
chewie7mo ago
Because any decent bot ignores other bots
Devvvvvv
DevvvvvvOP7mo ago
they could atleast add a feature to make exceptions 😭
BigBrainAFK
BigBrainAFK7mo ago
well first off you automated the command generation already and then try to pass of the small work left to another bot idk how this is an effective solution (passing it to another bot that is)
Devvvvvv
DevvvvvvOP7mo ago
no im not storing anthing 😭
BigBrainAFK
BigBrainAFK7mo ago
yeah idk where your bot gets the role names from then
Devvvvvv
DevvvvvvOP7mo ago
so i need to enter a key in a modal and if the key works then the bot assigns a temp role to user problem with cronjob (like a thread or timer i think) i see is that if my bot goes down then it forgets to take off role hwne it comes back up hence database and if i want to implement robustly this solution, i need to write another database system that tracks all this the role names are hardcoded since they are specific to this "key" feature i have no database solution implemented yes they are actual roles that i want to remove from users after a while, like a temp access kind of thing
BigBrainAFK
BigBrainAFK7mo ago
implementing sqlite is simple
Devvvvvv
DevvvvvvOP7mo ago
is there no other way other than databases 😭 this is why im passing of this job to super efficient largescale god carl bot or dyno bot yes but then if my bot gies down for maintainance or some other issue, people with the roles keep it
BigBrainAFK
BigBrainAFK7mo ago
no if it comes back up you remove all the timed roles (of people who have it)
Devvvvvv
DevvvvvvOP7mo ago
yes but untill it comes back up also how would i mass remove roles? (its interesting)
dePasta
dePasta7mo ago
if carl went down it would be the same issue lol
Devvvvvv
DevvvvvvOP7mo ago
so if its down, even after the 30 minutes run oyt the roles on the people stay since cron job wont remove it.
BigBrainAFK
BigBrainAFK7mo ago
yeah i still dont see how adding another, uncontrolled by you, automation helps in this scenario
Devvvvvv
DevvvvvvOP7mo ago
but carl is a lot more reliable 😭 i dont get to break my head writing a bad solution for a feature thats implemented perfectly in carl
BigBrainAFK
BigBrainAFK7mo ago
cant learn how to write good solutions if you dont implement bad ones first you cant walk if you dont crawl first
Devvvvvv
DevvvvvvOP7mo ago
because im using a private hosting service with a few hours amount of downtime every month 😭 thats true
BigBrainAFK
BigBrainAFK7mo ago
so implement an sqlite db idk how your bot even knows that keys for temp roles are valid do you hardcode the keys?
Devvvvvv
DevvvvvvOP7mo ago
nah i have a rest api setup with this bot that generates it and stores it in mem till it is used
BigBrainAFK
BigBrainAFK7mo ago
so if your bot goes down the keys are invalid we arrived at the same issue
Devvvvvv
DevvvvvvOP7mo ago
if my bot goes down there is no use of the keys because the modal to enter it is given by that bot okay okay hold on
BigBrainAFK
BigBrainAFK7mo ago
ye and if its back up theres no use to the keys either cause they are gone you build a bot that only works well if its up all the time yet chose hosting that goes down for a couple of hours every month
dePasta
dePasta7mo ago
either get a good host or just stick with manually doing commands lol
Devvvvvv
DevvvvvvOP7mo ago
my issue is, I dont want to write my own database to implement temproles because its too much extra work. I want to somehow automate carl bots temprole with my bot
BigBrainAFK
BigBrainAFK7mo ago
so hire some staff person to do it ez automation
Devvvvvv
DevvvvvvOP7mo ago
☠️ yall are just trollling me now
BigBrainAFK
BigBrainAFK7mo ago
no
Shaylinn79
Shaylinn797mo ago
you won't find a way to call a carl command through a bot, carl simply ignores them, there's no way around that
BigBrainAFK
BigBrainAFK7mo ago
your issue is youre lazy
Devvvvvv
DevvvvvvOP7mo ago
yesyes so is there some kind of indirect way like a trigger o could play with or something
BigBrainAFK
BigBrainAFK7mo ago
no
Shaylinn79
Shaylinn797mo ago
no, if the message doesn't come from a human user, carl ignores it
BigBrainAFK
BigBrainAFK7mo ago
if you break discord ToS and eventually get banned of the platform its possible otherwise no not to mention you already did the hard part database and timed roles is the easy part
Devvvvvv
DevvvvvvOP7mo ago
yesyes what i meant is instead of reactint to messages if it can react to anyting else that will ask it to give temp role idk
BigBrainAFK
BigBrainAFK7mo ago
no
Devvvvvv
DevvvvvvOP7mo ago
i see no other way then i suppose does the bot also ignore webhook?
Shaylinn79
Shaylinn797mo ago
like using carl reaction roles? would still have to be the user that directly clicks the reaction to trigger the action
Devvvvvv
DevvvvvvOP7mo ago
what i meant by react how the bot works. it reacts to comands and does stuff etc etc
BigBrainAFK
BigBrainAFK7mo ago
if it would work id personally work towards getting that fixed in carlbot
Devvvvvv
DevvvvvvOP7mo ago
whattt????? how is that violation? hmm
BigBrainAFK
BigBrainAFK7mo ago
also in the 30minutes of arguing here you could have already read a tutorial on sqlite and implement the db and prob also be partially into making the code to remove the roles
Devvvvvv
DevvvvvvOP7mo ago
im just trying to get some help on any dirty workaround bud dont be like that
Want results from more Discord servers?
Add your server