Skip to content

Instantly share code, notes, and snippets.

@Hans5958
Last active August 13, 2023 10:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Hans5958/e5f8228d71491ea5bc3adcb320e112d0 to your computer and use it in GitHub Desktop.
Save Hans5958/e5f8228d71491ea5bc3adcb320e112d0 to your computer and use it in GitHub Desktop.

Jail and Unjail Custom Command on Dyno

This is a jail and unjail command that I made on my spare time. This is made for easier and faster response, along with a better way to jail someone on the phone.

Please note that the bot doesn't know if you jailed a right person, so please double check. Well, you can remove {silent} so you know if it's a success, but it won't be seamless.

Steps for the novices

  1. Go to your server's Dyno custom commands module.
  2. Turn on the module if it's not turned on.
  3. Click the "Add Command" button.
  4. Set the command (for example jail) and put the response in the appropriate fields.
  5. Done, try it.

These steps below are optional.

  1. Set the options.
    Focus at the Silent Command option.
  2. Set the permissions.
    This should be optional, because the first two lines. But, if you want to be sure, just set it.
  3. Set the Advanced Options.
    If you want to set the minimum arguments, set it to 1.
Images for references

Commands

>>jail [user]

{require:Moderator}
{require:Administrator}
{silent} {!role removeall $1}
{silent} {!role $1 +Jailed}
<:dynoSuccess:314691591484866560> **$1** has been jailed. To remove the role, do ``?unjail $1``.
*P.S. Please double check if the user is jailed.*

>>unjail [user]

{require:Moderator}
{require:Administrator}
{silent} {!role $1 -Jailed}
<:dynoSuccess:314691591484866560> **$1** has been released from the jail.
*P.S. Please double check if the user is unjailed.*
@doobieless
Copy link

How would you make it so that when the user is unjailed, they get all their former roles back?

@Hans5958
Copy link
Author

Hans5958 commented Mar 3, 2021

How would you make it so that when the user is unjailed, they get all their former roles back?

As far as I know, I don't think it is possible at this moment. Dyno doesn't have some kind of memory feature. One alternative that I suggest is to make the Jailed role high enough, so it overrides other role permissions. That way you can just remove the Jailed role, restoring his initial roles and permissions.

@Dharvish
Copy link

How do you specify the duration of how long one should be jailed ?

@Hans5958
Copy link
Author

Hans5958 commented Feb 20, 2022

How do you specify the duration of how long one should be jailed ?

My implementation doesn't have one (aka you can't), but you can add the feature yourself if you wanted to.

@Hardikanand1st
Copy link

How to make that if the user leave and join the server again, he will be sent to jail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment