mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-25 10:00:48 +01:00
Added mores group and instant.
This commit is contained in:
parent
0fcb77243e
commit
2a611309a7
@ -618,7 +618,7 @@ class IrcObjectProxy(RichReplyMethods):
|
|||||||
else:
|
else:
|
||||||
s = ircutils.safeArgument(s)
|
s = ircutils.safeArgument(s)
|
||||||
allowedLength = 450 - len(self.irc.prefix)
|
allowedLength = 450 - len(self.irc.prefix)
|
||||||
maximumMores = conf.supybot.reply.maximumMores()
|
maximumMores = conf.supybot.reply.mores.maximum()
|
||||||
maximumLength = allowedLength * maximumMores
|
maximumLength = allowedLength * maximumMores
|
||||||
if len(s) > maximumLength:
|
if len(s) > maximumLength:
|
||||||
log.warning('Truncating to %s bytes from %s bytes',
|
log.warning('Truncating to %s bytes from %s bytes',
|
||||||
@ -641,6 +641,16 @@ class IrcObjectProxy(RichReplyMethods):
|
|||||||
return
|
return
|
||||||
msgs = ircutils.wrap(s, allowedLength-30) # -30 is for nick:
|
msgs = ircutils.wrap(s, allowedLength-30) # -30 is for nick:
|
||||||
msgs.reverse()
|
msgs.reverse()
|
||||||
|
instant = conf.supybot.reply.mores.instant()
|
||||||
|
while instant > 1 and msgs:
|
||||||
|
instant -= 1
|
||||||
|
response = msgs.pop()
|
||||||
|
self.irc.queueMsg(reply(msg, response, to=self.to,
|
||||||
|
notice=self.notice,
|
||||||
|
private=self.private,
|
||||||
|
prefixName=self.prefixName))
|
||||||
|
if not msgs:
|
||||||
|
return
|
||||||
response = msgs.pop()
|
response = msgs.pop()
|
||||||
if msgs:
|
if msgs:
|
||||||
n = ircutils.bold('(%s)')
|
n = ircutils.bold('(%s)')
|
||||||
|
@ -284,10 +284,17 @@ registerChannelValue(supybot.reply, 'truncate',
|
|||||||
messages instead of breaking up long messages and using the 'more' command
|
messages instead of breaking up long messages and using the 'more' command
|
||||||
to get the remaining chunks."""))
|
to get the remaining chunks."""))
|
||||||
|
|
||||||
registerChannelValue(supybot.reply, 'maximumMores',
|
registerGroup(supybot.reply, 'mores')
|
||||||
|
registerChannelValue(supybot.reply.mores, 'maximum',
|
||||||
registry.PositiveInteger(50, """Determines what the maximum number of
|
registry.PositiveInteger(50, """Determines what the maximum number of
|
||||||
chunks (for use with the 'more' command) will be."""))
|
chunks (for use with the 'more' command) will be."""))
|
||||||
|
|
||||||
|
registerChannelValue(supybot.reply.mores, 'instant',
|
||||||
|
registry.PositiveInteger(1, """Determines how many mores will be sent
|
||||||
|
instantly (i.e., without the use of the more command, immediately when
|
||||||
|
they are formed). Defaults to 1, which means that a more command will be
|
||||||
|
required for all but the first chunk."""))
|
||||||
|
|
||||||
registerGlobalValue(supybot.reply, 'oneToOne',
|
registerGlobalValue(supybot.reply, 'oneToOne',
|
||||||
registry.Boolean(True, """Determines whether the bot will send
|
registry.Boolean(True, """Determines whether the bot will send
|
||||||
multi-message replies in a single messsage or in multiple messages. For
|
multi-message replies in a single messsage or in multiple messages. For
|
||||||
|
Loading…
x
Reference in New Issue
Block a user