# 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
                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:
                if len(params) < 1:
                    self.logger.warning('Received a broken MODE string for channel {}!'.format(self.name))
                    return {}
                param = params.pop(0)
                if mode not in self.modes:
                    self.modes[mode] = set()
                if adding:
                    self.modes[mode].add(param)
                    modesAdded.append(mode)
                    paramsAdded.append(param)
                elif not adding and param in self.modes[mode]:
                    self.modes[mode].remove(param)
                    modesRemoved.append(mode)
                    paramsRemoved.append(param)

# 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

                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:
                if len(params) < 1:
                    self.logger.warning('Received a broken MODE string for channel {}!'.format(self.name))
                    return {}
                param = params.pop(0)
                if mode not in self.modes:
                    self.modes[mode] = set()
                if adding:
                    self.modes[mode].add(param)
                    modesAdded.append(mode)
                    paramsAdded.append(param)
                elif not adding and param in self.modes[mode]:
                    self.modes[mode].remove(param)
                    modesRemoved.append(mode)
                    paramsRemoved.append(param)

            elif supportedChanModes[mode] == ModeType.PARAM_SET: