Skip to main content

List Groups

This command lists all currently configured CAH card pack groups.

For more information about the CAH card pack system, see this page.

Trigger

Type: Command
Trigger: listgroups

Usage

  • -listgroups - Lists all currently configured CAH card pack groups.

Code

{{/*
Lists all currently configured CAH card pack groups.
See <https://yagpdb-cc.github.io/fun/cah-groups/listgroups> for more information.

Author: LRitzdorf <https://github.com/LRitzdorf>
*/}}

{{ $pattern := "" }}
{{ if ne (len .CmdArgs) 0 }}
Filtering groups by `{{index .CmdArgs 0}}` and ignoring other arguments.
{{- $pattern = joinStr "" "group %" (index .CmdArgs 0) "%" }}
{{- else }}
{{- $pattern = "group %" }}
{{- end }}
{{- $groups := dbGetPattern 0 $pattern 100 0 }}
`Group name` - pack-1 pack-2 ...
{{ range $groups }}
{{- $strippedKey := slice .Key 6 (len .Key) }}
`{{$strippedKey}}` - {{.Value}}
{{- else }}
No pack groups defined. Use `-setgroup "group name" "pack-1 pack-2 ..."` to set some up!
{{ end }}

Author

This custom command was written by @LRitzdorf.