def unwatch(bot, chat_id):
    watches = main.getAllWatches()
    if ',' + str(chat_id) + ':' + watchedCommandName + ',' in watches or ',' + str(chat_id) + ':' + watchedCommandName in watches:
        main.removeFromAllWatches(str(chat_id) + ':' + watchedCommandName)
        bot.sendMessage(chat_id=chat_id, text='Watch for /' + watchedCommandName + ' has been removed.')
    else:
        bot.sendMessage(chat_id=chat_id, text='Watch for /' + watchedCommandName + ' not found.')
    if getWatchValue(chat_id) != '':
        setWatchValue(chat_id, '')
示例#2
0
def unwatch(bot, chat_id, message):
    watches = main.getAllWatches()
    if ',' + str(chat_id) + ':' + getgif.CommandName + ':' + message + ',' in watches or \
            watches.startswith(str(chat_id) + ':' + getgif.CommandName + ':' + message + ',') or \
            watches.endswith(',' + str(chat_id) + ':' + getgif.CommandName + ':' + message) or \
                    watches == str(chat_id) + ':' + getgif.CommandName + ':' + message:
        main.removeFromAllWatches(str(chat_id) + ':' + getgif.CommandName + ':' + message)
        bot.sendMessage(chat_id=chat_id, text='Watch for /' + getgif.CommandName + ' ' + message + ' has been removed.')
    else:
        bot.sendMessage(chat_id=chat_id, text='Watch for /' + getgif.CommandName + ' ' + message + ' not found.')
示例#3
0
def unwatch(bot, chat_id, message):
    watches = main.getAllWatches()
    if ',' + str(chat_id) + ':' + getlink.CommandName + ':' + message + ',' in watches or \
            watches.startswith(str(chat_id) + ':' + getlink.CommandName + ':' + message + ',') or \
            watches.endswith(',' + str(chat_id) + ':' + getlink.CommandName + ':' + message) or \
                    watches == str(chat_id) + ':' + getlink.CommandName + ':' + message:
        main.removeFromAllWatches(str(chat_id) + ':' + getlink.CommandName + ':' + message)
        bot.sendMessage(chat_id=chat_id, text='Watch for /' + getlink.CommandName + ' ' + message + ' has been removed.')
    else:
        bot.sendMessage(chat_id=chat_id, text='Watch for /' + getlink.CommandName + ' ' + message + ' not found.')
示例#4
0
def unwatch(bot, chat_id, message):
    watches = main.getAllWatches()
    if ',' + str(chat_id) + ':' + watchedCommandName + ':' + message + ',' in watches or ',' + str(chat_id) + \
            ':' + watchedCommandName + ':' + message in watches:
        main.removeFromAllWatches(
            str(chat_id) + ':' + watchedCommandName + ':' + message)
        bot.sendMessage(chat_id=chat_id,
                        text='Watch for /' + watchedCommandName + ' ' +
                        message + ' has been removed.')
    else:
        bot.sendMessage(chat_id=chat_id,
                        text='Watch for /' + watchedCommandName + ' ' +
                        message + ' not found.')
    if getWatchValue(chat_id, message) != '':
        setWatchValue(chat_id, message, '')