# Path: plugins/constants.py
# API_DOCS = 'https://api.coala.io/en/latest'
# USER_DOCS = 'https://docs.coala.io/en/latest'
# MAX_MSG_LEN = 1000
# MAX_LINES = 20
# PRIVATE_CMDS = ['assign_cmd', 'create_issue_cmd', 'invite_cmd', 'mark_cmd',
#                 'pr_stats', 'unassign_cmd', 'pitchfork', 'the_rules', 'wa',
#                 'answer', 'lmgtfy', 'ghetto', 'explain', 'nevermind']
# 
# Path: utils/mixin.py
# class DefaultConfigMixin():
# 
#     @property
#     def _default_config(self):
#         if (hasattr(self.bot_config, 'DEFAULT_CONFIG') and
#                 self.name in self.bot_config.DEFAULT_CONFIG):
#             return self.bot_config.DEFAULT_CONFIG[self.name]
# 
#     def __init__(self, bot, name=None):
#         super().__init__(bot, name=name)
#         if not hasattr(self, 'CONFIG_TEMPLATE'):  # pragma: no cover
#             self.log.error('CONFIG_TEMPLATE for plugin {} is missing.'
#                            .format(self.name))
# 
#     def get_configuration_template(self):
#         default_config = self._default_config
#         config_template = self.CONFIG_TEMPLATE
# 
#         if default_config:
#             config = dict(chain(config_template.items(),
#                                 default_config.items()))
#         else:
#             config = config_template
# 
#         return config
# 
#     def configure(self, configuration):
#         config_template = self.get_configuration_template()
# 
#         if configuration is not None and configuration != {}:
#             config = dict(chain(config_template.items(),
#                                 configuration.items()))
#         else:
#             config = config_template
# 
#         self.config = config


from errbot import BotPlugin
from errbot.templating import tenv
from plugins import constants
from utils.mixin import DefaultConfigMixin



class SpammingAlert(DefaultConfigMixin, BotPlugin):
    """
    A plugin which alerts the user that they might be spamming.
    """

    CONFIG_TEMPLATE = {
        'MAX_MSG_LEN': constants.MAX_MSG_LEN,

# Path: plugins/constants.py
# API_DOCS = 'https://api.coala.io/en/latest'
# USER_DOCS = 'https://docs.coala.io/en/latest'
# MAX_MSG_LEN = 1000
# MAX_LINES = 20
# PRIVATE_CMDS = ['assign_cmd', 'create_issue_cmd', 'invite_cmd', 'mark_cmd',
#                 'pr_stats', 'unassign_cmd', 'pitchfork', 'the_rules', 'wa',
#                 'answer', 'lmgtfy', 'ghetto', 'explain', 'nevermind']
# 
# Path: utils/mixin.py
# class DefaultConfigMixin():
# 
#     @property
#     def _default_config(self):
#         if (hasattr(self.bot_config, 'DEFAULT_CONFIG') and
#                 self.name in self.bot_config.DEFAULT_CONFIG):
#             return self.bot_config.DEFAULT_CONFIG[self.name]
# 
#     def __init__(self, bot, name=None):
#         super().__init__(bot, name=name)
#         if not hasattr(self, 'CONFIG_TEMPLATE'):  # pragma: no cover
#             self.log.error('CONFIG_TEMPLATE for plugin {} is missing.'
#                            .format(self.name))
# 
#     def get_configuration_template(self):
#         default_config = self._default_config
#         config_template = self.CONFIG_TEMPLATE
# 
#         if default_config:
#             config = dict(chain(config_template.items(),
#                                 default_config.items()))
#         else:
#             config = config_template
# 
#         return config
# 
#     def configure(self, configuration):
#         config_template = self.get_configuration_template()
# 
#         if configuration is not None and configuration != {}:
#             config = dict(chain(config_template.items(),
#                                 configuration.items()))
#         else:
#             config = config_template
# 
#         self.config = config


# Path: plugins/spam.py
from errbot import BotPlugin
from errbot.templating import tenv
from plugins import constants
from utils.mixin import DefaultConfigMixin




class SpammingAlert(DefaultConfigMixin, BotPlugin):
    """
    A plugin which alerts the user that they might be spamming.
    """

    CONFIG_TEMPLATE = {
        'MAX_MSG_LEN': constants.MAX_MSG_LEN,

        'MAX_LINES': constants.MAX_LINES