mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Populate banned user for bot
This commit is contained in:
parent
2ab18abc11
commit
71ec14a609
@ -275,8 +275,21 @@ class DatabaseInterface(object):
|
||||
.filter(GuildMembers.guild_id == guild_id) \
|
||||
.filter(GuildMembers.user_id == usr.id) \
|
||||
.filter(GuildMembers.active == False).first()
|
||||
if dbusr:
|
||||
changed = True
|
||||
if dbusr:
|
||||
dbusr.banned = True
|
||||
else:
|
||||
dbusr = GuildMembers(
|
||||
guild_id,
|
||||
usr.id,
|
||||
usr.name,
|
||||
usr.discriminator,
|
||||
None,
|
||||
usr.avatar,
|
||||
False,
|
||||
True,
|
||||
"[]"
|
||||
)
|
||||
db.session.add(dbusr)
|
||||
if changed:
|
||||
session.commit()
|
||||
|
Loading…
Reference in New Issue
Block a user