Example #1
0
def vote_for_exp(expeditors, chat_id):
    keyboard = telebot.types.ReplyKeyboardMarkup(one_time_keyboard=True)
    keyboard.row('👍I like this expedition', '👎🏿I don`t like it')
    for player_id in expeditors:
        bot_send_message(player_id,
                         'Do you like this expedition?',
                         reply_markup=keyboard)
Example #2
0
def start_exp(expeditors, chat_id):
    keyboard = telebot.types.ReplyKeyboardMarkup(one_time_keyboard=True)
    keyboard.row('❤️ Approve', '🖤 Reject')
    for player_id in expeditors:
        bot_send_message(player_id,
                         'Your choice in expedition',
                         reply_markup=keyboard)
Example #3
0
def start_exp(expeditors, chat_id):
    keyboard = telebot.types.ReplyKeyboardMarkup(one_time_keyboard=True)
    keyboard.row('❤️ ' + languages[chat_id]['Approve'],
                 '🖤 ' + languages[chat_id]['Reject'])
    for player_id in expeditors:
        bot_send_message(player_id,
                         languages[chat_id]['Your choice in expedition?'],
                         reply_markup=keyboard)
Example #4
0
def vote_for_exp(expeditors, chat_id):
    keyboard = telebot.types.ReplyKeyboardMarkup(one_time_keyboard=True)
    keyboard.row('👍' + languages[chat_id]['I like this expedition'],
                 '👎🏿' + languages[chat_id]['I don`t like it'])
    for player_id in expeditors:
        bot_send_message(player_id,
                         languages[chat_id]['Do you like this expedition?'],
                         reply_markup=keyboard)
Example #5
0
def lady_check(chat_id, game_info):
    if not game_info.lady_lake:
        return
    bot_send_message(chat_id, "It is time for Lady of the Lake to check.")
    keyboard = telebot.types.InlineKeyboardMarkup()
    for player in game_info.order:
        if player not in game_info.past_lady:
            cur_button = telebot.types.InlineKeyboardButton(
                text='\n@' +
                str(bot.get_chat_member(chat_id, player).user.username),
                callback_data=str(player) + ' ' + str(chat_id))
            keyboard.add(cur_button)
    bot_send_message(game_info.order[game_info.cur_lady],
                     "Who do you want to check?",
                     reply_markup=keyboard)
Example #6
0
def endgame(chat_id, game_info, dead_id):
    if game_info.players[dead_id] == 'Merlin':
        bot_send_message(chat_id, 'Merlin was killed')
    else:
        try:
            bot_send_message(
                chat_id, 'Merlin is alive!\n' + game_info.players[dead_id] +
                ' was killed')
        except KeyError:
            return
    string = ''
    for item in game_info.players.items():
        string += '\n@' + bot.get_chat_member(chat_id, item[0]).user.username + ' was ' + \
                  ('❤️' if item[1] in tools.GameInfo.peaceful else '🖤') + item[1]
    bot_send_message(chat_id, 'Roles in this game:' + string)
Example #7
0
        all_info = zip(titles, links, companys)
        for (t, l, c) in all_info:
            alist.append("{} : {}".format(t, c))
        return alist
    except Exception as a:
        print("Error detail ", a)


update = 0

last_update = bot.retrieve_LastMessage()['update_id']

# message = fetch_job()
# print(message)
while True:

    last_msg = bot.retrieve_LastMessage()
    Userid = last_msg['message']['from']['id']
    name = last_msg['message']['from']['first_name']
    chat = last_msg['message']['text']
    update_id = last_msg['update_id']

    if (last_update + update == update_id):
        update = update + 1
        if "hello" in chat.lower() or "hi" in chat.lower():
            message = "Hello {}".format(name)
            res = bot.bot_send_message(message, Userid)
        if "getjob" in chat.lower():
            message = fetch_job()
            res = bot.bot_send_message(message, Userid)