Removed unecessary breaks.
This commit is contained in:
parent
887ab8c959
commit
f16508dae4
1 changed files with 8 additions and 15 deletions
|
@ -90,36 +90,29 @@ class View : AbstractCommand() {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var entry: EntryLink
|
var entry: EntryLink
|
||||||
var sent = 0
|
var sent = 0
|
||||||
while (i < max) {
|
while (i < max && sent < maxEntries) {
|
||||||
entry = getEntry(i)
|
entry = getEntry(i)
|
||||||
if (lcArgs.isNotEmpty()) {
|
if (lcArgs.isNotEmpty()) {
|
||||||
if (entry.link.toLowerCase().contains(lcArgs)
|
if (entry.link.toLowerCase().contains(lcArgs)
|
||||||
|| entry.title.toLowerCase().contains(lcArgs)
|
|| entry.title.toLowerCase().contains(lcArgs)
|
||||||
|| entry.nick.toLowerCase().contains(lcArgs)) {
|
|| entry.nick.toLowerCase().contains(lcArgs)) {
|
||||||
if (sent > maxEntries) {
|
|
||||||
bot.send(
|
|
||||||
sender, "To view more, try: "
|
|
||||||
+ Utils.bold("${bot.nick}: $command ${i + 1} $lcArgs")
|
|
||||||
)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
bot.send(sender, EntriesUtils.buildLink(i, entry, true))
|
bot.send(sender, EntriesUtils.buildLink(i, entry, true))
|
||||||
sent++
|
sent++
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (sent > maxEntries) {
|
|
||||||
bot.send(
|
|
||||||
sender,
|
|
||||||
"To view more, try: " + Utils.bold("${bot.nick}: $command ${i + 1}")
|
|
||||||
)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
bot.send(sender, EntriesUtils.buildLink(i, entry, true))
|
bot.send(sender, EntriesUtils.buildLink(i, entry, true))
|
||||||
sent++
|
sent++
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
|
if (sent == maxEntries) {
|
||||||
|
bot.send(
|
||||||
|
sender,
|
||||||
|
"To view more, try: " + Utils.bold("${bot.nick}: $command ${i + 1} $lcArgs")
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bot.send(sender, "There is currently nothing to view. Why don't you post something?")
|
bot.send(sender, "There is currently nothing to view. Why don't you post something?")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue