-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.py
30 lines (22 loc) · 848 Bytes
/
index.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
import logging
import signal
import sys
from neonize.client import NewClient
from neonize.events import ConnectedEv, PairStatusEv
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
def interrupted(*_):
log.info("Bot interrumpido")
sys.exit(0)
signal.signal(signal.SIGINT, interrupted)
# Crear la sesión
client = NewClient("komodo_session.sqlite3")
@client.event(ConnectedEv)
def on_connected(client: NewClient, event: ConnectedEv):
log.info("✧━━━━━━ KOMODO BOT PY 🌅 ━━━━━━✧ ------------------------------------------------------------------ LISTO, BOT CONECTADO CON EXITO!! ✅")
@client.event(PairStatusEv)
def on_pair_status(client: NewClient, event: PairStatusEv):
log.info(f"Emparejado como {event.ID.User}")
import whisp
whisp.initialize(client)
client.connect()