-
Notifications
You must be signed in to change notification settings - Fork 11
/
Main.py
59 lines (48 loc) · 1.72 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
53
54
55
56
57
58
59
"""
mainfile, initializes everything
"""
# function declarations
from Communication.Connection import Connection
from Controler import ActivityObserver
from Controler import GoogleObserver
from Controler import PingAnswerObserver
from Controler import SeenObserver
from Controler import TitleObserver
from Controler import WikiObserver
from Controler import UserList
from Controler.CustomUserModules import ModmailObserver
from Model.ConnectionDetails import ConnectionDateils
import _thread
def setup():
connection = Connection(ConnectionDateils(True))
connection.establish()
_thread.start_new_thread(connection.singleton().sender,())
userList = UserList.UserList()
Connection.singleton().receive()
data = Connection.singleton().last_data()
while -1 == data.find('353'):
Connection.singleton().receive()
data = Connection.singleton().last_data()
Connection.singleton().observeJoin(userList)
Connection.singleton()._join.input_names(data)
Connection.singleton().observeKick(userList)
Connection.singleton().observeLeave(userList)
Connection.singleton().observePing(PingAnswerObserver.ModulePing())
Connection.singleton().observePrivmsg(ActivityObserver.AcitivityObserver())
Connection.singleton().observePrivmsg(SeenObserver.SeenObserver())
Connection.singleton().observePrivmsg(TitleObserver.TitleObserver())
Connection.singleton().observePrivmsg(WikiObserver.WikiObserver())
Connection.singleton().observePrivmsg(ModmailObserver.ModmailObserver())
def run():
running = True
while running:
if Connection.singleton().receive() == False:
return
def cleanup():
pass
# starting of bot
def main():
setup()
run()
cleanup()
main()