# Path: bottery/exceptions.py
# class ValidationError(Exception):
#     pass


import re
from bottery.exceptions import ValidationError



class CaseSensitiveOptionMixin:
    def clean_case_senstive(self):
        if not self.kwargs.get('case_sensitive'):
            self.message.text = self.message.text.lower()


class PlatformsOptionMixin:
    def clean_platforms(self):
        platforms = self.kwargs.get('platforms')

        if platforms is None:
            return

        if not isinstance(platforms, (list, tuple,)):
            raise Exception('platforms option must be a list or a tuple')

        if self.message.platform not in platforms:

# Path: bottery/exceptions.py
# class ValidationError(Exception):
#     pass


# Path: bottery/handlers.py
import re
from bottery.exceptions import ValidationError




class CaseSensitiveOptionMixin:
    def clean_case_senstive(self):
        if not self.kwargs.get('case_sensitive'):
            self.message.text = self.message.text.lower()


class PlatformsOptionMixin:
    def clean_platforms(self):
        platforms = self.kwargs.get('platforms')

        if platforms is None:
            return

        if not isinstance(platforms, (list, tuple,)):
            raise Exception('platforms option must be a list or a tuple')

        if self.message.platform not in platforms:

            raise ValidationError('message not from {}'.format(platforms))