78 lines
1.7 KiB
Java
78 lines
1.7 KiB
Java
package com.discord.models.domain;
|
|
|
|
import com.PatchConfig;
|
|
import com.discordtest.BuildConfig;
|
|
|
|
import java.io.IOException;
|
|
import java.util.Map;
|
|
|
|
import lanchon.dexpatcher.annotation.DexAdd;
|
|
import lanchon.dexpatcher.annotation.DexEdit;
|
|
import lanchon.dexpatcher.annotation.DexIgnore;
|
|
import lanchon.dexpatcher.annotation.DexWrap;
|
|
|
|
@DexEdit
|
|
public class ModelUser implements Model {
|
|
|
|
// add ctc bot
|
|
|
|
@DexIgnore
|
|
public long id;
|
|
|
|
@DexIgnore
|
|
public String username;
|
|
|
|
@DexIgnore
|
|
public int discriminator;
|
|
|
|
@DexIgnore
|
|
public boolean bot;
|
|
|
|
@DexIgnore
|
|
public String avatar;
|
|
|
|
@DexIgnore
|
|
public boolean system;
|
|
|
|
@DexAdd
|
|
public static final ModelUser CTC_BOT = createCtcBot();
|
|
|
|
@DexAdd
|
|
private static ModelUser createCtcBot() {
|
|
ModelUser user = new ModelUser();
|
|
user.id = -1;
|
|
user.username = "CutTheCord";
|
|
user.discriminator = 1;
|
|
user.bot = true;
|
|
//user.system = true;
|
|
user.avatar = "asset://asset/images/default_avatar_clyde.jpg";
|
|
return user;
|
|
}
|
|
|
|
// showtag patch
|
|
|
|
@DexWrap
|
|
public String getNickOrUsername(ModelGuildMember.Computed computed, ModelChannel modelChannel, Map<Long, ModelChannel.RecipientNick> map) {
|
|
String orig = getNickOrUsername(computed, modelChannel, map);
|
|
|
|
if (!PatchConfig.SHOWTAG_ENABLED) {
|
|
// Patch not enabled
|
|
return orig;
|
|
}
|
|
|
|
return orig + " (" + getUserNameWithDiscriminator() + ")";
|
|
}
|
|
|
|
@DexIgnore
|
|
public String getUserNameWithDiscriminator() {
|
|
return null;
|
|
}
|
|
|
|
//end of showtag patch
|
|
|
|
@DexIgnore
|
|
@Override
|
|
public void assignField(JsonReader jsonReader) throws IOException {
|
|
|
|
}
|
|
} |