当前位置: 首页>>代码示例>>Java>>正文


Java IUser.getDiscriminator方法代码示例

本文整理汇总了Java中sx.blah.discord.handle.obj.IUser.getDiscriminator方法的典型用法代码示例。如果您正苦于以下问题:Java IUser.getDiscriminator方法的具体用法?Java IUser.getDiscriminator怎么用?Java IUser.getDiscriminator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sx.blah.discord.handle.obj.IUser的用法示例。


在下文中一共展示了IUser.getDiscriminator方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: asContent

import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
@Override
public String asContent(Map<String, Object> dataMap) {
    String guildSpec = (String) dataMap.get("guilds");
    List<String> guilds = null;
    if (guildSpec != null) {
        guilds = Arrays.asList(guildSpec.split("[,;]"));
    }
    if (guilds == null) {
        return null;
    }
    if (guilds.contains(getSource().getGuild().getStringID())) {
        IUser user = getSource().getUser();
     String imagesSpec = (String) dataMap.get("images");
     String image = "";
     if (imagesSpec != null) {
      String[] images = imagesSpec.split(";");
      image = "\n" + images[random.nextInt(images.length)];
     }
     String emojiSpec = (String) dataMap.get("emoji");
     String emoji = emoji("angel");
     if (emojiSpec != null) {
      String[] emojis = emojiSpec.split(";");
      emoji = "\n" + emojis[random.nextInt(emojis.length)];
      if (emoji.startsWith("alias:")) {
       emoji = emoji(emoji);
      }
     }
        return user.getName() + "#" + user.getDiscriminator() + " " + emoji + image;
    } else {
        return null;
    }
}
 
开发者ID:quanticc,项目名称:sentry,代码行数:33,代码来源:UserPardonedEvent.java

示例2: asContent

import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
@Override
public String asContent(Map<String, Object> dataMap) {
    String guildSpec = (String) dataMap.get("guilds");
    List<String> guilds = null;
    if (guildSpec != null) {
        guilds = Arrays.asList(guildSpec.split("[,;]"));
    }
    if (guilds == null) {
        return null;
    }
    if (guilds.contains(getSource().getGuild().getStringID())) {
        IUser user = getSource().getUser();
        String imagesSpec = (String) dataMap.get("images");
        String image = "";
        if (imagesSpec != null) {
            String[] images = imagesSpec.split(";");
            image = "\n" + images[random.nextInt(images.length)];
        }
        String emojiSpec = (String) dataMap.get("emoji");
     String emoji = emoji("hammer");
     if (emojiSpec != null) {
      String[] emojis = emojiSpec.split(";");
      emoji = "\n" + emojis[random.nextInt(emojis.length)];
      if (emoji.startsWith("alias:")) {
      	emoji = emoji(emoji);
      }
     }
        return user.getName() + "#" + user.getDiscriminator() + " " + emoji + image;
    } else {
        return null;
    }
}
 
开发者ID:quanticc,项目名称:sentry,代码行数:33,代码来源:UserBannedEvent.java

示例3: Songs

import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public Songs(Track track) {
    title = track.getTrack().getInfo().title;
    identifier = track.getTrack().getIdentifier();
    requester = track.getMeta().getOrDefault("requester", "dick").toString();
    length = track.getTrack().getDuration();
    progress = track.getTrack().getPosition();
    IUser user = FlareBot.getInstance().getClient().getUserByID(requester);
    if (user != null) {
        discrim = user.getDiscriminator();
        name = user.getName();
        if (user.getAvatar() != null)
            avatar = user.getAvatarURL();
    }
}
 
开发者ID:ArsenArsen,项目名称:FlareBot,代码行数:15,代码来源:Songs.java

示例4: getTag

import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static String getTag(IUser user) {
    return user.getName() + '#' + user.getDiscriminator();
}
 
开发者ID:ArsenArsen,项目名称:FlareBot,代码行数:4,代码来源:MessageUtils.java

示例5: convertUser

import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static String convertUser(IUser user) {
	return user.getName() + "#" + user.getDiscriminator() + " (" + user.getID() + ")";
}
 
开发者ID:chrislo27,项目名称:Baristron,代码行数:4,代码来源:ModLog.java

示例6: getUserTag

import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static String getUserTag (IUser user) {

        return user.getName() + "#" + user.getDiscriminator();
    }
 
开发者ID:MinecraftModDevelopment,项目名称:MMDBot,代码行数:5,代码来源:Utilities.java


注:本文中的sx.blah.discord.handle.obj.IUser.getDiscriminator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。