Exemple #1
0
 def updaters():
     global timeouts
     timeouts = flood_protection.Spam_settings()
     conn = sqlite3.connect(self.mount_point + 'coders1.db')
     c = conn.cursor()
     c.execute('SELECT id, HE, HR, CC, SP, CF FROM handles')
     self.utility.update_function(c)
     conn.commit()
     conn.close()
     for chat_id in self.admin_list:
         self.bot.send_message(chat_id=chat_id, text="Data updated")
         time.sleep(1)
Exemple #2
0
"""
Created by Gotham on 04-08-2018.
"""
from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, Filters
import flood_protection
import sqlite3
import json
import time
import os
from utility import Utility
timeouts = flood_protection.Spam_settings()
BDC, DB, CF = range(12000, 12003)


class AdminHandle:
    def __init__(self, mount_point, admin_list, fallback):
        self.admin_list = admin_list
        self.mount_point = mount_point
        self.utility = Utility(mount_point)
        self.conv_handler1 = ConversationHandler(
            entry_points=[CommandHandler('broadcast', self.broadcast)],
            allow_reentry=True,
            states={
                BDC: [MessageHandler(Filters.text, self.broadcast_message)]
            },
            fallbacks=[fallback]
        )
        self.conv_handler2 = ConversationHandler(
            entry_points=[CommandHandler('senddb', self.getDb)],
            allow_reentry=True,
            states={