Alternative to the $(alias) variable?

Asked Nov 8, 2023·1 reply·Last activity 2 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

I tried using $(alias) to run a specific command that is chosen in an array via some conditions using $(eval). However, I noticed that the $(alias) variable hasn't existed since the migration to the new alias system after a brief search.

Is there another way to run a command through another command (or a timer in my case), without having to enter the command name in the alias field?

For context, here's an example of what I'm trying to do:

js
let a = ['!discord', '!socials', '!sponsor', '!youtube'];
let m = Math.floor((new Date()).getMinutes() / 15);
`$(alias ${a[m]})`;

I'm aware I can directly put the messages in the array. I'm doing it this way because I want to follow the DRY principle, as the messages already exist in commands.

1 reply

Hey @Indigo Owl!

There's no $(alias) variable, what you can do instead is have 4 timers, the first one set at 15 minutes, the second at 30 minutes, the third at 45 minutes, and the last one at 60 minutes, you won't be able to suppress the output of the first timers tho'.

The other option is to use staggered timers, without or with a Pastebin. I'm pretty sure you could replace the API they're using with the $(count) variable tho'.