Exemple #1
0
async def testLoop():
    while True:
        #Define a message that we want to send
        a = Answer('greeting', "user", receiver=userID)
        # yield it to samt
        yield a
        #wait 10 seconds
        await asyncio.sleep(10)
Exemple #2
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
Exemple #3
0
def test():
    def callback(msg):
        a = Answer("Interessiert mich nicht " + msg)
        a.mark_as_answer = False
        return a

    q = Answer("<b>W</b><i>ill</i>ste?",
               choices=[
                   "Ja"
                   "Nein", "Vielleicht", "Möglichweise", "Ein klares womöglich"
               ],
               callback=callback)
    # q.markup = "Markdown"
    return q
Exemple #4
0
def guten_tag():
    a = Answer('greeting', Context.get('user'))
    a.language_feature = False
    return a
Exemple #5
0
async def start():
    return Answer('greeting', Context.get('user'))
Exemple #6
0
 def callback(msg):
     a = Answer("Interessiert mich nicht " + msg)
     a.mark_as_answer = False
     return a
Exemple #7
0
def key():
    a = Answer("keyboard entfernt", keyboard=0)
    return a
Exemple #8
0
def key():
    a = Answer("Hier isses", keyboard=["Ja", "Nein", "Nööö", "..."])
    return a
Exemple #9
0
def key():
    a = Answer("Hier isses", keyboard=[["Ja"], ["Nein"], ["Nööö"], ["..."]])
    return a
Exemple #10
0
def rewrite():
    return Answer("newMessage", edit_id=Context.get("history")[0].id)
Exemple #11
0
async def talk():
    x = yield Answer("Was willst du?\n" "/stop zum Abbrechen\n")
    if x == "/stop":
        yield Answer("abgebrochen")
    elif len(x) > 0:
        yield Answer(x)