def get_channel_by_name(server: Server, name: str) -> Union[Channel, None]:
"""
Finds a channel by it's name and returns it's channel object
:param server: the server where the channel is in
:param name: the name of the channel
:return: channel object if channel was found, otherwise None
"""
for channel in server.channels:
if channel.name == name:
return channel
return None
评论列表
文章目录