22
33import com .freya02 .botcommands .api .utils .ButtonContent ;
44
5+ import net .dv8tion .jda .api .entities .emoji .CustomEmoji ;
56import net .dv8tion .jda .api .entities .emoji .Emoji ;
67
78import org .jetbrains .annotations .NotNull ;
@@ -285,30 +286,16 @@ public enum LazyEmoji {
285286 */
286287 QUESTION_CLEAR_DARK (1298411642358337578L );
287288
288- @ NotNull private final String name ;
289- private final long id ;
290- private final boolean animated ;
289+ @ NotNull public final CustomEmoji emoji ;
291290
292291 LazyEmoji (long id , boolean animated ) {
293- this .name = "vn" + name ().toLowerCase ().replace ("_" , "" );
294- this .id = id ;
295- this .animated = animated ;
292+ this .emoji = Emoji .fromCustom ("vn" + name ().toLowerCase ().replace ("_" , "" ), id , animated );
296293 }
297294
298295 LazyEmoji (long id ) {
299296 this (id , false );
300297 }
301298
302- /**
303- * Forms a {@link Emoji} from this {@link LazyEmoji}
304- *
305- * @return the {@link Emoji} formed
306- */
307- @ NotNull
308- public Emoji getEmoji () {
309- return Emoji .fromCustom (name , id , animated );
310- }
311-
312299 /**
313300 * Construct a {@link ButtonContent} from this {@link LazyEmoji}
314301 *
@@ -318,7 +305,7 @@ public Emoji getEmoji() {
318305 */
319306 @ NotNull
320307 public ButtonContent getButtonContent (@ Nullable String text ) {
321- return new ButtonContent (text , getEmoji () );
308+ return new ButtonContent (text , emoji );
322309 }
323310
324311 /**
@@ -333,6 +320,6 @@ public ButtonContent getButtonContent() {
333320
334321 @ Override @ NotNull
335322 public String toString () {
336- return getEmoji () .getFormatted ();
323+ return emoji .getFormatted ();
337324 }
338325}
0 commit comments