mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-18 16:12:42 +01:00
Success: Allow the plugin to be loaded from a query
Closes: Sf#3513915 Signed-off-by: James McCoy <jamessan@users.sourceforge.net> Conflicts: plugins/Success/plugin.py
This commit is contained in:
parent
1fdf3688e9
commit
198e525606
@ -49,7 +49,7 @@ class Success(plugins.ChannelIdDatabasePlugin):
|
|||||||
self.originalClass = conf.supybot.replies.success.__class__
|
self.originalClass = conf.supybot.replies.success.__class__
|
||||||
class MySuccessClass(self.originalClass):
|
class MySuccessClass(self.originalClass):
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
ret = pluginSelf.db.random(pluginSelf.target or 'private_query')
|
ret = pluginSelf.db.random(dynamic.msg.args[0])
|
||||||
if ret is None:
|
if ret is None:
|
||||||
try:
|
try:
|
||||||
self.__class__ = pluginSelf.originalClass
|
self.__class__ = pluginSelf.originalClass
|
||||||
@ -70,14 +70,8 @@ class Success(plugins.ChannelIdDatabasePlugin):
|
|||||||
self.__parent.die()
|
self.__parent.die()
|
||||||
conf.supybot.replies.success.__class__ = self.originalClass
|
conf.supybot.replies.success.__class__ = self.originalClass
|
||||||
|
|
||||||
def inFilter(self, irc, msg):
|
|
||||||
# We need the target, but we need it before Owner.doPrivmsg is called,
|
|
||||||
# so this seems like the only way to do it.
|
|
||||||
self.target = msg.args[0]
|
|
||||||
return msg
|
|
||||||
Success = internationalizeDocstring(Success)
|
Success = internationalizeDocstring(Success)
|
||||||
|
|
||||||
Class = Success
|
Class = Success
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 softtabstop=8 expandtab textwidth=78:
|
# vim:set shiftwidth=4 softtabstop=8 expandtab textwidth=78:
|
||||||
|
Loading…
Reference in New Issue
Block a user