@@ -13,9 +13,11 @@ import:
13
13
14
14
net.dv8tion.jda.core.EmbedBuilder
15
15
net.dv8tion.jda.core.MessageBuilder
16
+ net.dv8tion.jda.core.entities.Icon
16
17
net.dv8tion.jda.core.entities.User
17
18
net.dv8tion.jda.core.exceptions.RateLimitedException
18
19
20
+ # UploadImage
19
21
effect:
20
22
patterns:
21
23
upload (image|img) %object% [with ([(format|file)] type|[file] format) %-string%] [with (message|embed) %-message/string%] to %user/channel% [with %bot/string%] [and store (it|the message) in %-objects%]
@@ -80,4 +82,27 @@ effect:
80
82
set {_varExpr} to raw expression-5
81
83
if {_varExpr} is set:
82
84
VixioUtil.storeInVar(VixioSkriptUtil.getVariableName({_varExpr}), {_varExpr}, UpdatingMessage.from({_resultingMessage}), event)
85
+ continue
86
+
87
+ # CreateEmote
88
+ effect create [a[n]] [new] (emote|emoji) (using|from|with) [(image|img)] %object% [with ([(format|file)] type|[file] format) %-string%] (named|with [the] name) %string% [in %guild%] [with %bot/string%]:
89
+ trigger:
90
+ if expression-1 isn't instance of BufferedImage:
91
+ stop
92
+ if expression-2 is set:
93
+ set {_format} to expression-2
94
+ else:
95
+ set {_format} to "png"
96
+ set {_name} to expression-3
97
+ replace all " " with "_" in {_name}
98
+ delay the current effect
99
+ set {_bot} to VixioUtil.botFrom(expression-5)
100
+ set {_guild} to VixioUtil.bindGuild({_bot}, expression-4)
101
+ if {_name}, {_format}, {_bot} or {_guild} is not set:
102
+ continue
103
+ set {_baos} to new ByteArrayOutputStream()
104
+ ImageIO.write(expression-1, {_format}, {_baos})
105
+ set {_is} to new ByteArrayInputStream({_baos}.toByteArray())
106
+ set {_icon} to Icon.from({_is})
107
+ expression-4.getController().createEmote({_name}, {_icon}).queue()
83
108
continue
0 commit comments