Added supybot.reply.maximumLength.

This commit is contained in:
Jeremy Fincher 2004-09-23 17:07:54 +00:00
parent 3740c74aa9
commit 72214dc9d0
2 changed files with 7 additions and 0 deletions

View File

@ -721,6 +721,9 @@ class IrcObjectProxy(RichReplyMethods):
if self.finalEvaled:
try:
if not isinstance(self.irc, irclib.Irc):
s = s[:conf.supybot.reply.maximumLength()]
if conf.get(supybot.reply.truncate, self.msg.args[0]):
s = s[:512]
self.irc.reply(s, to=self.to,
notice=self.notice,
action=self.action,

View File

@ -261,6 +261,10 @@ registerGlobalValue(supybot, 'channels',
###
registerGroup(supybot, 'reply')
registerGlobalValue(supybot.reply, 'maximumLength',
registry.Integer(512*256, """Determines the absolute maximum length of the
bot's reply -- no reply will passed through the bot greater than this."""))
registerChannelValue(supybot.reply, 'truncate',
registry.Boolean(False, """Determines whether the bot will simply truncate
messages instead of breaking up long messages and using the 'more' command