mirror of https://github.com/bvn13/JIrcBot.git
improved. if top all size > 10 - sending in private
parent
b452655832
commit
e533e3c68b
|
@ -89,12 +89,22 @@ public class StatisticsListener extends ImprovedListenerAdapter {
|
|||
event.respondChannel("Statistics is empty now");
|
||||
return;
|
||||
}
|
||||
|
||||
if (statistics.size() > 10) {
|
||||
event.respondPrivateMessage("TOP for all over time:");
|
||||
|
||||
for (int i = 0; i < statistics.size(); i++) {
|
||||
StatisticsDTO stats = statistics.get(i);
|
||||
event.respondPrivateMessage("" + (i + 1) + ". " + stats.getUsername() + " - " + stats.getCount());
|
||||
}
|
||||
} else {
|
||||
event.respondChannel("TOP for all over time:");
|
||||
|
||||
for (int i = 0; i < statistics.size(); i++) {
|
||||
StatisticsDTO stats = statistics.get(i);
|
||||
event.respondChannel("" + (i + 1) + ". " + stats.getUsername() + " - " + stats.getCount());
|
||||
}
|
||||
}
|
||||
|
||||
} else if (commands.length == 3) {
|
||||
|
||||
|
@ -113,12 +123,22 @@ public class StatisticsListener extends ImprovedListenerAdapter {
|
|||
event.respondChannel("Statistics for "+periodInfo.period+" is empty now");
|
||||
return;
|
||||
}
|
||||
|
||||
if (statistics.size() > 10) {
|
||||
event.respondPrivateMessage("TOP for " + periodInfo.period + ":");
|
||||
|
||||
for (int i = 0; i < statistics.size(); i++) {
|
||||
StatisticsDTO stats = statistics.get(i);
|
||||
event.respondPrivateMessage("" + (i + 1) + ". " + stats.getUsername() + " - " + stats.getCount());
|
||||
}
|
||||
} else {
|
||||
event.respondChannel("TOP for " + periodInfo.period + ":");
|
||||
|
||||
for (int i = 0; i < statistics.size(); i++) {
|
||||
StatisticsDTO stats = statistics.get(i);
|
||||
event.respondChannel("" + (i + 1) + ". " + stats.getUsername() + " - " + stats.getCount());
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
sendHelp(event);
|
||||
|
|
Loading…
Reference in New Issue