Move core of "leave" command into Portal method
This commit is contained in:
parent
5b16694f78
commit
c90f86849e
@ -311,5 +311,4 @@ async def leave(evt: CommandEvent) -> None:
|
|||||||
await evt.reply("This command may only be used in a KakaoTalk channel portal room")
|
await evt.reply("This command may only be used in a KakaoTalk channel portal room")
|
||||||
return
|
return
|
||||||
await evt.mark_read()
|
await evt.mark_read()
|
||||||
await evt.sender.client.leave_channel(evt.portal.channel_props)
|
await evt.portal.leave_kakaotalk_channel()
|
||||||
await evt.sender.on_channel_left(evt.portal.ktid, evt.portal.kt_type)
|
|
||||||
|
@ -1386,6 +1386,10 @@ class Portal(DBPortal, BasePortal):
|
|||||||
else:
|
else:
|
||||||
self.log.debug(f"{user.mxid} left portal to {self.ktid}")
|
self.log.debug(f"{user.mxid} left portal to {self.ktid}")
|
||||||
|
|
||||||
|
async def leave_kakaotalk_channel(self, user: u.User) -> None:
|
||||||
|
await user.client.leave_channel(self.channel_props)
|
||||||
|
await user.on_channel_left(self.ktid, self.kt_type)
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
# region KakaoTalk event handling
|
# region KakaoTalk event handling
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user