Ejemplo n.º 1
0
def worker():
    sessions = {}
    while True:
        channel, text = q.get()

        with bot.start_typing(channel):
            if channel not in sessions:
                sessions[channel] = cleverbot.Cleverbot()

            """:type : Cleverbot"""
            clever = sessions[channel]
            answer = clever.ask(text)

            bot.send_message(channel, answer)
Ejemplo n.º 2
0
def worker():
    while True:
        channel, text, query = q.get()

        with bot.start_typing(channel):
            bot.send_message(channel, query(text))
Ejemplo n.º 3
0
def worker():
    while True:
        channel, text = q.get()
        bot.send_message(channel, query(text))