Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

6
LINES

< > BotCompany Repo | #1023463 // jda_setAvatar - works... sometimes. Discord has an avatar changing limitation too

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3854L/27K).

svoid jda_setAvatar(virtual JDA jda, S imageID) {
  virtual Icon icon = call(getClass_vmName_mandatory(gazelle_jda(), "net.dv8tion.jda.core.entities.Icon"), 'from, loadImageAsFile(imageID));
  call(call(call(jda_selfUser_gen(jda), 'getManager), 'setAvatar, icon), 'queue,
    (java.util.function.Consumer) x -> { print("success"); },
    (java.util.function.Consumer) x -> { print("error"); });
}

Author comment

Began life as a copy of #1023452

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023463
Snippet name: jda_setAvatar - works... sometimes. Discord has an avatar changing limitation too
Eternal ID of this version: #1023463/11
Text MD5: d6f4f85c324f5f32eae0980434d1a37f
Transpilation MD5: 7235b2462d28ce0f1e9054d808fa48b2
Author: stefan
Category: javax / discord
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-22 23:45:41
Source code size: 401 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 336 / 469
Version history: 10 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1024113 - gazelle_setAvatar - remember the Discord avatar changing limitation