Skip to content

Instantly share code, notes, and snippets.

@cloudwheels
Last active September 15, 2020 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloudwheels/ea23dcabc5bfb289906918b604486a3b to your computer and use it in GitHub Desktop.
Save cloudwheels/ea23dcabc5bfb289906918b604486a3b to your computer and use it in GitHub Desktop.
Custom config for YAGPDB Bot in dash dev discord to copy selected posts to information channel when moderator adds reaction
{{$reaction := .Message.Reaction nil (index .Args 1) }}
{{$srcReaction:= .Reaction.Emoji }}
{{$srcEmote := $srcReaction.Name }}
{{$targetEmote := "ℹ️"}}
{{$timestamp := (split .ReactionMessage.Timestamp.Parse.String ".")}}
{{if eq $srcEmote $targetEmote }}
{{$channel:= .ReactionMessage.ChannelID}}
{{$channelName:= (getChannel $channel).Name}}
{{$channelID:= (getChannel $channel).ID}}
{{$msg := print ":information_source: **" .ReactionMessage.Author " @ #" $channelName "**\n" "<https://discordapp.com/channels/" .ReactionMessage.GuildID "/" .ReactionMessage.ChannelID "/" .Reaction.MessageID ">\n\n" ">>> " .ReactionMessage.Content "\n" }}
{{$x := sendMessageRetID "information" $msg}}
{{else}}
{{$error:="handle the error"}}
{{end}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment