mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-25 20:41:21 -05:00
TextArt: maxWords config for text to figlets
This commit is contained in:
parent
7226e2c377
commit
ab91d62b2a
@ -93,5 +93,8 @@ conf.registerChannelValue(TextArt, 'bg',
|
||||
conf.registerChannelValue(TextArt, 'maxLength',
|
||||
registry.Integer(20, _("""Set the maximum character length for text to figlet inputs""")))
|
||||
|
||||
conf.registerChannelValue(TextArt, 'maxWords',
|
||||
registry.Integer(4, _("""Set the maximum number of words 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""")))
|
||||
|
@ -419,6 +419,10 @@ class TextArt(callbacks.Plugin):
|
||||
channel = msg.args[0]
|
||||
if len(text) > self.registryValue('maxLength', msg.channel):
|
||||
return
|
||||
if len(text.split(' ')) > self.registryValue('maxWords', msg.channel):
|
||||
return
|
||||
elif len(text.split('|')) > self.registryValue('maxWords', msg.channel):
|
||||
return
|
||||
optlist = dict(optlist)
|
||||
font = None
|
||||
words = []
|
||||
@ -1016,6 +1020,8 @@ class TextArt(callbacks.Plugin):
|
||||
return
|
||||
if len(text) > self.registryValue('maxLength', msg.channel):
|
||||
return
|
||||
if len(text.split(' ')) > self.registryValue('maxWords', msg.channel):
|
||||
return
|
||||
optlist = dict(optlist)
|
||||
opts = ''
|
||||
if 'f' in optlist:
|
||||
@ -1076,6 +1082,8 @@ class TextArt(callbacks.Plugin):
|
||||
return
|
||||
if len(text) > self.registryValue('maxLength', msg.channel):
|
||||
return
|
||||
if len(text.split(' ')) > self.registryValue('maxWords', msg.channel):
|
||||
return
|
||||
optlist = dict(optlist)
|
||||
opts = ''
|
||||
if 'f' in optlist:
|
||||
|
Loading…
x
Reference in New Issue
Block a user