Пример #1
0
def auth():
    if Context.get('user').id == userID:
        return True
    elif Context.get('message').text == "/start":
        return True
    else:
        return False
Пример #2
0
def auth():
    userIdStr = str(Context.get('user').id)
    print(telegamId, userIdStr)
    if userIdStr in telegamId:
        return True
    else:
        print(telegamId, userIdStr, "false")
        return False
Пример #3
0
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
Пример #4
0
def default():
    return 'unknown', Context.get('message').text
Пример #5
0
def guten_tag():
    a = Answer('greeting', Context.get('user'))
    a.language_feature = False
    return a
Пример #6
0
async def start():
    return Answer('greeting', Context.get('user'))
Пример #7
0
def start():
    return "greeting", Context.get('user').id
Пример #8
0
def rewrite():
    return Answer("newMessage", edit_id=Context.get("history")[0].id)
Пример #9
0
def echo():
    return Context.get('message').text
Пример #10
0
def default():
    return "'{}'\ncould not be processed".format(Context.get('message'))