Mimu Bot
Search…
beginner ii: using simple functions
let's learn how functions work in mimu's autoresponders so we can make commands that do actions!

what are functions?

  • a function is something that manipulates, or does an action.
  • these variables allow your autoresponders to have more than just a static response/reply.
  • let's try out a simple autoresponder that gives the user 10 currency with a cooldown of 1 minute.
.ar + give me 10 | {modifybal:+10} {cooldown:60} okay, i've given you 10 {server_currency}, you have {user_balance} now!
  • in this above autoresponder, {modifybal:} takes an amount, and modifies the user's balance by +10.
  • the {cooldown:} function accepts a number in seconds as the cooldown.
  • finally, we have a simple response and placeholder as the response.
it is good practice / habit for you to run functions before the response. this is because in order for some placeholders to be updated, you have to use the function early on. here's an example: .ar + mimu give me money! | your old balance: {user_balance} {server_currency} {modifybal:1000} your new balance: {user_balance} {server_currency} in this scenario, it will provide the old balance, then show the new balance after the balance has been modified. in addition, in the future, when using chooses, ranges, you will find you have to use the functions before the placeholder, to define the choice / range, etc.
  • if you did it right, you should now have something like below!
autoresponders giving you currency rewards
  • let's try out another example! this time, we want to make mimu give us a role and respond in a colored embed when the user types +admirer.
.ar + +admirer | {embed:#ec948a}{addrole: @mimu admirer} hi cutie! i've given you the @mimu admirer role !
  • in the above response, {embed:} accepts either no input, a color (we put in #ec948a), or a premade embed.
  • {addrole:} accepts an input of a role for you to add to the user. in this case, we're adding the "mimu admirer" role!
  • the remaining text is the textual response.
another example of functional autoresponders
  • finally, let's try another example! let's make a mod only command that pings the @chat revive role with a cooldown of 5 minutes.
using cooldowns in your ARs? please note they will show up in the user's .cooldown command unless you delete or modify the AR!
.ar + .chatrevive | {requirerole: @𐐚 ┇ moddies}{cooldown:300} @chat revive
  • the {requirerole:} function allows you to limit it to people with the inputted role. if they don't have the role, the autoresponder will not respond.
  • you can then create a cooldown with the {cooldown:} function. we put 300 because 300 seconds = 5 minutes.
and there you go! c:
there are A LOT of functions for different purposes, from embedding, to redirecting to channels. check out our variable functions list for a full list!
Last modified 8mo ago
Copy link