Misc tweaks and fixes

This commit is contained in:
dave 2017-11-27 23:20:51 -08:00
parent d9914ca104
commit 7379d03153
4 changed files with 6 additions and 3 deletions

View File

@ -98,7 +98,7 @@ class PyIRCBotSub(PrimitiveBot):
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, logging.basicConfig(level=logging.WARNING,
format="%(asctime)-15s %(levelname)-8s %(filename)s:%(lineno)d %(message)s") format="%(asctime)-15s %(levelname)-8s %(filename)s:%(lineno)d %(message)s")
log = logging.getLogger('main') log = logging.getLogger('main')
@ -108,7 +108,7 @@ if __name__ == "__main__":
parser.add_argument("-s", "--server", default="localhost", help="Msgbus server address") parser.add_argument("-s", "--server", default="localhost", help="Msgbus server address")
parser.add_argument("-p", "--port", default=7100, type=int, help="Msgbus server port") parser.add_argument("-p", "--port", default=7100, type=int, help="Msgbus server port")
parser.add_argument("-n", "--name", default="default", help="bot name") parser.add_argument("-n", "--name", default="default", help="bot name")
parser.add_argument("--debug", action="store_true", help="") parser.add_argument("--debug", action="store_true", help="increase logging level")
args = parser.parse_args() args = parser.parse_args()
if args.debug: if args.debug:

View File

@ -63,6 +63,7 @@ class ModInfo(ModuleBase):
for modname, module, helptext, helpcommands in self.iter_modules(): for modname, module, helptext, helpcommands in self.iter_modules():
self.bot.act_PRIVMSG(msg.args[0], "{}: {}{}".format(modname, command.prefix, helptext)) self.bot.act_PRIVMSG(msg.args[0], "{}: {}{}".format(modname, command.prefix, helptext))
@info("helpindex show a short list of all commands", cmds=["helpindex"])
@command("helpindex") @command("helpindex")
def cmd_helpindex(self, msg, cmd): def cmd_helpindex(self, msg, cmd):
""" """

View File

@ -8,6 +8,7 @@
from time import time from time import time
from math import floor from math import floor
from pyircbot.modulebase import ModuleBase, regex from pyircbot.modulebase import ModuleBase, regex
from pyircbot.modules.ModInfo import info
import cherrypy import cherrypy
from threading import Thread from threading import Thread
from twilio.rest import Client from twilio.rest import Client
@ -133,6 +134,7 @@ class SMS(ModuleBase):
""" """
cherrypy.engine.exit() cherrypy.engine.exit()
@info("text-<name> text somebody on the VIP list", cmds=["text"])
@regex(r'(?:^\.text\-([a-zA-Z0-9]+)(?:\s+(.+))?)', types=['PRIVMSG']) @regex(r'(?:^\.text\-([a-zA-Z0-9]+)(?:\s+(.+))?)', types=['PRIVMSG'])
def cmd_text(self, msg, match): def cmd_text(self, msg, match):
""" """

View File

@ -61,7 +61,7 @@ class Tell(ModuleBase):
# Delete # Delete
self.db.query("DELETE FROM `tells` WHERE `id`=?", (tell["id"],)) self.db.query("DELETE FROM `tells` WHERE `id`=?", (tell["id"],))
@info(".tell <person> <message> relay a message when the target is online", cmds=["tell"]) @info("tell <person> <message> relay a message when the target is online", cmds=["tell"])
@command("tell", allow_private=True) @command("tell", allow_private=True)
def tellcmds(self, msg, cmd): def tellcmds(self, msg, cmd):
if len(cmd.args) < 2: if len(cmd.args) < 2: