• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GuildMemberNickChangeEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.dv8tion.jda.core.events.guild.member.GuildMemberNickChangeEvent的典型用法代码示例。如果您正苦于以下问题:Java GuildMemberNickChangeEvent类的具体用法?Java GuildMemberNickChangeEvent怎么用?Java GuildMemberNickChangeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GuildMemberNickChangeEvent类属于net.dv8tion.jda.core.events.guild.member包,在下文中一共展示了GuildMemberNickChangeEvent类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onGuildMemberNickChange

import net.dv8tion.jda.core.events.guild.member.GuildMemberNickChangeEvent; //导入依赖的package包/类
@Override
public void onGuildMemberNickChange(GuildMemberNickChangeEvent e) {
	if (!Bot.isReady)
		return;
	GuildObject g = GuildObject.guildMap.get(e.getGuild().getId());
	EmbedBuilder em = new EmbedBuilder();
	em.setColor(Color.CYAN)
	.setTimestamp(Instant.now());

	if (!g.getSpecialChannels().getLog().equals("")) {
		if (e.getPrevNick() != null && e.getNewNick() != null) {
			em.setDescription("**" + e.getPrevNick() + "** to **" + e.getNewNick() + "**");
			em.setAuthor(e.getMember().getUser().getName() + " changed their nickname",
					null, e.getMember().getUser().getAvatarUrl());
		} else if (e.getPrevNick() != null && e.getNewNick() == null) {
			em.setDescription("**" + e.getPrevNick() + "** to **" + e.getMember().getUser().getName() + "**");
			em.setAuthor(e.getMember().getUser().getName() + " removed their nickname",
					null, e.getMember().getUser().getAvatarUrl());
		} else {
			em.setDescription("**" + e.getMember().getUser().getName() + "** to **" + e.getNewNick() + "**");
			em.setAuthor(e.getMember().getUser().getName() + " added a nickname", null, 
					e.getMember().getUser().getAvatarUrl());
		}
		MessageUtils.sendMessage(g.getSpecialChannels().getLog(), em.build());
	}
}
 
开发者ID:paul-io,项目名称:momo-2,代码行数:27,代码来源:Listeners.java


示例2: onGuildMemberNickChange

import net.dv8tion.jda.core.events.guild.member.GuildMemberNickChangeEvent; //导入依赖的package包/类
@Override
public void onGuildMemberNickChange(GuildMemberNickChangeEvent event)
{
    // Ignore from other servers
    if ( !event.getGuild().getId().contentEquals(guildId) )
        return;

    String oldNick = event.getPrevNick();
    String newNick = event.getNewNick();

    // Adding or removing a nickname means one or the other is null
    if (oldNick == null) oldNick = event.getMember().getUser().getName();
    if (newNick == null) newNick = event.getMember().getUser().getName();

    LOG.trace("{} changed nick to {}", oldNick, newNick);
    BRIDGE.onDiscordNickChange(oldNick, newNick);
}
 
开发者ID:Gamealition,项目名称:JDiscordIRC,代码行数:18,代码来源:DiscordManager.java


示例3: onGuildMemberNickChange

import net.dv8tion.jda.core.events.guild.member.GuildMemberNickChangeEvent; //导入依赖的package包/类
@Override
public void onGuildMemberNickChange(GuildMemberNickChangeEvent event) {
    TextChannel log = getLog(event.getGuild());
    log.sendMessage(new MessageBuilder()
            .append(event.getMember().getAsMention())
            .append(" hat seinen Nickname verändert.")
            .setEmbed(new EmbedBuilder()
                    .addField("Von", event.getPrevNick() != null ? event.getPrevNick() : event.getUser().getName(), true)
                    .addField("Zu", event.getNewNick() != null ? event.getNewNick() : event.getUser().getName(), true)
                    .setColor(Color.lightGray)
                    .build())
            .build()).queue();
}
 
开发者ID:michidk,项目名称:GGD-Discord-Bot,代码行数:14,代码来源:LogFeature.java


示例4: onGuildMemberNickChange

import net.dv8tion.jda.core.events.guild.member.GuildMemberNickChangeEvent; //导入依赖的package包/类
@Override
public final void onGuildMemberNickChange(GuildMemberNickChangeEvent event) {
    Standard.log(Instant.now(), event.getGuild(), LOG_NAME, LOG_CHANNEL_ID_MEMBER, LOG_TEXT_MEMBER_NICK_CHANGE, "[%1$s] [%2$s] %3$s changed his Nickname from \"%4$s\" to \"%5$s\"", LOG_DATE_TIME_FORMAT, Config.CONFIG.getUserNameForUser(event.getUser(), event.getGuild(), true), event.getPrevNick(), event.getNewNick());
}
 
开发者ID:Panzer1119,项目名称:Supreme-Bot,代码行数:5,代码来源:GuildMemberLogger.java


示例5: onGuildMemberNickChange

import net.dv8tion.jda.core.events.guild.member.GuildMemberNickChangeEvent; //导入依赖的package包/类
@Override
public void onGuildMemberNickChange(final GuildMemberNickChangeEvent event) {
    onMemberEvent(event);
}
 
开发者ID:napstr,项目名称:SqlSauce,代码行数:5,代码来源:UserMemberCachingListener.java


示例6: onGuildMemberNickChange

import net.dv8tion.jda.core.events.guild.member.GuildMemberNickChangeEvent; //导入依赖的package包/类
@Override
public void onGuildMemberNickChange(GuildMemberNickChangeEvent event) {
    mentionPatternCache.remove(event.getMember());
}
 
开发者ID:Scarsz,项目名称:DiscordSRV,代码行数:5,代码来源:DiscordUtil.java



注:本文中的net.dv8tion.jda.core.events.guild.member.GuildMemberNickChangeEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Parameters类代码示例发布时间:2022-05-23
下一篇:
Java JavaException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap