mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-22 18:14:41 +01:00
Added supybot.reply.maximumMores.
This commit is contained in:
parent
ce75589c6d
commit
93f64b6a68
@ -1,5 +1,10 @@
|
|||||||
* Added supybot.reply.truncate, to turn off the normal more'ing
|
* Added supybot.reply.maximumMores, to give users the ability to
|
||||||
of replies.
|
set the maximum number of "more" chunks replies will generate.
|
||||||
|
|
||||||
|
* Added supybot.reply.truncate, to turn off the normal chunking
|
||||||
|
of replies that later can be retrieved with the more command.
|
||||||
|
Setting this variable to On means that no chunks will ever be
|
||||||
|
created.
|
||||||
|
|
||||||
* Added supybot.plugins.Enforcer.takeRevengeOnOps, which makes
|
* Added supybot.plugins.Enforcer.takeRevengeOnOps, which makes
|
||||||
the bot even take revenge on #channel,ops who try to violate the
|
the bot even take revenge on #channel,ops who try to violate the
|
||||||
|
@ -567,9 +567,11 @@ 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)
|
||||||
if len(s) > allowedLength*50:
|
maximumLength = allowedLength*conf.supybot.reply.maximumMores()
|
||||||
log.warning('Cowardly refusing to "more" %s bytes.'%len(s))
|
if len(s) > maximumLength:
|
||||||
s = s[:allowedLength*50]
|
log.warning('Truncating to %s bytes from %s bytes',
|
||||||
|
maximumLength, len(s))
|
||||||
|
s = s[:maximumLength]
|
||||||
if len(s) < allowedLength or conf.supybot.reply.truncate():
|
if len(s) < allowedLength or conf.supybot.reply.truncate():
|
||||||
s = s[:allowedLength+20] # In case we're truncating.
|
s = s[:allowedLength+20] # In case we're truncating.
|
||||||
self.irc.queueMsg(reply(msg, s, self.prefixName,
|
self.irc.queueMsg(reply(msg, s, self.prefixName,
|
||||||
|
@ -193,6 +193,9 @@ supybot.register('reply')
|
|||||||
supybot.reply.register('truncate', registry.Boolean(False, """Determines
|
supybot.reply.register('truncate', registry.Boolean(False, """Determines
|
||||||
whether the bot will simply truncate messages instead of breaking up long
|
whether the bot will simply truncate messages instead of breaking up long
|
||||||
messages and using the 'more' command to get the remaining chunks."""))
|
messages and using the 'more' command to get the remaining chunks."""))
|
||||||
|
supybot.reply.register('maximumMores', registry.PositiveInteger(50, """
|
||||||
|
Determines what the maximum number of chunks (for use with the 'more' command)
|
||||||
|
will be."""))
|
||||||
|
|
||||||
supybot.reply.register('oneToOne', registry.Boolean(True, """Determines whether
|
supybot.reply.register('oneToOne', registry.Boolean(True, """Determines whether
|
||||||
the bot will send multi-message replies in a single messsage or in multiple
|
the bot will send multi-message replies in a single messsage or in multiple
|
||||||
|
Loading…
Reference in New Issue
Block a user