Imports:
Code:
import org.javacord.api.entity.channel.TextChannel;
import com.vencillio.GameDataLoader;
Under this bit of code:
Code:
paramPlayer.getClient().queueOutgoingPacket(new SendString("Leave chat", 18135));
paramPlayer.getClient().queueOutgoingPacket(new SendString("</col>Talking in: <col=FFFF64><shad=0>" + getTitle(), 18139));
paramPlayer.getClient().queueOutgoingPacket(new SendString("</col>Owner: <col=FFFF64><shad=0>" + Utility.formatPlayerName(getFounder()), 18140));
paramPlayer.getClient().queueOutgoingPacket(new SendMessage("Attempting to join clan channel..."));
paramPlayer.getClient().queueOutgoingPacket(new SendMessage("Now talking in clan chat <col=FFFF64><shad=0>" + getTitle() + "</shad></col>."));
paramPlayer.getClient().queueOutgoingPacket(new SendMessage("To talk, start each line of chat with the / symbol."));
updateMembers();
Add this bit of code and change "OWNER OF CLAN" to the owner of the clan chat you want discord messages sent to and from, and change "DISCORD CLAN CHANNEL ID" to the id of the clan channel on discord.
Code:
if (this.founder.equalsIgnoreCase("OWNER OF CLAN")) {
//discord
Player player = paramPlayer;
TextChannel channel = (TextChannel) GameDataLoader.discord.getChannelById("DISCORD CLAN CHANNEL ID").get();
String ts = "";
ts = ts + player.getUsername()+" has joined the clan chat.";
channel.sendMessage("**"+ts+"**");
}
Under this bit of code:
Code:
public void removeMember(Player paramPlayer) {
for (int i = 0; i < this.activeMembers.size(); i++) {
if (this.activeMembers.get(i).equalsIgnoreCase(paramPlayer.getUsername())) {
Add this bit of code and change "OWNER OF CLAN" to the owner of the clan chat you want discord messages sent to and from, and change "DISCORD CLAN CHANNEL ID" to the id of the clan channel on discord.
Code:
if (this.founder.equalsIgnoreCase("OWNER OF CLAN")) {
//discord
Player player = paramPlayer;
TextChannel channel = (TextChannel) GameDataLoader.discord.getChannelById("DISCORD CLAN CHANNEL ID").get();
String ts = "";
ts = ts + player.getUsername()+" has left the clan chat.";
channel.sendMessage("**"+ts+"**");
}
Under this bit of code:
Code:
public void removeMember(String paramString) {
for (int i = 0; i < this.activeMembers.size(); i++) {
if (this.activeMembers.get(i).equalsIgnoreCase(paramString)) {
Player localPlayer = World.getPlayerByName(paramString);
if (localPlayer != null) {
Add this bit of code and change "OWNER OF CLAN" to the owner of the clan chat you want discord messages sent to and from, and change "DISCORD CLAN CHANNEL ID" to the id of the clan channel on discord.
Code:
if (this.founder.equalsIgnoreCase("OWNER OF CLAN")) {
//discord
Player player = localPlayer;
TextChannel channel = (TextChannel) GameDataLoader.discord.getChannelById("DISCORD CLAN CHANNEL ID").get();
String ts = "";
ts = ts + player.getUsername()+" has left the help chat.";
channel.sendMessage("**"+ts+"**");
}
Under this bit of code:
Code:
if (paramPlayer.isMuted()) {
if (paramPlayer.getMuteLength() == -1) {
paramPlayer.send(new SendMessage("You are permanently muted on this account."));
return;
} else {
long muteHours = TimeUnit.MILLISECONDS.toMinutes(paramPlayer.getMuteLength() - System.currentTimeMillis());
String timeUnit = "hour" + (muteHours > 1 ? "s" : "");
if (muteHours < 60) {
if (muteHours <= 0) {
paramPlayer.send(new SendMessage("Your mute has been lifted!"));
paramPlayer.setMuted(false);
}
timeUnit = "minute" + (muteHours > 1 ? "s" : "");
} else {
muteHours = TimeUnit.MINUTES.toHours(muteHours);
}
if (paramPlayer.isMuted()) {
paramPlayer.send(new SendMessage("You are muted, you will be unmuted in " + muteHours + " " + timeUnit + "."));
return;
}
}
}
Add this bit of code and change "OWNER OF CLAN" to the owner of the clan chat you want discord messages sent to and from, and change "DISCORD CLAN CHANNEL ID" to the id of the clan channel on discord.
Code:
if (this.founder.equalsIgnoreCase("OWNER OF CLAN")) {
//discord
Player player = paramPlayer;
TextChannel channel = (TextChannel) GameDataLoader.discord.getChannelById("DISCORD CLAN CHANNEL ID").get();
String ts = "";
ts = ts + player.getUsername()+": ";
channel.sendMessage("**"+ts+"**"+"`"+paramString+"`");
}