Meme Generator
This command generates a meme using a template and top/bottom text.
Trigger
Type: Command
Trigger: meme
Usage
-meme <template> <top-text> <bottom-text>
- Generates a meme using the template, top text and bottom text provided. The template may be eitherboth
,buzz
,doge
,joker
, orsad-biden
.-meme custom <top-text> <bottom-text> <image-link>
- Generates a meme using the image, top text and bottom text provided. Instead of an image link, you may also attach an image to the message.
Special characters
Sometimes, special characters will mess up the link, so we advise that you only use the following special characters in the top/bottom text:
, ?
, %
, #
or /
.
Code
{{/*
Creates a meme based off user input.
See <https://yagpdb-cc.github.io/fun/meme> for more information.
Author: GenryMg <https://github.com/hng12>
*/}}
{{ $link := "https://memegen.link" }}
{{ $args := parseArgs 3 (`Usage: -meme <meme template> "top text" "bottom text"`)
(carg "string" "template")
(carg "string" "top-text")
(carg "string" "bottom-text")
(carg "string" "custom-link")
}}
{{ $replacers := cslice " " "?" "%" "#" "/" }}
{{ $replacements := cslice "_" "~q" "~p" "~h" "~s" }}
{{ $meme := $args.Get 0 }}
{{ $top := $args.Get 1 }}
{{ $bottom := $args.Get 2 }}
{{ range $i, $ := $replacers }}
{{- $meme = split $meme . | joinStr (index $replacements $i) }}
{{- $top = split $top . | joinStr (index $replacements $i) }}
{{- $bottom = split $bottom . | joinStr (index $replacements $i) -}}
{{ end }}
{{if or ($args.IsSet 3) .Message.Attachments }}
{{ $cuslink := $args.Get 3 }}
{{ with .Message.Attachments }}
{{ $cuslink = (index . 0).URL }}
{{ end }}
{{ $msglink := joinStr "/" $link $meme $top $bottom }}
{{ $msglink = joinStr "" $msglink ".jpg?alt=" }}
{{ $msglink1 := joinStr "" $msglink $cuslink }}
{{ sendMessage nil (cembed "image" (sdict "url" $msglink1)) }}
{{else}}
{{ $msglink := joinStr "/" $link $meme $top $bottom }}
{{ $msglink = joinStr "" $msglink ".jpg" }}
{{ $col := randInt 111111 999999 }}
{{ sendMessage nil (cembed
"title" "Here is your meme"
"image" (sdict "url" $msglink)
"color" $col
) }}
{{end}}
Author
This custom command was written by GenryMg.