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