diff options
author | romangraef <roman.graef@gmail.com> | 2018-03-17 22:11:47 +0100 |
---|---|---|
committer | romangraef <roman.graef@gmail.com> | 2018-03-17 22:11:47 +0100 |
commit | 50afa23b9dc26f914522a55fe5cbb893d34ad27c (patch) | |
tree | 9711c076e4af283523f51fbd72ceb67bde4f5366 /lib/common.py | |
parent | 473d84ec2c82932fa1c09e4b96d6e8198bbb71df (diff) | |
download | telegramuserbot-master.tar.gz telegramuserbot-master.tar.bz2 telegramuserbot-master.zip |
Diffstat (limited to 'lib/common.py')
-rw-r--r-- | lib/common.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/common.py b/lib/common.py new file mode 100644 index 0000000..ade2891 --- /dev/null +++ b/lib/common.py @@ -0,0 +1,16 @@ +import pyrogram +from pyrogram.api import types as tgtypes + + +class CommonContext: + def __init__(self, client: pyrogram.Client, channel, message: tgtypes.Message): + self.client = client + self.channel = channel + self.message = message + self.author = message.from_id + + def respond(self, text): + self.client.send_message(self.channel, text=text) + + def edit(self, text): + self.client.edit_message_text(chat_id=self.channel, message_id=self.message.id, text=text) |