Skip to content

Instantly share code, notes, and snippets.

@xavieryao
Created February 7, 2017 02:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xavieryao/7a2c525b90738a997fdd207103021ec2 to your computer and use it in GitHub Desktop.
Save xavieryao/7a2c525b90738a997fdd207103021ec2 to your computer and use it in GitHub Desktop.
Always typing
import time
from telethon import InteractiveTelegramClient
from telethon.tl.types.input_peer_chat import InputPeerChat
from telethon.tl.functions.messages.set_typing import SetTypingRequest
from telethon.tl.types.send_message_typing_action import SendMessageTypingAction
client = InteractiveTelegramClient('session_name','+8613400000000',api_id=123456,api_hash='752f79bb39d8004006f00f761dab7f00')
peer = InputPeerChat(14884418)
act = SendMessageTypingAction()
req = SetTypingRequest(peer=peer,action=act)
while True:
time.sleep(4)
client.invoke(req)
@scateu
Copy link

scateu commented Feb 7, 2017

哈哈哈哈哈哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment