Added supybot.reply.maximumMores.

This commit is contained in:
Jeremy Fincher 2004-04-05 17:36:17 +00:00
parent ce75589c6d
commit 93f64b6a68
3 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,10 @@
* Added supybot.reply.truncate, to turn off the normal more'ing
of replies.
* Added supybot.reply.maximumMores, to give users the ability to
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
the bot even take revenge on #channel,ops who try to violate the

View File

@ -567,9 +567,11 @@ class IrcObjectProxy(RichReplyMethods):
else:
s = ircutils.safeArgument(s)
allowedLength = 450 - len(self.irc.prefix)
if len(s) > allowedLength*50:
log.warning('Cowardly refusing to "more" %s bytes.'%len(s))
s = s[:allowedLength*50]
maximumLength = allowedLength*conf.supybot.reply.maximumMores()
if len(s) > maximumLength:
log.warning('Truncating to %s bytes from %s bytes',
maximumLength, len(s))
s = s[:maximumLength]
if len(s) < allowedLength or conf.supybot.reply.truncate():
s = s[:allowedLength+20] # In case we're truncating.
self.irc.queueMsg(reply(msg, s, self.prefixName,

View File

@ -193,6 +193,9 @@ supybot.register('reply')
supybot.reply.register('truncate', registry.Boolean(False, """Determines
whether the bot will simply truncate messages instead of breaking up long
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
the bot will send multi-message replies in a single messsage or in multiple