mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-29 23:11:09 -05:00
TextArt: maxLength config for text to figlets
This commit is contained in:
parent
3ee4f502ec
commit
7226e2c377
@ -90,5 +90,8 @@ registry.Integer(99, _("""Set the default foreground color for ascii art images.
|
||||
conf.registerChannelValue(TextArt, 'bg',
|
||||
registry.Integer(99, _("""Set the default background color for ascii art images. 0-98. 99 is disabled (default)""")))
|
||||
|
||||
conf.registerChannelValue(TextArt, 'maxLength',
|
||||
registry.Integer(20, _("""Set the maximum character length for text to figlet inputs""")))
|
||||
|
||||
conf.registerGlobalValue(TextArt, 'userAgents',
|
||||
registry.CommaSeparatedListOfStrings(["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0"], _("""Reported user agent when fetching links""")))
|
||||
|
@ -417,6 +417,8 @@ class TextArt(callbacks.Plugin):
|
||||
if not channel:
|
||||
channel = msg.args[0]
|
||||
channel = msg.args[0]
|
||||
if len(text) > self.registryValue('maxLength', msg.channel):
|
||||
return
|
||||
optlist = dict(optlist)
|
||||
font = None
|
||||
words = []
|
||||
@ -1012,6 +1014,8 @@ class TextArt(callbacks.Plugin):
|
||||
if channel != msg.args[0] and not ircdb.checkCapability(msg.prefix, 'admin'):
|
||||
irc.errorNoCapability('admin')
|
||||
return
|
||||
if len(text) > self.registryValue('maxLength', msg.channel):
|
||||
return
|
||||
optlist = dict(optlist)
|
||||
opts = ''
|
||||
if 'f' in optlist:
|
||||
@ -1070,6 +1074,8 @@ class TextArt(callbacks.Plugin):
|
||||
if channel != msg.args[0] and not ircdb.checkCapability(msg.prefix, 'admin'):
|
||||
irc.errorNoCapability('admin')
|
||||
return
|
||||
if len(text) > self.registryValue('maxLength', msg.channel):
|
||||
return
|
||||
optlist = dict(optlist)
|
||||
opts = ''
|
||||
if 'f' in optlist:
|
||||
|
Loading…
x
Reference in New Issue
Block a user