Skip to content

Instantly share code, notes, and snippets.

@fadookie
Created August 29, 2023 01:13
Show Gist options
  • Save fadookie/4fc8d23289b6c35ea7b2e6258e55a88a to your computer and use it in GitHub Desktop.
Save fadookie/4fc8d23289b6c35ea7b2e6258e55a88a to your computer and use it in GitHub Desktop.
YAGPDB Custom Command to send a message to a channel without an embed.
{{/* ACTUAL CODE DONT TOUCH */}}
{{$hasContent := false}} {{$content := false}} {{$contentV := ""}} {{$channel := false}} {{$channelV := .Channel.ID}}
{{$flags := cslice "-channel" "-content"}}
{{- range $k, $v := .CmdArgs -}}
{{- if eq . "-content"}} {{$content = true}} {{else if in $flags .}} {{$content = false}} {{end -}}
{{- if and ($content) (not (eq . "-content"))}} {{$hasContent = true}} {{$contentV = joinStr " " $contentV .}} {{end -}}
{{- if eq . "-channel"}} {{$channel = true}} {{else if in $flags .}} {{$channel = false}} {{end -}}
{{- if and ($channel) (not (eq . "-channel"))}} {{$checkChannel := reReplace `<|>|#` . ""}} {{with getChannelOrThread $checkChannel}} {{$channelV = .ID}} {{end}} {{end -}}
{{- end -}}
{{if $hasContent}}
{{sendMessage $channelV $contentV}}
{{end}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment