Added private Minecraft chat, Discord login, show message pinning, Maven project check, some of #12 #39
3 changed files with 5 additions and 4 deletions
|
@ -20,6 +20,7 @@ public abstract class DiscordCommandBase {
|
|||
commands.put("userinfo", new UserinfoCommand());
|
||||
commands.put("help", new HelpCommand());
|
||||
commands.put("role", new RoleCommand());
|
||||
commands.put("mcchat", new MCChatCommand());
|
||||
}
|
||||
|
||||
public static void runCommand(String cmd, String args, IMessage message) {
|
||||
|
|
|
@ -19,7 +19,7 @@ public class MCChatCommand extends DiscordCommandBase {
|
|||
}
|
||||
PlayerData<Boolean> mcchat = DiscordPlayer.getUser(message.getAuthor().getStringID(), DiscordPlayer.class)
|
||||
.minecraftChat();
|
||||
mcchat.set(!mcchat.get());
|
||||
mcchat.set(!mcchat.getOrDefault(false));
|
||||
message.reply("Minecraft chat " + (mcchat.get() ? "enabled." : "disabled."));
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
|
|||
final IUser iUser = data.channel.getUsersHere().stream()
|
||||
.filter(u -> u.getLongID() != u.getClient().getOurUser().getLongID()).findFirst().get(); // Doesn't support group DMs
|
||||
final DiscordPlayer user = DiscordPlayer.getUser(iUser.getStringID(), DiscordPlayer.class);
|
||||
if (user.minecraftChat().get() && e.shouldSendTo(getSender(data.channel, iUser, user)))
|
||||
if (user.minecraftChat().getOrDefault(false) && e.shouldSendTo(getSender(data.channel, iUser, user)))
|
||||
doit.accept(data);
|
||||
}
|
||||
} // TODO: Author URL
|
||||
|
@ -125,8 +125,8 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
|
|||
public void handle(MessageReceivedEvent event) {
|
||||
final IUser author = event.getMessage().getAuthor();
|
||||
if (!event.getMessage().getChannel().getStringID().equals(DiscordPlugin.chatchannel.getStringID())
|
||||
&& !(event.getMessage().getChannel().isPrivate()
|
||||
&& DiscordPlayer.getUser(author.getStringID(), DiscordPlayer.class).minecraftChat().get()))
|
||||
&& !(event.getMessage().getChannel().isPrivate() && DiscordPlayer
|
||||
.getUser(author.getStringID(), DiscordPlayer.class).minecraftChat().getOrDefault(false)))
|
||||
return;
|
||||
resetLastMessage();
|
||||
lastlist++;
|
||||
|
|
Loading…
Reference in a new issue