Advertisement
CoolLord22

Untitled

Jul 29th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. {{/*This part get's the database msg1 */}}
  2. {{$x := dbGet (index .Message.Mentions 0).ID "msg1"}}
  3.  
  4. {{/*If they don't have the db stored msg, run this code */}}
  5. {{if not $x}}
  6. {{giveRoleID (index .Message.Mentions 0).ID ROLE_ID_HERE}}
  7.  
  8. {{$embed := cembed "description" "Custom embed description"}}
  9.  
  10. {{/*Send them a message, and store that msg ID ($x) into the db */}}
  11. {{$x := sendMessageRetID CHANNEL_ID_HERE (joinStr "" "Hey " (index .CmdArgs 0) ", CUSTOM_MESSAGE! (*You can remove this message by typing* `ok`)")}}
  12. {{dbSet (index .Message.Mentions 0).ID "msg1" (toString ($x))}}
  13.  
  14. {{/*Send them a message, and store that msg ID ($y) into the db */}}
  15. {{$y := sendMessageRetID CHANNEL_ID_HERE $embed}}
  16. {{dbSet (index .Message.Mentions 0).ID "msg2" (toString ($y))}}
  17. {{end}}
  18.  
  19. {{/*If there are 2 arguments in the command (-cmd @user -override) run through this */}}
  20. {{if eq (len .CmdArgs) 2}}
  21. {{if eq (index .CmdArgs 1) "-override"}}
  22.  
  23. {{/*If they have a db msg1 already, we'll delete it */}}
  24. {{if $x}}
  25. {{deleteMessage CHANNEL_ID_HERE $x.Value 0}}
  26. {{dbDel .User.ID "msg1"}}
  27. {{end}}
  28.  
  29. {{/*If they have a db msg2 already, we'll delete it */}}
  30. {{$y := dbGet .User.ID "msg2"}}
  31. {{if $y}}
  32. {{deleteMessage 605520014551941218 $y.Value 0}}
  33. {{dbDel .User.ID "msg2"}}
  34. {{end}}
  35.  
  36. {{/*Making sure they still have the role- want them to still access the channel! (Same code as above)*/}}
  37. {{giveRoleID (index .Message.Mentions 0).ID ROLE_ID_HERE}}
  38.  
  39. {{$embed := cembed "description" "Custom embed description"}}
  40.  
  41. {{$x := sendMessageRetID CHANNEL_ID_HERE (joinStr "" "Hey " (index .CmdArgs 0) ", CUSTOM_MESSAGE! (*You can remove this message by typing* `ok`)")}}
  42. {{dbSet (index .Message.Mentions 0).ID "msg1" (toString ($x))}}
  43.  
  44. {{$y := sendMessageRetID CHANNEL_ID_HERE $embed}}
  45. {{dbSet (index .Message.Mentions 0).ID "msg2" (toString ($y))}}
  46. {{end}}
  47. {{end}}
  48.  
  49. {{/*If they have the db msg stored, and no argument to override was entered: */}}
  50. {{if and ($x) (ne (len .CmdArgs) 2)}}
  51. {{$oof := sendMessageRetID nil "That user has already been asked to review the plugin. To forcefully override the old one, add -override"}}
  52. {{deleteMessage nil $oof 60}}
  53. {{end}}
  54.  
  55. {{/*Delete the command msg the user entered */}}
  56. {{deleteMessage .Channel.ID .Message.ID 0}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement