mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-10 21:50:59 -05:00
filepath counts
This commit is contained in:
parent
ad63faf6f0
commit
dc566d2096
@ -60,11 +60,11 @@ class BotGif():
|
||||
self.valid_api[gif_api]["apikey"] = apikey
|
||||
|
||||
for validgifapi in list(self.valid_api.keys()):
|
||||
botcommands.dict['counts'] += 1
|
||||
command_dict = {
|
||||
"comtype": "gif_prefix",
|
||||
"validcoms": [validgifapi]
|
||||
}
|
||||
botcommands.dict['counts'] += 1
|
||||
botcommands.register(command_dict)
|
||||
|
||||
def setup_gif(self):
|
||||
|
||||
@ -15,8 +15,18 @@ class BotRead():
|
||||
def __init__(self):
|
||||
self.dict = dict()
|
||||
|
||||
def config_dir(self):
|
||||
return
|
||||
def get_config_dirs(self, config_dir_name):
|
||||
dir_to_scan = []
|
||||
for plugin_dir in set(sopel_modules.__path__):
|
||||
configsdir = os.path.join(plugin_dir, "SpiceBot_Configs")
|
||||
cfgdir = os.path.join(configsdir, config_dir_name)
|
||||
dir_to_scan.append(cfgdir)
|
||||
|
||||
extradir = eval("botconfig." + config_dir_name)
|
||||
if len(extradir):
|
||||
for extracfgdir in extradir:
|
||||
dir_to_scan.append(extracfgdir)
|
||||
return dir_to_scan
|
||||
|
||||
def json_to_dict(self, directories, configtypename="Config File", log_from='read_directory_json_to_dict', logging=True):
|
||||
|
||||
|
||||
@ -33,10 +33,15 @@ def bot_startup_monologue_channels(bot, trigger):
|
||||
@sopel.module.event(SpiceBot.events.BOT_COMMANDS)
|
||||
@sopel.module.rule('.*')
|
||||
def bot_startup_monologue_commands(bot, trigger):
|
||||
availablecomsnum, availablecomsfiles = 0, 0
|
||||
availablecomsnum, availablecomsfiles = 0, []
|
||||
for commandstype in list(SpiceBot.commands.dict['commands'].keys()):
|
||||
availablecomsnum += len(list(SpiceBot.commands.dict['commands'][commandstype].keys()))
|
||||
availablecomsfiles += SpiceBot.commands.dict['counts']
|
||||
for validcom in list(SpiceBot.commands.dict['commands'][commandstype].keys()):
|
||||
if "filepath" in list(SpiceBot.commands.dict['commands'][commandstype][validcom].keys()):
|
||||
filepath = SpiceBot.commands.dict['commands'][commandstype][validcom]["filepath"].lower()
|
||||
if filepath not in availablecomsfiles:
|
||||
availablecomsfiles.append(filepath)
|
||||
availablecomsfiles = len(availablecomsfiles)
|
||||
displayval = "There are " + str(availablecomsnum) + " commands available in " + str(availablecomsfiles) + " files."
|
||||
SpiceBot.startupmonologue.dict["commands"] = displayval
|
||||
SpiceBot.logs.log('SpiceBot_StartupMonologue', displayval)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user