New block: `Divisible By`

This idea is really simple. It delivers a boolean output for if the first number inside is divisible by the second number

This could be useful to tell if a number is even (divisible by 2) while maintaining the ability for member s to set their own parameters like if they wanted to check if a number is divisible by 5 (one for each workday (or max buttons in a row on an embed)) or divisible by 25 (max buttons, dropdown items and fields on an embed), they wouldn’t need to do a complex system like what’s below

  • Math (Float)
  • Split string by . and use second string
  • String replace 0 for blank
    • If blank, execute
    • If not blank, execute

The image below (minus the top 3 blocks) shows an example of only doing something if the message was sent on a second ending in a 5 or a 0

Why cant use just use the modulo operation with a normal math operation, if the result is 0 then its divisible by the number and if its not 0 then its not divisible by the number

For example to check if its divisible by two its just this


Uhhhh :exploding_head:

I plead the 5th for not knowing this

Im gonna go ahead and close this, it reminded me of the is-even modules you find on npm :joy:

1 Like