From a2d2e9ef43e9b2e25e16d26c0553a3a0d0023647 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Wed, 29 May 2019 12:16:06 -0400 Subject: [PATCH] push osd --- sopel_modules/SpiceBot/Prerun.py | 26 ++--- sopel_modules/SpiceBot_AI/AI_Acknowledge.py | 4 +- sopel_modules/SpiceBot_AI/AI_Goodbye.py | 2 +- sopel_modules/SpiceBot_AI/AI_Love.py | 4 +- sopel_modules/SpiceBot_AI/AI_Ping.py | 2 +- sopel_modules/SpiceBot_AI/AI_Really.py | 2 +- sopel_modules/SpiceBot_AI/AI_Thanks.py | 2 +- sopel_modules/SpiceBot_AI/AI_Welcomeback.py | 2 +- .../NickQueryCommand.py | 12 +-- .../SpiceBot_CommandsQuery/QueryCommand.py | 12 +-- sopel_modules/SpiceBot_Logs/Logs_Command.py | 6 +- sopel_modules/SpiceBot_Logs/Queue.py | 2 +- sopel_modules/SpiceBot_Messaging/Messaging.py | 6 +- sopel_modules/SpiceBot_Restart/Restart.py | 2 +- sopel_modules/SpiceBot_Update/Update.py | 4 +- sopel_modules/SpiceBot_osd/__init__.py | 96 +------------------ 16 files changed, 45 insertions(+), 139 deletions(-) diff --git a/sopel_modules/SpiceBot/Prerun.py b/sopel_modules/SpiceBot/Prerun.py index a0cb4f3..dce2c5b 100644 --- a/sopel_modules/SpiceBot/Prerun.py +++ b/sopel_modules/SpiceBot/Prerun.py @@ -101,7 +101,7 @@ class BotPrerun(): if command_permissions_check(bot, trigger, ['admins', 'owner', 'OP', 'ADMIN', 'OWNER']): return True else: - bot.notice("The admin switch (-a) is for use by authorized nicks ONLY.") + bot.osd("The admin switch (-a) is for use by authorized nicks ONLY.", 'notice') return False # don't run commands that are disabled in channels @@ -118,9 +118,9 @@ class BotPrerun(): def trigger_cant_run(self, bot, trigger, message=None): if message: - bot.notice(message, trigger.nick) + bot.osd(message, trigger.nick, 'notice') if command_permissions_check(bot, trigger, ['admins', 'owner', 'OP', 'ADMIN', 'OWNER']): - bot.notice("You however are authorized to bypass this warning with the (-a) admin switch.", trigger.nick) + bot.osd("You however are authorized to bypass this warning with the (-a) admin switch.", trigger.nick, 'notice') return False def trigger_hyphen_args(self, trigger_args_part): @@ -146,48 +146,48 @@ class BotPrerun(): # Commands that cannot run via privmsg if trigger.sb["hyphen_arg"] in ['check']: if trigger.sb["com"].lower() != trigger.sb["realcom"]: - bot.say(trigger.sb["com"] + " is a valid alias command for " + trigger.sb["realcom"]) + bot.osd(trigger.sb["com"] + " is a valid alias command for " + trigger.sb["realcom"]) else: - bot.say(trigger.sb["com"] + " is a valid command") + bot.osd(trigger.sb["com"] + " is a valid command") return elif trigger.sb["hyphen_arg"] in ['enable']: if not command_permissions_check(bot, trigger, ['admins', 'owner', 'OP', 'ADMIN', 'OWNER']): - bot.say("I was unable to disable this command due to privilege issues.") + bot.osd("I was unable to disable this command due to privilege issues.") return if trigger.is_privmsg: - bot.notice("This command must be run in a channel you which to enable it in.", trigger.nick) + bot.osd("This command must be run in a channel you which to enable it in.", trigger.nick, 'notice') return if not commands.check_disabled_commands(bot, trigger.sb["realcom"], trigger.sender): - bot.notice(trigger.sb["com"] + " is already enabled in " + str(trigger.sender), trigger.nick) + bot.osd(trigger.sb["com"] + " is already enabled in " + str(trigger.sender), trigger.nick, 'notice') return commands.unset_command_disabled(bot, trigger.sb["realcom"], trigger.sender) - bot.say(trigger.sb["com"] + " is now enabled in " + str(trigger.sender)) + bot.osd(trigger.sb["com"] + " is now enabled in " + str(trigger.sender)) return elif trigger.sb["hyphen_arg"] in ['disable']: if not command_permissions_check(bot, trigger, ['admins', 'owner', 'OP', 'ADMIN', 'OWNER']): - bot.say("I was unable to disable this command due to privilege issues.") + bot.osd("I was unable to disable this command due to privilege issues.") return if trigger.is_privmsg: - bot.notice("This command must be run in a channel you which to disable it in.", trigger.nick) + bot.osd("This command must be run in a channel you which to disable it in.", trigger.nick, 'notice') return if commands.check_disabled_commands(bot, trigger.sb["realcom"], trigger.sender): - bot.notice(trigger.sb["com"] + " is already disabled in " + str(trigger.sender), trigger.nick) + bot.osd(trigger.sb["com"] + " is already disabled in " + str(trigger.sender), trigger.nick, 'notice') return trailingmessage = spicemanip.main(trigger.sb["args"], 0) or "No reason given." timestamp = str(datetime.datetime.utcnow()) commands.set_command_disabled(bot, trigger.sb["realcom"], trigger.sender, timestamp, trailingmessage, trigger.nick) - bot.say(trigger.sb["com"] + " is now disabled in " + str(trigger.sender)) + bot.osd(trigger.sb["com"] + " is now disabled in " + str(trigger.sender)) return return diff --git a/sopel_modules/SpiceBot_AI/AI_Acknowledge.py b/sopel_modules/SpiceBot_AI/AI_Acknowledge.py index e9e626e..50b1796 100644 --- a/sopel_modules/SpiceBot_AI/AI_Acknowledge.py +++ b/sopel_modules/SpiceBot_AI/AI_Acknowledge.py @@ -7,9 +7,9 @@ import sopel.module @sopel.module.rule('$nickname!') def exclaim(bot, trigger): - bot.say(trigger.nick + '!') + bot.osd(trigger.nick + '!') @sopel.module.rule('$nickname\?') def imhere(bot, trigger): - bot.say("I'm here, " + trigger.nick) + bot.osd("I'm here, " + trigger.nick) diff --git a/sopel_modules/SpiceBot_AI/AI_Goodbye.py b/sopel_modules/SpiceBot_AI/AI_Goodbye.py index 7f93bef..596da98 100644 --- a/sopel_modules/SpiceBot_AI/AI_Goodbye.py +++ b/sopel_modules/SpiceBot_AI/AI_Goodbye.py @@ -11,7 +11,7 @@ import spicemanip def bot_command_goodbye(bot, trigger): byemsg = spicemanip.main(['Bye', 'Goodbye', 'Seeya', 'Auf Wiedersehen', 'Au revoir', 'Ttyl'], "random") punctuation = spicemanip.main(['!', ''], "random") - bot.say(byemsg + ' ' + trigger.nick + punctuation) + bot.osd(byemsg + ' ' + trigger.nick + punctuation) @sopel.module.nickname_commands("bye", "goodbye", "gtg", "seeya", "cya", "ttyl", "g2g", "gnight", "goodnight") diff --git a/sopel_modules/SpiceBot_AI/AI_Love.py b/sopel_modules/SpiceBot_AI/AI_Love.py index 8674317..c43361c 100644 --- a/sopel_modules/SpiceBot_AI/AI_Love.py +++ b/sopel_modules/SpiceBot_AI/AI_Love.py @@ -7,7 +7,7 @@ import sopel.module @sopel.module.rule(r'(?i)(I love you|loveya),? $nickname[ \t]*$') def bot_command_love(bot, trigger): - bot.reply("I love you too.") + bot.osd(trigger.nick + ", I love you too.") @sopel.module.rule('$nickname (loveya|I love you)') @@ -27,7 +27,7 @@ def bot_command_love_d(bot, trigger): @sopel.module.rule(r'(?i)(I like you),? $nickname[ \t]*$') def bot_command_like(bot, trigger): - bot.reply("I like you too.") + bot.osd(trigger.nick + ", I like you too.") @sopel.module.rule('$nickname (I like you)') diff --git a/sopel_modules/SpiceBot_AI/AI_Ping.py b/sopel_modules/SpiceBot_AI/AI_Ping.py index 4931797..76b6ee4 100644 --- a/sopel_modules/SpiceBot_AI/AI_Ping.py +++ b/sopel_modules/SpiceBot_AI/AI_Ping.py @@ -7,7 +7,7 @@ import sopel.module @sopel.module.rule(r'(?i)(ping),? $nickname[ \t]*$') def bot_command_ping(bot, trigger): - bot.say("Pong") + bot.osd("Pong") @sopel.module.nickname_commands('ping') diff --git a/sopel_modules/SpiceBot_AI/AI_Really.py b/sopel_modules/SpiceBot_AI/AI_Really.py index 2a36402..162b828 100644 --- a/sopel_modules/SpiceBot_AI/AI_Really.py +++ b/sopel_modules/SpiceBot_AI/AI_Really.py @@ -10,7 +10,7 @@ import spicemanip @sopel.module.rule(r'(?i)(really),? $nickname\?') def bot_command_really(bot, trigger): really = spicemanip.main(["Yes, really.", "Really really"], "random") - bot.reply(really) + bot.osd(trigger.nick + ", " + really) @sopel.module.rule('$nickname really\?') diff --git a/sopel_modules/SpiceBot_AI/AI_Thanks.py b/sopel_modules/SpiceBot_AI/AI_Thanks.py index be80f7f..8babea3 100644 --- a/sopel_modules/SpiceBot_AI/AI_Thanks.py +++ b/sopel_modules/SpiceBot_AI/AI_Thanks.py @@ -7,7 +7,7 @@ import sopel.module @sopel.module.rule(r'(?i)(thank you|thanks),? $nickname[ \t]*$') def bot_command_thanks(bot, trigger): - bot.reply("You're welcome.") + bot.osd(trigger.nick + ",You're welcome.") @sopel.module.rule('$nickname (thank you)') diff --git a/sopel_modules/SpiceBot_AI/AI_Welcomeback.py b/sopel_modules/SpiceBot_AI/AI_Welcomeback.py index 334d8cb..b81f42c 100644 --- a/sopel_modules/SpiceBot_AI/AI_Welcomeback.py +++ b/sopel_modules/SpiceBot_AI/AI_Welcomeback.py @@ -10,4 +10,4 @@ import spicemanip @sopel.module.rule(r'(?i)(welcome back),? $nickname\?') def bot_command_really(bot, trigger): reply = spicemanip.main(['Thank you', 'thanks'], "random") - bot.reply(reply) + bot.osd(trigger.nick + ", " + reply) diff --git a/sopel_modules/SpiceBot_CommandsQuery/NickQueryCommand.py b/sopel_modules/SpiceBot_CommandsQuery/NickQueryCommand.py index 15f3498..11109fd 100644 --- a/sopel_modules/SpiceBot_CommandsQuery/NickQueryCommand.py +++ b/sopel_modules/SpiceBot_CommandsQuery/NickQueryCommand.py @@ -42,14 +42,14 @@ def query_detection_nick(bot, trigger): closestmatches = SpiceBot.similar_list(bot, trigger.sb['com'], list(commands_list.keys()), 10, 'reverse') if len(closestmatches): dispmsg.append("The following " + bot.nick + " commands match " + str(trigger.sb['com']) + ": " + spicemanip.main(closestmatches, 'andlist') + ".") - bot.notice(dispmsg, trigger.nick) + bot.osd(dispmsg, trigger.nick, 'notice') return realcom = trigger.sb['com'] if "aliasfor" in commands_list[trigger.sb['com']].keys(): realcom = commands_list[trigger.sb['com']]["aliasfor"] validcomlist = commands_list[realcom]["validcoms"] - bot.notice("The following " + bot.nick + " commands match " + str(trigger.sb['com']) + ": " + spicemanip.main(validcomlist, 'andlist') + ".", trigger.nick) + bot.osd("The following " + bot.nick + " commands match " + str(trigger.sb['com']) + ": " + spicemanip.main(validcomlist, 'andlist') + ".", trigger.nick, 'notice') return if trigger.sb['com'].endswith("?"): @@ -60,9 +60,9 @@ def query_detection_nick(bot, trigger): closestmatches = SpiceBot.similar_list(bot, trigger.sb['com'], list(commands_list.keys()), 10, 'reverse') if not len(closestmatches): - bot.notice("Cannot find any similar " + bot.nick + " commands for " + str(trigger.sb['com']) + ".", trigger.nick) + bot.osd("Cannot find any similar " + bot.nick + " commands for " + str(trigger.sb['com']) + ".", trigger.nick, 'notice') else: - bot.notice("The following " + bot.nick + " commands may match " + str(trigger.sb['com']) + ": " + spicemanip.main(closestmatches, 'andlist') + ".", trigger.nick) + bot.osd("The following " + bot.nick + " commands may match " + str(trigger.sb['com']) + ": " + spicemanip.main(closestmatches, 'andlist') + ".", trigger.nick, 'notice') return commandlist = [] @@ -71,6 +71,6 @@ def query_detection_nick(bot, trigger): commandlist.append(command) if not len(commandlist): - bot.notice("No " + bot.nick + " commands start with " + str(trigger.sb['com']) + ".", trigger.nick) + bot.osd("No " + bot.nick + " commands start with " + str(trigger.sb['com']) + ".", trigger.nick, 'notice') else: - bot.notice("The following " + bot.nick + " commands start with " + str(trigger.sb['com']) + ": " + spicemanip.main(commandlist, 'andlist') + ".", trigger.nick) + bot.osd("The following " + bot.nick + " commands start with " + str(trigger.sb['com']) + ": " + spicemanip.main(commandlist, 'andlist') + ".", trigger.nick, 'notice') diff --git a/sopel_modules/SpiceBot_CommandsQuery/QueryCommand.py b/sopel_modules/SpiceBot_CommandsQuery/QueryCommand.py index f52b37e..533818c 100644 --- a/sopel_modules/SpiceBot_CommandsQuery/QueryCommand.py +++ b/sopel_modules/SpiceBot_CommandsQuery/QueryCommand.py @@ -40,14 +40,14 @@ def query_detection(bot, trigger): closestmatches = SpiceBot.similar_list(bot, trigger.sb['com'], list(commands_list.keys()), 10, 'reverse') if len(closestmatches): dispmsg.append("The following commands match " + str(trigger.sb['com']) + ": " + spicemanip.main(closestmatches, 'andlist') + ".") - bot.notice(dispmsg, trigger.nick) + bot.osd(dispmsg, trigger.nick, 'notice') return realcom = trigger.sb['com'] if "aliasfor" in commands_list[trigger.sb['com']].keys(): realcom = commands_list[trigger.sb['com']]["aliasfor"] validcomlist = commands_list[realcom]["validcoms"] - bot.notice("The following commands match " + str(trigger.sb['com']) + ": " + spicemanip.main(validcomlist, 'andlist') + ".", trigger.nick) + bot.osd("The following commands match " + str(trigger.sb['com']) + ": " + spicemanip.main(validcomlist, 'andlist') + ".", trigger.nick, 'notice') return if trigger.sb['com'][:-1] == "?": @@ -58,9 +58,9 @@ def query_detection(bot, trigger): closestmatches = SpiceBot.similar_list(bot, trigger.sb['com'], list(commands_list.keys()), 10, 'reverse') if not len(closestmatches): - bot.notice("Cannot find any similar commands for " + str(trigger.sb['com']) + ".", trigger.nick) + bot.osd("Cannot find any similar commands for " + str(trigger.sb['com']) + ".", trigger.nick, 'notice') else: - bot.notice("The following commands may match " + str(trigger.sb['com']) + ": " + spicemanip.main(closestmatches, 'andlist') + ".", trigger.nick) + bot.osd("The following commands may match " + str(trigger.sb['com']) + ": " + spicemanip.main(closestmatches, 'andlist') + ".", trigger.nick, 'notice') return commandlist = [] @@ -69,6 +69,6 @@ def query_detection(bot, trigger): commandlist.append(command) if not len(commandlist): - bot.notice("No commands start with " + str(trigger.sb['com']) + ".", trigger.nick) + bot.osd("No commands start with " + str(trigger.sb['com']) + ".", trigger.nick, 'notice') else: - bot.notice("The following commands start with " + str(trigger.sb['com']) + ": " + spicemanip.main(commandlist, 'andlist') + ".", trigger.nick) + bot.osd("The following commands start with " + str(trigger.sb['com']) + ": " + spicemanip.main(commandlist, 'andlist') + ".", trigger.nick, 'notice') diff --git a/sopel_modules/SpiceBot_Logs/Logs_Command.py b/sopel_modules/SpiceBot_Logs/Logs_Command.py index 0af1032..0819ab6 100644 --- a/sopel_modules/SpiceBot_Logs/Logs_Command.py +++ b/sopel_modules/SpiceBot_Logs/Logs_Command.py @@ -14,7 +14,7 @@ import sopel_modules.SpiceBot as SpiceBot def bot_command_logs(bot, trigger): if not SpiceBot.command_permissions_check(bot, trigger, ['admins', 'owner', 'OP', 'ADMIN', 'OWNER']): - bot.say("I was unable to process this Bot Nick command due to privilege issues.") + bot.osd("I was unable to process this Bot Nick command due to privilege issues.") return logtype = spicemanip.main(trigger.sb['args'], 1) or None @@ -25,9 +25,9 @@ def bot_command_logs(bot, trigger): if not SpiceBot.inlist(logtype, SpiceBot.logs.dict["list"].keys()): closestmatches = SpiceBot.similar_list(bot, logtype, SpiceBot.logs.dict["list"].keys(), 10, 'reverse') if not len(closestmatches): - bot.notice("No valid logs match " + str(logtype) + ".", trigger.nick) + bot.osd("No valid logs match " + str(logtype) + ".", trigger.nick, 'notice') else: - bot.notice("The following commands may match " + str(logtype) + ": " + spicemanip.main(closestmatches, 'andlist') + ".", trigger.nick) + bot.osd("The following commands may match " + str(logtype) + ": " + spicemanip.main(closestmatches, 'andlist') + ".", trigger.nick, 'notice') return diff --git a/sopel_modules/SpiceBot_Logs/Queue.py b/sopel_modules/SpiceBot_Logs/Queue.py index bbfe113..dedfc53 100644 --- a/sopel_modules/SpiceBot_Logs/Queue.py +++ b/sopel_modules/SpiceBot_Logs/Queue.py @@ -27,7 +27,7 @@ def join_log_channel(bot, trigger): while True: if len(SpiceBot.logs.dict["queue"]): - bot.say(str(SpiceBot.logs.dict["queue"][0]), channel) + bot.osd(str(SpiceBot.logs.dict["queue"][0]), channel) del SpiceBot.logs.dict["queue"][0] else: SpiceBot.logs.sopel_config["logging_channel"] = False diff --git a/sopel_modules/SpiceBot_Messaging/Messaging.py b/sopel_modules/SpiceBot_Messaging/Messaging.py index e2af152..de9f5eb 100644 --- a/sopel_modules/SpiceBot_Messaging/Messaging.py +++ b/sopel_modules/SpiceBot_Messaging/Messaging.py @@ -30,14 +30,14 @@ def bot_command_privmsg(bot, trigger): def bot_command_process(bot, trigger): if not SpiceBot.command_permissions_check(bot, trigger, ['admins', 'owner']): - bot.say("I was unable to process this Bot Nick command due to privilege issues.") + bot.osd("I was unable to process this Bot Nick command due to privilege issues.") return if trigger.sb['com'] in ['say', 'msg']: trigger.sb['com'] = 'privmsg' if not len(trigger.sb['args']): - bot.say("You must specify a channel or nick.") + bot.osd("You must specify a channel or nick.") return target = spicemanip.main(trigger.sb['args'], 1) @@ -58,7 +58,7 @@ def bot_command_process(bot, trigger): botmessage = spicemanip.main(trigger.sb['args'], 0) if not botmessage: - bot.say("You must specify a message to send.") + bot.osd("You must specify a message to send.") return bot.osd(botmessage, targetsendlist, trigger.sb['com'].upper()) diff --git a/sopel_modules/SpiceBot_Restart/Restart.py b/sopel_modules/SpiceBot_Restart/Restart.py index bc4ef6f..3f25341 100644 --- a/sopel_modules/SpiceBot_Restart/Restart.py +++ b/sopel_modules/SpiceBot_Restart/Restart.py @@ -12,7 +12,7 @@ import sopel_modules.SpiceBot as SpiceBot def nickname_comand_restart(bot, trigger): if not trigger.admin: - bot.say("You are not authorized to perform this function.") + bot.osd("You are not authorized to perform this function.") quitmessage = "Received command from " + trigger.nick + " to restart. Be Back Soon!" SpiceBot.logs.log('SpiceBot_Restart', quitmessage) diff --git a/sopel_modules/SpiceBot_Update/Update.py b/sopel_modules/SpiceBot_Update/Update.py index 9f69588..613d734 100644 --- a/sopel_modules/SpiceBot_Update/Update.py +++ b/sopel_modules/SpiceBot_Update/Update.py @@ -32,7 +32,7 @@ def setup(bot): def nickname_comand_update(bot, trigger): if not SpiceBot.command_permissions_check(bot, trigger, ['admins', 'owner', 'OP', 'ADMIN', 'OWNER']): - bot.say("I was unable to process this Bot Nick command due to privilege issues.") + bot.osd("I was unable to process this Bot Nick command due to privilege issues.") return if not len(trigger.sb['args']): @@ -41,7 +41,7 @@ def nickname_comand_update(bot, trigger): commandused = spicemanip.main(trigger.sb['args'], 1).lower() if commandused not in ['deps', 'nodeps']: - bot.say("Please specify deps or nodeps") + bot.osd("Please specify deps or nodeps") return trigger.sb['args'] = spicemanip.main(trigger.sb['args'], '2+', 'list') diff --git a/sopel_modules/SpiceBot_osd/__init__.py b/sopel_modules/SpiceBot_osd/__init__.py index 5dce22e..8cd686f 100644 --- a/sopel_modules/SpiceBot_osd/__init__.py +++ b/sopel_modules/SpiceBot_osd/__init__.py @@ -47,19 +47,6 @@ def setup(bot): tools.get_sendable_message_list = ToolsOSD.get_sendable_message_list tools.get_message_recipientgroups = ToolsOSD.get_message_recipientgroups - # overwrite default bot messaging - SpiceBot.logs.log('SpiceBot_OSD', "Overwrite Default Sopel messaging commands") - bot.osd = SopelOSD.osd - bot.say = SopelOSD.say - bot.action = SopelOSD.action - bot.notice = SopelOSD.notice - bot.reply = SopelOSD.reply - bot.msg = SopelOSD.msg - sopel.bot.SopelWrapper.say = SopelWrapperOSD.say - sopel.bot.SopelWrapper.action = SopelWrapperOSD.action - sopel.bot.SopelWrapper.notice = SopelWrapperOSD.notice - sopel.bot.SopelWrapper.reply = SopelWrapperOSD.reply - # verify config settings for server SpiceBot.logs.log('SpiceBot_OSD', "Checking for config settings") bot.config.define_section("SpiceBot_OSD", SpiceBot_OSD, validate=False) @@ -283,7 +270,7 @@ class SopelOSD: recipient_id = Identifier(recipientgroup) - recipient_stack = self.stack.setdefault(recipient_id, { + recipient_stack = self.osdstack.setdefault(recipient_id, { 'messages': [], 'flood_left': self.config.SpiceBot_OSD.flood_burst_lines, 'dots': 0, @@ -343,61 +330,6 @@ class SopelOSD: finally: self.sending.release() - def say(self, text, recipient, max_messages=1): - """Send ``text`` as a PRIVMSG to ``recipient``. - In the context of a triggered callable, the ``recipient`` defaults to - the channel (or nickname, if a private message) from which the message - was received. - """ - self.osd(text, recipient, 'PRIVMSG', max_messages) - - def notice(self, text, dest, max_messages=1): - """Send an IRC NOTICE to a user or a channel. - - Within the context of a triggered callable, ``dest`` will default to - the channel (or nickname, if a private message), in which the trigger - happened. - """ - self.osd(text, dest, 'NOTICE', max_messages) - - def action(self, text, dest, max_messages=1): - """Send ``text`` as a CTCP ACTION PRIVMSG to ``dest``. - - The same loop detection and length restrictions apply as with - :func:`say`, though automatic message splitting is not available. - - Within the context of a triggered callable, ``dest`` will default to - the channel (or nickname, if a private message), in which the trigger - happened. - """ - self.osd(text, dest, 'ACTION', max_messages) - - def reply(self, text, dest, reply_to, notice=False, max_messages=1): - """Prepend ``reply_to`` to ``text``, and send as a PRIVMSG to ``dest``. - - If ``notice`` is ``True``, send a NOTICE rather than a PRIVMSG. - - The same loop detection and length restrictions apply as with - :func:`say`, though automatic message splitting is not available. - - Within the context of a triggered callable, ``reply_to`` will default to - the nickname of the user who triggered the call, and ``dest`` to the - channel (or nickname, if a private message), in which the trigger - happened. - """ - text = '%s: %s' % (reply_to, text) - if notice: - self.osd(text, dest, 'NOTICE', max_messages) - else: - self.osd(text, dest, 'PRIVMSG', max_messages) - - def msg(self, recipient, text, max_messages=1): - """ - .. deprecated:: 6.0 - Use :meth:`say` instead. Will be removed in Sopel 8. - """ - self.osd(text, recipient, 'PRIVMSG', max_messages) - class SopelWrapperOSD(object): @@ -405,29 +337,3 @@ class SopelWrapperOSD(object): if recipients is None: recipients = self._trigger.sender self._bot.osd(self, messages, recipients, text_method, max_messages) - - def say(self, message, destination=None, max_messages=1): - if destination is None: - destination = self._trigger.sender - self._bot.osd(self, message, destination, 'PRIVMSG', 1) - - def action(self, message, destination=None, max_messages=1): - if destination is None: - destination = self._trigger.sender - self._bot.osd(self, message, destination, 'ACTION', 1) - - def notice(self, message, destination=None, max_messages=1): - if destination is None: - destination = self._trigger.sender - self._bot.osd(self, message, destination, 'NOTICE', 1) - - def reply(self, message, destination=None, reply_to=None, notice=False, max_messages=1): - if destination is None: - destination = self._trigger.sender - if reply_to is None: - reply_to = self._trigger.nick - message = '%s: %s' % (reply_to, message) - if notice: - self._bot.osd(self, message, destination, 'NOTICE', 1) - else: - self._bot.osd(self, message, destination, 'PRIVMSG', 1)