def auth(): if Context.get('user').id == userID: return True elif Context.get('message').text == "/start": return True else: return False
def auth(): userIdStr = str(Context.get('user').id) print(telegamId, userIdStr) if userIdStr in telegamId: return True else: print(telegamId, userIdStr, "false") return False
def start(): ant = ['file', 'video', 'nothing'] blubb = yield Answer("Return Type\n/cancel", choices=ant) if (blubb == '/cancel') or (blubb not in ant): yield Answer('canceld') return url = Context.get('message').text #get the full URL modes = getModes(url) selection = yield Answer("formatChoice", choices=list(modes)) #selection = '720p60 mp4' downloadVideo(url, modes[selection]) filename = getVideoFilename(url, modes[selection]) if blubb == 'nothing': yield Answer("Done") elif blubb == 'file': yield 'document:' + path + '/data/' + filename + ";It's me!\n" + filename elif blubb == 'video': yield 'video:' + path + '/data/' + filename + ";It's me!\n" + filename
def default(): return 'unknown', Context.get('message').text
def guten_tag(): a = Answer('greeting', Context.get('user')) a.language_feature = False return a
async def start(): return Answer('greeting', Context.get('user'))
def start(): return "greeting", Context.get('user').id
def rewrite(): return Answer("newMessage", edit_id=Context.get("history")[0].id)
def echo(): return Context.get('message').text
def default(): return "'{}'\ncould not be processed".format(Context.get('message'))