29 lines
709 B
Python
29 lines
709 B
Python
import functools
|
|
|
|
from sopel_SpiceBot_Core_1 import sb
|
|
|
|
|
|
def pipe_split():
|
|
"""
|
|
This splits the given command by ` | ` and re-dispatches it internally to the bot.
|
|
This allows the output of a command to be sent
|
|
"""
|
|
|
|
def actual_decorator(function):
|
|
|
|
@functools.wraps(function)
|
|
def internal_pipe_split(bot, trigger, comrun, *args, **kwargs):
|
|
|
|
bot.say("pipe_split")
|
|
|
|
# Get list of trigger command(s)
|
|
pipes = sb.commands.get_commands_split(trigger, "|")
|
|
bot.say(str(pipes))
|
|
|
|
function(bot, trigger, comrun, *args, **kwargs)
|
|
|
|
print(comrun.test)
|
|
|
|
return internal_pipe_split
|
|
return actual_decorator
|