add db.DuckStats.channels(nick) method

This commit is contained in:
randomuser 2021-07-21 00:17:24 -05:00
parent 35e3df7b27
commit 4bfd8b2dd1
1 changed files with 6 additions and 0 deletions

6
db.py
View File

@ -78,3 +78,9 @@ class DuckStats:
def ratio(self, nick): def ratio(self, nick):
return (self.cought(nick) / self.missed(nick)) * 100 return (self.cought(nick) / self.missed(nick)) * 100
def channels(self, nick):
channels = set()
for i in self.db.db:
if i.nick = nick: channels.append(i.channel)
return len(channels)