def get_interface(self, channel: discord.Channel, generate=True):
""" Retrieves a channel interface. If none found for the channel, a new
one is created with its default values (if generate is True).
:param channel: The channel the interface belongs to.
:type channel: discord.Channel
:param generate: Whether the interface should be auto-generated if none
is found or not.
:type generate: bool
:return: The interface belonging to the channel, new or old.
"""
if channel not in self._interfaces:
if not generate:
return None
self._interfaces[channel] = ChannelTimerInterface(channel)
return self._interfaces[channel]
评论列表
文章目录