def admin_spoof(self, ctx: commands.Context, spoofed_id=None):
""" Enables spoof-mode on a channel.
Spoof mode allows users with permissions to modify another specified
channel's timer from the one in which this command
was executed.
For example, if channel #session_1 has ID '249719010319532064'
and someone executes '!spoof 249719010319532064' from #admin_area,
all timer-related commands (except for setup) executed from
#admin_area by members with permissions will either affect or give
information of the timer in #session_1 instead.
:param spoofed_id: The ID of the channel that instructions will be
sent to.
:type spoofed_id: str
"""
channel = lib.get_channel(ctx)
if channel.id == spoofed_id:
await self.bot.say("How about no. " + spoofed_id,
delete_after=self.bot.ans_lifespan)
return
spoofed_channel = lib.get_server(ctx).get_channel(spoofed_id)
if spoofed_id is not None:
self.bot.get_interface(channel).spoofed = spoofed_channel
send = "Now acting in channel " + spoofed_channel.name
log = "Now acting as if in " + spoofed_channel.name
elif self.bot.get_interface(channel).spoofed is not None:
self.bot.get_interface(channel).spoofed = None
send = "Now acting in current channel"
log = "Spoofing now off"
else:
raise commands.MissingRequiredArgument
await self.bot.say(send, delete_after=self.bot.ans_lifespan)
lib.log(log, channel_id=channel.id)
评论列表
文章目录