mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-10 21:50:59 -05:00
test
This commit is contained in:
parent
99960263cc
commit
980fce89d5
@ -50,7 +50,7 @@ class BotDictCommands():
|
||||
|
||||
# simplify usage of the bot command going forward
|
||||
# copy dict to not overwrite
|
||||
triggersb['comdict'] = copy.deepcopy(botcommands.dict['commands']["prefix"][triggersb['realcom']])
|
||||
triggersb['comdict'] = copy.deepcopy(botcommands.dict['commands']["dictcom"][triggersb['realcom']])
|
||||
|
||||
# execute function based on command type
|
||||
triggersb['comtype'] = triggersb['comdict']["type"].lower()
|
||||
@ -71,7 +71,7 @@ class BotDictCommands():
|
||||
|
||||
dict_from_file = self.valid_dictcom_dict[jsondict]
|
||||
|
||||
dict_from_file["comtype"] = "prefix"
|
||||
dict_from_file["comtype"] = "dictcom"
|
||||
|
||||
# default command to filename
|
||||
if "validcoms" not in list(dict_from_file.keys()):
|
||||
|
||||
@ -9,6 +9,7 @@ from sopel.tools import Identifier
|
||||
import functools
|
||||
import copy
|
||||
import datetime
|
||||
|
||||
import spicemanip
|
||||
|
||||
from .Tools import command_permissions_check
|
||||
@ -16,7 +17,7 @@ from .Commands import commands as botcommands
|
||||
from .Database import db as botdb
|
||||
|
||||
|
||||
def prerun(t_command_type='module'):
|
||||
def prerun(t_command_type='module', t_command_subtype=None):
|
||||
|
||||
def actual_decorator(function):
|
||||
|
||||
@ -32,16 +33,8 @@ def prerun(t_command_type='module'):
|
||||
if not trigger_command_type:
|
||||
return
|
||||
|
||||
if trigger_command_type not in list(botcommands.dict["commands"].keys()):
|
||||
return
|
||||
|
||||
if trigger_command not in list(botcommands.dict["commands"][trigger_command_type].keys()):
|
||||
return
|
||||
|
||||
if trigger_command_type != t_command_type:
|
||||
if t_command_type not in list(botcommands.dict["commands"].keys()):
|
||||
return
|
||||
if trigger_command in list(botcommands.dict["commands"][t_command_type].keys()):
|
||||
if t_command_subtype:
|
||||
if trigger_command_type != trigger_command_type:
|
||||
return
|
||||
|
||||
# Argsdict Defaults
|
||||
|
||||
@ -9,7 +9,6 @@ import sopel
|
||||
import collections
|
||||
import os
|
||||
import sys
|
||||
import codecs
|
||||
from difflib import SequenceMatcher
|
||||
from operator import itemgetter
|
||||
from collections import abc
|
||||
|
||||
@ -10,12 +10,11 @@ import sopel.module
|
||||
import sopel_modules.SpiceBot as SpiceBot
|
||||
|
||||
|
||||
@SpiceBot.prerun('module')
|
||||
@SpiceBot.prerun('module', 'dictcom')
|
||||
@sopel.module.commands('(.*)')
|
||||
def command_dictcom(bot, trigger):
|
||||
bot.say("here")
|
||||
|
||||
if trigger.sb['com'] not in list(SpiceBot.commands.dict['commands']["prefix"].keys()):
|
||||
if trigger.sb['com'] not in list(SpiceBot.commands.dict['commands']["dictcom"].keys()):
|
||||
return
|
||||
|
||||
trigger.sb = SpiceBot.dictcoms.get_dict(trigger.sb)
|
||||
|
||||
@ -11,7 +11,7 @@ import spicemanip
|
||||
# TODO custom gif shortcut commands
|
||||
|
||||
|
||||
@SpiceBot.prerun('module')
|
||||
@SpiceBot.prerun('module', "gif_prefix")
|
||||
@sopel.module.commands('gif')
|
||||
def gif_trigger(bot, trigger):
|
||||
|
||||
@ -33,7 +33,6 @@ def gif_trigger(bot, trigger):
|
||||
@SpiceBot.prerun('module')
|
||||
@sopel.module.commands('(.*)')
|
||||
def gifapi_triggers(bot, trigger):
|
||||
bot.say("here")
|
||||
|
||||
if trigger.sb['com'] not in list(SpiceBot.gif.valid_api.keys()):
|
||||
return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user