本文整理汇总了Java中org.pircbotx.Colors.DARK_GREEN属性的典型用法代码示例。如果您正苦于以下问题:Java Colors.DARK_GREEN属性的具体用法?Java Colors.DARK_GREEN怎么用?Java Colors.DARK_GREEN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.pircbotx.Colors
的用法示例。
在下文中一共展示了Colors.DARK_GREEN属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prism
public static String prism(char c, int number) {
String result = null;
System.out.println(number);
switch (number) {
case 1:
result = Colors.RED + c;
break;
case 2:
result = Colors.YELLOW + c;
break;
case 3:
result = Colors.DARK_GREEN + c;
break;
case 4:
result = Colors.CYAN + c;
break;
case 5:
result = Colors.BLUE + c;
break;
case 6:
result = Colors.MAGENTA + c;
break;
}
return result;
}
示例2: onMessage
@Override
public void onMessage(MessageEvent event) throws Exception {
String msg = event.getMessage();
if (msg.startsWith(Helix.botPrefix + Commands.youTubeSearch) && ((msg.length() > (Commands.youTubeSearch.length()+2) && msg.charAt(Commands.youTubeSearch.length()+1) == ' ') || (msg.length() > (Commands.youTubeSearch.length()+3) && Arrays.asList(Helix.valid).contains(msg.charAt(Commands.youTubeSearch.length()+1)) && msg.charAt(Commands.youTubeSearch.length()+2) == ' '))){
String q = msg.split(" ", 2)[1];
String max = msg.charAt(3) == ' ' ? "1" : String.valueOf(msg.charAt(3));
String a = String.format("https://www.googleapis.com/youtube/v3/search?part=id&maxResults=%s®ionCode=br&type=video&q=%s&key=%s", max, URLEncoder.encode(q, "UTF-8"), Helix.properties.get("google.apikey"));
JSONObject v;
JSONObject snip;
String views;
String dislike;
String like;
String len;
String m;
try {
v = new JSONObject(Util.getHTTPResponse(String.format("https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,statistics&id=%s&key=%s", (new JSONObject(Util.getHTTPResponse(a))).getJSONArray("items").getJSONObject(Integer.valueOf(max) - 1).getJSONObject("id").getString("videoId"), Helix.properties.get("google.apikey")))).getJSONArray("items").getJSONObject(0);
snip = v.getJSONObject("snippet");
JSONObject stat = v.getJSONObject("statistics");
views = Helix.numberFormat.format(Long.parseLong(stat.getString("viewCount")));
dislike = Helix.numberFormat.format(Integer.parseInt(stat.getString("dislikeCount")));
like = Helix.numberFormat.format(Integer.parseInt(stat.getString("likeCount")));
len = v.getJSONObject("contentDetails").getString("duration");
m = Colors.BOLD + Colors.BLACK + ",00[You" + Colors.WHITE + ",04Tube]" + Colors.NORMAL + " " + snip.getString("title") + " [" + Colors.OLIVE + (len.equals("PT0S")? "Live" : Util.parseYouTubeTime(len)) + Colors.NORMAL + "] [" + Colors.TEAL + views + Colors.NORMAL + "] [" + Colors.DARK_GREEN + "+" + like + Colors.NORMAL + "] [" + Colors.RED + "-" + dislike + Colors.NORMAL + "] [" + Colors.MAGENTA + snip.getString("channelTitle") + Colors.NORMAL + "] http://youtu.be/" + v.getString("id");
} catch (JSONException e){
m = "Video not found! \"" + Colors.BOLD + q + Colors.NORMAL + "\"";
}
event.getChannel().send().message(m);
}
}
示例3: determineColor
private String determineColor(ItemClass color2) {
switch(color2) {
case Normal: case Newbie: return Colors.NORMAL;
case Animal: return Colors.BOLD + Colors.BROWN;
case Spiritual: return Colors.BOLD + Colors.BLUE;
case Saint: return Colors.BOLD + Colors.DARK_BLUE;
case Avatar: return Colors.BOLD + Colors.DARK_GREEN;
case Special: return Colors.BOLD + Colors.PURPLE;
case Retro: return Colors.BOLD + Colors.BLACK;
case Idle: return Colors.BOLD + Colors.MAGENTA;
}
return Colors.MAGENTA;
}
示例4: modifyMessage
private String modifyMessage(String string, Player p, int i, boolean isGood) {
String message = (isGood ? Colors.DARK_GREEN : Colors.RED) + string.replaceAll("%player", p.getName()).replaceAll("%money", ""+i);
return Event.replaceGender(message, p);
}
示例5: modifyMessage
private String modifyMessage(String string, Player p, Item i, boolean isGood) {
String message = (isGood ? Colors.DARK_GREEN : Colors.RED) + Event.replaceGender(string.replaceAll("%player", p.getName()).replaceAll("%item", i.getName()), p);
message += " ["+i.getValue()+"->"+Math.round(i.getValue()*(isGood ? 1.1 : 0.9))+"]";
return message;
}