Skip to main content

Big Emoji v1

This command enlarges emojis.

Trigger

Type: Regex
Trigger: \A(-|<@!?204255221017214977>\s*)(be|big-?emo(te|ji))(\s+|\z)(\s+|\z)

Usage

  • -bigemoji <emoji> - Enlarges the emoji provided. Can be either a Discord default emoji or a custom emoji.
Aliases

Instead of bigemoji, you can also use be, bigemote, big-emote, and big-emoji.

Code

{{/*
Allows you to enlarge emojis.
See <https://yagpdb-cc.github.io/utilities/big-emoji-v1> for more information.

Author: jo3-l <https://github.com/jo3-l>, Satty9361 <https://github.com/Satty9361>
*/}}

{{ if .CmdArgs }}
{{ $embed := sdict }} {{ $emoji := index .CmdArgs 0 }}
{{ if reFind `\p{So}|.\x{20e3}` $emoji }}
{{ $emoji_U := "" }}
{{ $url := "https://raw.githubusercontent.com/iamcal/emoji-data/master/img-twitter-64/" }}
{{- range toRune $emoji }}
{{- $emoji_U = joinStr "-" $emoji_U (printf "%04x" .) }}
{{- end -}}
{{ $url = joinStr "" $url $emoji_U ".png" }}
{{ $embed.Set "image" (sdict "url" $url) }}
{{ else }}
{{ with reFindAllSubmatches `<(a)?:[\w~]+:(\d+)>` $emoji }}
{{ $animated := index . 0 1 }}
{{ $id := index . 0 2 }}
{{ $ext := ".png" }}
{{ if $animated }} {{ $ext = ".gif" }} {{ end }}
{{ $embed.Set "image" (sdict "url" (printf "https://cdn.discordapp.com/emojis/%s%s" $id $ext)) }}
{{ end }}
{{ end }}

{{$ID := 0}}
{{if $embed}}
{{ $embed.Set "color" 0x39ff14 }}
{{ $embed.Set "author" (sdict "name" .User.Username "icon_url" (.User.AvatarURL "256")) }}
{{ $ID = sendMessageRetID nil (cembed $embed) }}
{{ end }}

{{ sleep 1 }} {{/* This just puts a standard output when no matching image is found. You can also use deleteMessage here */}}
{{ with getMessage nil $ID }}
{{ if not (index .Embeds 0).Image.Width }}
{{ $embed.Set "description" $emoji}} {{ $embed.Del "image" }}
{{ editMessage nil $ID (cembed $embed) }}
{{ end }}
{{ end }}
{{ end }}
{{ deleteTrigger 0 }}

Author

This custom command was written by @jo3-l and @Satty9361.