From 16c15bca41f7cfc35a3211b75599a69f7c8b0719 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Sat, 5 Jan 2019 22:36:47 +0800 Subject: [PATCH] Add BaseSession.self_id property --- nonebot/session.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nonebot/session.py b/nonebot/session.py index 4ea19871..77b019ed 100644 --- a/nonebot/session.py +++ b/nonebot/session.py @@ -10,6 +10,10 @@ class BaseSession: self.bot = bot self.ctx = ctx + @property + def self_id(self) -> int: + return self.ctx['self_id'] + async def send(self, message: Message_T, *, at_sender: bool = False, ensure_private: bool = False,