forked from coder2020official/pyLivegramBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
52 lines (42 loc) · 1.35 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import telebot #module for bots
#some plugins that will be connected
from plugins.ban import blocked
from plugins.unban import unblocked
from content.text import text
from content.other import other
from plugins.start import start
from plugins.everyone_message import message_everyone
#database connection and creation
from connection import *
create_db_new()
#main file that registers all commands
#config file
import config
#we use pytelegrambotapi library.
bot = telebot.TeleBot(config.TOKEN)
@bot.message_handler(commands=['start'])
def start2(message):
start(message)
@bot.message_handler(commands=["ban"])
def bloc(message):
blocked(message)
@bot.message_handler(commands=["unban"])
def some(message):
unblocked(message)
@bot.message_handler(commands=["admin_message"])
def reklama(message):
if message.chat.id == config.main_id:
bot.send_message(message.chat.id, "your message to be sent: ")
bot.register_next_step_handler(message, textrek)
else:
pass
def textrek(message):
message_everyone(message)
@bot.message_handler(content_types=['text'])
def tex(message):
text(message)
#photo #stikeri #video
@bot.message_handler(content_types=['photo','sticker','video','audio','voice','location','animation','contact','document','dice','poll'])
def other2(message):
other(message)
bot.polling(none_stop=True)