MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / message_id

Method message_id

pager_lib/tqdm/contrib/telegram.py:38–54  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

36
37 @property
38 def message_id(self):
39 if hasattr(self, '_message_id'):
40 return self._message_id
41 try:
42 res = self.session.post(
43 self.API + '%s/sendMessage' % self.token,
44 data={'text': '`' + self.text + '`', 'chat_id': self.chat_id,
45 'parse_mode': 'MarkdownV2'}).json()
46 except Exception as e:
47 tqdm_auto.write(str(e))
48 else:
49 if res.get('error_code') == 429:
50 warn("Creation rate limit: try increasing `mininterval`.",
51 TqdmWarning, stacklevel=2)
52 else:
53 self._message_id = res['result']['message_id']
54 return self._message_id
55
56 def write(self, s):
57 """Replaces internal `message_id`'s text with `s`."""

Callers

nothing calls this directly

Calls 2

writeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected