Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {{/*This part get's the database msg1 */}}
- {{$x := dbGet (index .Message.Mentions 0).ID "msg1"}}
- {{/*If they don't have the db stored msg, run this code */}}
- {{if not $x}}
- {{giveRoleID (index .Message.Mentions 0).ID ROLE_ID_HERE}}
- {{$embed := cembed "description" "Custom embed description"}}
- {{/*Send them a message, and store that msg ID ($x) into the db */}}
- {{$x := sendMessageRetID CHANNEL_ID_HERE (joinStr "" "Hey " (index .CmdArgs 0) ", CUSTOM_MESSAGE! (*You can remove this message by typing* `ok`)")}}
- {{dbSet (index .Message.Mentions 0).ID "msg1" (toString ($x))}}
- {{/*Send them a message, and store that msg ID ($y) into the db */}}
- {{$y := sendMessageRetID CHANNEL_ID_HERE $embed}}
- {{dbSet (index .Message.Mentions 0).ID "msg2" (toString ($y))}}
- {{end}}
- {{/*If there are 2 arguments in the command (-cmd @user -override) run through this */}}
- {{if eq (len .CmdArgs) 2}}
- {{if eq (index .CmdArgs 1) "-override"}}
- {{/*If they have a db msg1 already, we'll delete it */}}
- {{if $x}}
- {{deleteMessage CHANNEL_ID_HERE $x.Value 0}}
- {{dbDel .User.ID "msg1"}}
- {{end}}
- {{/*If they have a db msg2 already, we'll delete it */}}
- {{$y := dbGet .User.ID "msg2"}}
- {{if $y}}
- {{deleteMessage 605520014551941218 $y.Value 0}}
- {{dbDel .User.ID "msg2"}}
- {{end}}
- {{/*Making sure they still have the role- want them to still access the channel! (Same code as above)*/}}
- {{giveRoleID (index .Message.Mentions 0).ID ROLE_ID_HERE}}
- {{$embed := cembed "description" "Custom embed description"}}
- {{$x := sendMessageRetID CHANNEL_ID_HERE (joinStr "" "Hey " (index .CmdArgs 0) ", CUSTOM_MESSAGE! (*You can remove this message by typing* `ok`)")}}
- {{dbSet (index .Message.Mentions 0).ID "msg1" (toString ($x))}}
- {{$y := sendMessageRetID CHANNEL_ID_HERE $embed}}
- {{dbSet (index .Message.Mentions 0).ID "msg2" (toString ($y))}}
- {{end}}
- {{end}}
- {{/*If they have the db msg stored, and no argument to override was entered: */}}
- {{if and ($x) (ne (len .CmdArgs) 2)}}
- {{$oof := sendMessageRetID nil "That user has already been asked to review the plugin. To forcefully override the old one, add -override"}}
- {{deleteMessage nil $oof 60}}
- {{end}}
- {{/*Delete the command msg the user entered */}}
- {{deleteMessage .Channel.ID .Message.ID 0}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement