Compare commits
2 Commits
bf58b6abcf
...
403f7e9e2d
Author | SHA1 | Date |
---|---|---|
randomuser | 403f7e9e2d | |
randomuser | f7ad09480b |
16
main.py
16
main.py
|
@ -9,19 +9,15 @@ from db import DuckStats
|
|||
|
||||
from channels import ChannelDB
|
||||
|
||||
from lang import lang
|
||||
|
||||
from admin import Admin
|
||||
|
||||
from irctokens import build, Line
|
||||
from ircrobots import Bot as BaseBot
|
||||
from ircrobots import Server as BaseServer
|
||||
from ircrobots import ConnectionParams
|
||||
|
||||
lang = {
|
||||
"noduck": "there was no duck! you missed by {} seconds!",
|
||||
"noduckstart": "there was no duck!",
|
||||
"duckcought": "duck has been cought by {} in channel {} in {} seconds!",
|
||||
"duck": "・゜゜・。。・゜゜\_o< QUACK!",
|
||||
"stats": "{} has befriended {} ducks in {} different channels, having a befriend/loss ratio of {}.",
|
||||
}
|
||||
|
||||
class DuckLogic:
|
||||
async def new_duck(self):
|
||||
self.messages = 0
|
||||
|
@ -30,7 +26,7 @@ class DuckLogic:
|
|||
await self.msgall(lang["duck"])
|
||||
|
||||
async def duck_test(self):
|
||||
if self.messages > 1 and random.randint(0, 99) < 10: await self.new_duck()
|
||||
if self.messages > 100 and random.randint(0, 99) < 10: await self.new_duck()
|
||||
|
||||
async def misstime(self):
|
||||
return format(time.time() - self.lastduck, '.2f')
|
||||
|
@ -83,7 +79,7 @@ class Server(BaseServer, DuckLogic):
|
|||
user = line.hostmask.nickname
|
||||
args = line.params[1].split(' ')[1:]
|
||||
if cmd == "bef": await self.duck_action(user, chan)
|
||||
elif cmd == "trigger": await self.new_duck()
|
||||
# elif cmd == "trigger": await self.new_duck()
|
||||
elif cmd == "stats":
|
||||
db = DuckDB(self.db)
|
||||
stats = DuckStats(db)
|
||||
|
|
Loading…
Reference in New Issue