Search in sources :

Example 1 with TextChannel

use of gg.projecteden.utils.DiscordId.TextChannel in project Nexus by ProjectEdenGG.

the class IngameBridgeListener method onChannelChat.

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onChannelChat(PublicChatEvent event) {
    TextChannel discordTextChannel = event.getChannel().getDiscordTextChannel();
    if (discordTextChannel == null)
        return;
    Player player = event.getChatter().getOnlinePlayer();
    DiscordUser user = new DiscordUserService().get(player);
    RoleManager.update(user);
    Discord.send(user.getBridgeName() + " **>** " + discordize(parseMentions(event.getMessage())), discordTextChannel);
}
Also used : DiscordUser(gg.projecteden.nexus.models.discord.DiscordUser) TextChannel(gg.projecteden.utils.DiscordId.TextChannel) Player(org.bukkit.entity.Player) DiscordUserService(gg.projecteden.nexus.models.discord.DiscordUserService) EventHandler(org.bukkit.event.EventHandler)

Aggregations

DiscordUser (gg.projecteden.nexus.models.discord.DiscordUser)1 DiscordUserService (gg.projecteden.nexus.models.discord.DiscordUserService)1 TextChannel (gg.projecteden.utils.DiscordId.TextChannel)1 Player (org.bukkit.entity.Player)1 EventHandler (org.bukkit.event.EventHandler)1