2022-10-18 19:17:36 +10:00
|
|
|
import logging
|
2022-12-10 02:02:59 +10:00
|
|
|
import graypy
|
|
|
|
|
2022-12-05 17:22:23 +10:00
|
|
|
from aiogram import executor
|
2022-12-09 19:20:50 +10:00
|
|
|
|
2022-12-10 02:02:59 +10:00
|
|
|
from create_bot import dp
|
2022-12-06 22:20:38 +10:00
|
|
|
from handlers import pipisa, time_new_year, start_help
|
2022-12-09 19:20:50 +10:00
|
|
|
from othersq import sendnot
|
2022-11-08 20:43:34 +10:00
|
|
|
|
2022-11-07 17:11:33 +10:00
|
|
|
|
2022-12-10 02:15:32 +10:00
|
|
|
|
|
|
|
class TagFilter(logging.Filter):
|
|
|
|
def __init__(self):
|
|
|
|
self.tag = 'jack_bot'
|
|
|
|
|
|
|
|
def filter(self, record):
|
|
|
|
record.tag = self.tag
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
2022-12-10 02:20:22 +10:00
|
|
|
logging.basicConfig(
|
|
|
|
level = logging.DEBUG,
|
|
|
|
handlers = [ graypy.GELFUDPHandler('localhost', 12201) ]
|
|
|
|
)
|
2022-12-10 02:25:43 +10:00
|
|
|
( logging.getLogger( ) ).addFilter(TagFilter())
|
|
|
|
#logging.LoggerAdapter(logging.getLogger( ), {'tag': 'jack_bot'})
|
2022-12-10 02:20:22 +10:00
|
|
|
#root_logger = logging.getLogger( )
|
2022-10-18 19:17:36 +10:00
|
|
|
|
2022-12-10 02:20:22 +10:00
|
|
|
#handler = graypy.GELFUDPHandler('localhost', 12201)
|
|
|
|
#root_logger.addHandler(handler)
|
|
|
|
#root_logger.addFilter(TagFilter())
|
2022-12-10 02:15:32 +10:00
|
|
|
|
2022-11-12 20:36:08 +10:00
|
|
|
|
2022-12-09 19:20:50 +10:00
|
|
|
|
2022-12-05 17:22:23 +10:00
|
|
|
pipisa.register_handlers_pipisa(dp)
|
|
|
|
time_new_year.register_handlers_time(dp)
|
|
|
|
start_help.register_handlers_StartHelp(dp)
|
2022-12-09 19:20:50 +10:00
|
|
|
sendnot.register_handlers_sendnotal(dp)
|
2022-10-30 20:49:19 +10:00
|
|
|
|
|
|
|
|
2022-11-01 18:52:08 +10:00
|
|
|
|
2022-10-18 19:17:36 +10:00
|
|
|
if __name__ == '__main__':
|
|
|
|
executor.start_polling(dp, skip_updates=True)
|
2022-12-04 15:45:15 +10:00
|
|
|
|
2022-10-18 19:17:36 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|