def addTempChannel(self, name): """ Add a temporary channel (like #spectator or #multiplayer), gets deleted when there's no one in the channel and it's hidden in channels list :param name: channel name :return: True if the channel was created, otherwise False """ if name in self.channels: return False glob.streams.add("chat/{}".format(name)) self.channels[name] = channel.channel(name, "Chat", True, True, True, True) log.info("Created temp channel {}".format(name))
def addHiddenChannel(self, name): """ Add a hidden channel. It's like a normal channel and must be deleted manually, but it's not shown in channels list. :param name: channel name :return: True if the channel was created, otherwise False """ if name in self.channels: return False glob.streams.add("chat/{}".format(name)) self.channels[name] = channel.channel(name, "Chat", True, True, False, True) log.info("Created hidden channel {}".format(name))
def addChannel(self, name, description, publicRead, publicWrite, temp = False, hidden = False): """ Add a channel to channels list :param name: channel name :param description: channel description :param publicRead: if True, this channel can be read by everyone. If False, it can be read only by mods/admins :param publicWrite: same as public read, but regards writing permissions :param temp: if True, this channel will be deleted when there's no one in this channel :param hidden: if True, thic channel won't be shown in channels list :return: """ glob.streams.add("chat/{}".format(name)) self.channels[name] = channel.channel(name, description, publicRead, publicWrite, temp, hidden) log.info("Created channel {}".format(name))