Created
August 29, 2023 01:13
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{/* 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