-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbot.py
41 lines (30 loc) · 966 Bytes
/
bot.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
import asyncio
import sys
from ircrobots import Bot as BaseBot
from ircrobots import ConnectionParams
from ircrobots.security import TLS_NOVERIFY
try:
import config
except ImportError:
print("You forgot to move the config.py file")
sys.exit()
if config.DNS_SERVER == 'powerdns':
from zonebot.powerdns import PowerDNSZoneBot as Server
elif config.DNS_SERVER == 'tinydns':
from zonebot.tinydns import TinyDNSZoneBot as Server
elif config.DNS_SERVER == 'hellomouse':
from zonebot.hellomouse import HellomouseZoneBot as Server
SERVERS = [
("piss", config.SERVER),
]
class Bot(BaseBot):
def create_server(self, name: str):
return Server(self, name, config=config)
async def main():
bot = Bot()
for name, host in SERVERS:
params = ConnectionParams(config.NICK, host, 6697, tls=TLS_NOVERIFY)
await bot.add_server(name, params)
await bot.run()
if __name__ == "__main__":
asyncio.run(main())