mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-10 21:50:59 -05:00
test configuration
This commit is contained in:
parent
81acd5ae49
commit
fdcfe42bf4
@ -4,13 +4,32 @@ from __future__ import unicode_literals, absolute_import, division, print_functi
|
||||
This is the SpiceBot Channels system.
|
||||
"""
|
||||
import sopel
|
||||
from sopel.config.types import StaticSection, ValidatedAttribute, ListAttribute
|
||||
|
||||
import re
|
||||
import threading
|
||||
|
||||
from .Config import config as botconfig
|
||||
from .Events import events
|
||||
from .Logs import logs
|
||||
|
||||
|
||||
class SpiceBot_Channels_MainSection(StaticSection):
|
||||
announcenew = ValidatedAttribute('announcenew', default=False)
|
||||
joinall = ValidatedAttribute('joinall', default=False)
|
||||
operadmin = ValidatedAttribute('operadmin', default=False)
|
||||
chanignore = ListAttribute('chanignore')
|
||||
|
||||
|
||||
class BotChannels():
|
||||
"""This Logs all channels known to the server"""
|
||||
def __init__(self):
|
||||
|
||||
# SpiceBot
|
||||
logs.log('SpiceBot_Channels', "Setting Up BotChannels class")
|
||||
botconfig.define_section("SpiceBot_Channels", SpiceBot_Channels_MainSection, validate=False)
|
||||
events.startup_add([events.BOT_CHANNELS])
|
||||
|
||||
self.lock = threading.Lock()
|
||||
self.channel_lock = False
|
||||
self.dict = {
|
||||
|
||||
@ -2,15 +2,7 @@
|
||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||
"""Configuration for SpiceBot"""
|
||||
|
||||
import sopel.module
|
||||
from sopel.config.types import StaticSection, ValidatedAttribute, ListAttribute
|
||||
|
||||
|
||||
class SpiceBot_Channels_MainSection(StaticSection):
|
||||
announcenew = ValidatedAttribute('announcenew', default=False)
|
||||
joinall = ValidatedAttribute('joinall', default=False)
|
||||
operadmin = ValidatedAttribute('operadmin', default=False)
|
||||
chanignore = ListAttribute('chanignore')
|
||||
from .Channels import SpiceBot_Channels_MainSection
|
||||
|
||||
|
||||
def configure(config):
|
||||
|
||||
@ -2,18 +2,12 @@
|
||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||
"""Configuration for SpiceBot"""
|
||||
|
||||
import sopel.module
|
||||
|
||||
from .Logs import logs
|
||||
from .Events import events
|
||||
from .Config import config as botconfig
|
||||
|
||||
from .configure import SpiceBot_Channels_MainSection
|
||||
from .Channels import SpiceBot_Channels_MainSection
|
||||
|
||||
|
||||
def setup(bot):
|
||||
|
||||
logs.log('SpiceBot_Channels', "Starting setup procedure")
|
||||
events.startup_add([events.BOT_CHANNELS])
|
||||
logs.log('SpiceBot_Channels', "Setting Up Configuration")
|
||||
bot.config.define_section("SpiceBot_Channels", SpiceBot_Channels_MainSection, validate=False)
|
||||
botconfig.define_section("SpiceBot_Channels", SpiceBot_Channels_MainSection, validate=False)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user