Beispiel #1
0
 def send_message(message):
     global admin_mesage
     db_worker = SQLStudents(database_name)
     students = db_worker.select_all()
     for student in students:
         bot.send_message(student[0], admin_mesage)
     markup = data.buttons.button_admin()
     bot.send_message(message.chat.id, 'Пост отправлен', reply_markup=markup)
     admin_mesage = '' ''
Beispiel #2
0
 def start_message(message):
     db_worker = SQLStudents(database_name)
     if db_worker.chek_database(message.chat.id) == False:
         add_student(message.chat.id)
     else:
         if message.chat.id in admin:
             bot.send_message(message.chat.id, myString.help_for_admin)
         else:
             bot.send_message(message.chat.id, myString.help_for_users)
     db_worker.close()
Beispiel #3
0
 def button(message):
     db_worker = SQLStudents(database_name)
     if db_worker.chek_database(message.chat.id) == False:
         add_student(message.chat.id)
     else:
         if message.chat.id in admin:
             markup = data.buttons.button_admin()
         else:
             markup = data.buttons.button_days()
         bot.send_message(message.chat.id, "Кнопки добавлены", reply_markup=markup)
     db_worker.close()
Beispiel #4
0
 def counter_users(message):
     db_worker = SQLStudents(database_name)
     bot.send_message(message.chat.id, db_worker.counts_row())
     students = db_worker.select_all()
     for student in students:
         bot.send_message(message.chat.id, str(student[0]) + " " + str(student[1]) + " " + str(student[2]) + " " + str(student[3]))
     db_worker.close()
Beispiel #5
0
 def student(message):
     if message.chat.id in admin:
         markup = data.buttons.button_admin()
     else:
         markup = data.buttons.button_days()
     msg = bot.send_message(message.chat.id, "Спасибо, " + message.chat.first_name, reply_markup=markup)
     user = User()
     user.message(msg)
     user.getNumberGroup(message.text)
     db_worker = SQLStudents(database_name)
     db_worker.insert_students(user)
     db_worker.close()
Beispiel #6
0
 def send_timetable_wednesday(message):
     db_worker = SQLStudents(database_name)
     if db_worker.chek_database(message.chat.id) == False:
         add_student(message.chat.id)
     else:
         student = db_worker.select_id(message.chat.id)
         bot.send_message(message.chat.id, 'Среда\n')
         if student.number == 'KН36Г':
             bot.send_message(message.chat.id, myString.wednesday_kn36g)
         if student.number == 'KН36Д':
             bot.send_message(message.chat.id, myString.wednesday_kn36d)
         if student.number == 'KН36Е':
             bot.send_message(message.chat.id, myString.wednesday_kn36e)
     db_worker.close()
Beispiel #7
0
 def start_message(message):
     bot.send_message(message.chat.id, myString.start)
     db_worker = SQLStudents(database_name)
     if db_worker.chek_database(message.chat.id) == False:
         add_student(message.chat.id)
     db_worker.close()