mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-10 21:50:59 -05:00
TODO command
This commit is contained in:
parent
32ebbc83d3
commit
45e9399374
@ -43,6 +43,7 @@ class BotCommands():
|
||||
},
|
||||
'disabled': {},
|
||||
}
|
||||
self.todo_list = []
|
||||
self.module_files_parse()
|
||||
self.nickrules()
|
||||
for comtype in ['module', 'nickname', 'rule']:
|
||||
@ -280,6 +281,7 @@ class BotCommands():
|
||||
comdict["foldername"] = str(foldername)
|
||||
|
||||
detected_lines = []
|
||||
todo_list = []
|
||||
for line in module_file_lines:
|
||||
|
||||
if str(line).startswith("@"):
|
||||
@ -296,18 +298,25 @@ class BotCommands():
|
||||
elif str(line).startswith(tuple(["rule", "module.rule", "sopel.module.rule"])):
|
||||
line = str(line).split("rule")[-1]
|
||||
line = "rule" + line
|
||||
elif "TODO" in str(line):
|
||||
todo_list.append(str(line))
|
||||
else:
|
||||
line = None
|
||||
|
||||
if line:
|
||||
detected_lines.append(line)
|
||||
|
||||
if len(todo_list):
|
||||
self.todo_list.append(todo_list)
|
||||
|
||||
if len(detected_lines):
|
||||
|
||||
filelinelist = []
|
||||
for detected_line in detected_lines:
|
||||
validcomdict = copy.deepcopy(comdict)
|
||||
|
||||
validcomdict["TODO"] = todo_list
|
||||
|
||||
# Commands
|
||||
if str(detected_line).startswith("commands"):
|
||||
comtype = "module"
|
||||
|
||||
16
sopel_modules/SpiceBot_Core_Commands/TODO.py
Normal file
16
sopel_modules/SpiceBot_Core_Commands/TODO.py
Normal file
@ -0,0 +1,16 @@
|
||||
# coding=utf8
|
||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||
"""
|
||||
This is the SpiceBot Users system.
|
||||
"""
|
||||
import sopel
|
||||
|
||||
import sopel_modules.SpiceBot as SpiceBot
|
||||
from sopel_modules.spicemanip import spicemanip
|
||||
|
||||
|
||||
@SpiceBot.prerun('nickname')
|
||||
@sopel.module.nickname_commands('todo')
|
||||
def nickname_comand_users(bot, trigger, botcom):
|
||||
todo_task = spicemanip(SpiceBot.commands.todo_list, 'random')
|
||||
bot.osd(["Random TODO task for you: {}.".format(todo_task)])
|
||||
@ -25,6 +25,7 @@ from .Gif import *
|
||||
from .Sherlock import *
|
||||
from .Reddit import *
|
||||
from .DictComs import *
|
||||
from .TODO import *
|
||||
|
||||
__author__ = 'Sam Zick'
|
||||
__email__ = 'sam@deathbybandaid.net'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user