How to use the pytelegrambotapi.util.generate_random_token function in pyTelegramBotAPI

To help you get started, we’ve selected a few pyTelegramBotAPI examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eternnoir / pyTelegramBotAPI / pytelegrambotapi / types.py View on Github external
def to_dic(self):
        ret = {'type': self.type, 'media': 'attach://' + util.generate_random_token()
               if not util.is_string(self.media) else self.media}
        if self.caption:
            ret['caption'] = self.caption
        if self.parse_mode:
            ret['parse_mode'] = self.parse_mode
        if self.width:
            ret['width'] = self.width
        if self.height:
            ret['height'] = self.height
        if self.duration:
            ret['duration'] = self.duration
        if self.supports_streaming:
            ret['supports_streaming'] = self.supports_streaming
        return ret