Finally tested the code and it works now
This commit is contained in:
parent
941cf81877
commit
25df2228e3
|
@ -311,7 +311,7 @@ class Client:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Make sure that the user is not banned/restricted:
|
# Make sure that the user is not banned/restricted:
|
||||||
privileges = glob.db.fetch("SELECT privileges FROM users WHERE username = %s LIMIT 1", [self.supposedUsername])
|
privileges = glob.db.fetch("SELECT privileges FROM users WHERE username = %s LIMIT 1", [self.supposedUsername])["privileges"]
|
||||||
if privileges & 3 != 3:
|
if privileges & 3 != 3:
|
||||||
self.reply("465 :You're banned")
|
self.reply("465 :You're banned")
|
||||||
return
|
return
|
||||||
|
@ -474,7 +474,7 @@ class Client:
|
||||||
|
|
||||||
# Check if the user is silenced
|
# Check if the user is silenced
|
||||||
# TODO: Maybe don't run a sql query every time
|
# TODO: Maybe don't run a sql query every time
|
||||||
silence_end = glob.db.fetch("SELECT silence_end FROM users WHERE username = %s LIMIT 1", [self.supposedUsername])
|
silence_end = glob.db.fetch("SELECT silence_end FROM users WHERE username = %s LIMIT 1", [self.supposedUsername])["silence_end"]
|
||||||
if silence_end - int(time.time()) > 0:
|
if silence_end - int(time.time()) > 0:
|
||||||
self.reply("404 : You can't send messages.")
|
self.reply("404 : You can't send messages.")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user