Add thread when doing long tasks
This commit is contained in:
parent
f676ce11c6
commit
69c5d06ed7
5 changed files with 205 additions and 114 deletions
|
@ -62,8 +62,8 @@ class Credits:
|
|||
now = datetime.now() + self.randsec
|
||||
if self.lastmessage.minute == now.minute and (self.lastmessage.second == now.second or self.lastmessage.second == now.second - 1):
|
||||
print("AUTOBAN %s: too low time between messages" % self.name)
|
||||
BANLIST.append(self.name)
|
||||
#self.credits -= self.credits / 2 #Une alternative
|
||||
#BANLIST.append(self.name)
|
||||
self.credits -= self.credits / 2 #Une alternative
|
||||
return False
|
||||
|
||||
self.iask = True
|
||||
|
@ -169,6 +169,10 @@ class Message:
|
|||
self.cmd = "UNKNOWN"
|
||||
print (line)
|
||||
|
||||
@property
|
||||
def is_owner(self):
|
||||
return self.sender == self.srv.owner
|
||||
|
||||
|
||||
def send_msg (self, channel, msg, cmd = "PRIVMSG", endl = "\r\n"):
|
||||
if CREDITS[self.realname].speak():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue