# Path: desertbot/ircbase.py
# class ModeType(Enum):
#     LIST = 0,
#     PARAM_SET = 1,
#     PARAM_SET_UNSET = 2,
#     NO_PARAM = 3


import logging
from typing import Dict, List, Optional, TYPE_CHECKING
from desertbot.ircbase import ModeType
    from desertbot.desertbot import DesertBot
    from desertbot.user import IRCUser
        supportedStatuses = self.bot.supportHelper.statusModes
        modesAdded = []
        paramsAdded = []
        modesRemoved = []
        paramsRemoved = []
        for mode in modes:
            if mode == "+":
                adding = True
            elif mode == "-":
                adding = False
            elif mode not in supportedChanModes and mode not in supportedStatuses:
                self.logger.warning('Received unknown MODE char {} in MODE string {}'.format(mode, modes))
                # We received a mode char that's unknown to use, so we abort parsing to prevent desync.
                return None
            elif mode in supportedStatuses:
                if len(params) < 1:
                    self.logger.warning('Received a broken MODE string for channel {}!'.format(self.name))
                    return {}
                user = params.pop(0)
                if user not in self.users:
                    self.logger.warning("Received status MODE for unknown user {} in channel {}.".format(user, self.name))
                else:
                    if adding:
                        self.ranks[user] += mode
                        modesAdded.append(mode)
                        paramsAdded.append(user)
                    elif not adding and mode in self.ranks[user]:
                        self.ranks[user] = self.ranks[user].replace(mode, "")
                        modesRemoved.append(mode)
                        paramsRemoved.append(user)

# Path: desertbot/ircbase.py
# class ModeType(Enum):
#     LIST = 0,
#     PARAM_SET = 1,
#     PARAM_SET_UNSET = 2,
#     NO_PARAM = 3


# Path: desertbot/channel.py
import logging
from typing import Dict, List, Optional, TYPE_CHECKING
from desertbot.ircbase import ModeType
    from desertbot.desertbot import DesertBot
    from desertbot.user import IRCUser

        supportedStatuses = self.bot.supportHelper.statusModes
        modesAdded = []
        paramsAdded = []
        modesRemoved = []
        paramsRemoved = []
        for mode in modes:
            if mode == "+":
                adding = True
            elif mode == "-":
                adding = False
            elif mode not in supportedChanModes and mode not in supportedStatuses:
                self.logger.warning('Received unknown MODE char {} in MODE string {}'.format(mode, modes))
                # We received a mode char that's unknown to use, so we abort parsing to prevent desync.
                return None
            elif mode in supportedStatuses:
                if len(params) < 1:
                    self.logger.warning('Received a broken MODE string for channel {}!'.format(self.name))
                    return {}
                user = params.pop(0)
                if user not in self.users:
                    self.logger.warning("Received status MODE for unknown user {} in channel {}.".format(user, self.name))
                else:
                    if adding:
                        self.ranks[user] += mode
                        modesAdded.append(mode)
                        paramsAdded.append(user)
                    elif not adding and mode in self.ranks[user]:
                        self.ranks[user] = self.ranks[user].replace(mode, "")
                        modesRemoved.append(mode)
                        paramsRemoved.append(user)

            elif supportedChanModes[mode] == ModeType.LIST: