Last active
September 15, 2020 17:11
-
-
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
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
{{$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