def spoof(self, member: discord.Member, channel: discord.Channel):
""" Spoofs a channel ID if there's a set channel to spoof from
the one where the command was executed. Also checks for the
author's permissions to see if they can spoof commands.
:param member: The member trying to spoof the command.
:type member: discord.Member
:param channel: The channel from which the command to spoof was sent.
:type channel: discord.Channel
:return: If there's a registered ID to spoof and the author has elevated
permissions, returns the spoofed ID. If not, returns the same ID
as channel_id
"""
if self.has_permission(member) and self.get_interface(channel).spoofed\
is not None:
return self._interfaces[channel].spoofed
return channel
评论列表
文章目录