{{define "cp_custom_commands"}}
{{template "cp_head" .}}
Custom commands
Available template data is {{template "template_helper_user"}}
Execute bot commands using {{"{{exec \"command\" \"arg1\" \"arg2\"}}"}}
, Example: {{"{{exec \"role\" \"yagpdb\""}}"}}
will be the same as the user typing (mention or prefix) role yagpdb
Arguments are available in a string array: .CmdArgs
Access single arguments by index using {{"{{index .CmdArgs 0}}"}}
Get the number of arguments using {{"{{len .CmdArgs}}"}}
Loop over them with {{"{{range .CmdArgs}}{{.}}"}} <- that dot will be replaced by the current argument we're looping over{{"{{end}}"}}
"end" marks the end of the for loop.
See the templating docs for more info and join the support server if you have questions. It's rather complicated so I will make more guides in the future.
YAGPDB will pick one message at random from all configured.