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.guild_id == guild_id) \
|
||||||
.filter(GuildMembers.user_id == usr.id) \
|
.filter(GuildMembers.user_id == usr.id) \
|
||||||
.filter(GuildMembers.active == False).first()
|
.filter(GuildMembers.active == False).first()
|
||||||
|
changed = True
|
||||||
if dbusr:
|
if dbusr:
|
||||||
changed = True
|
|
||||||
dbusr.banned = True
|
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:
|
if changed:
|
||||||
session.commit()
|
session.commit()
|
||||||
|
Loading…
Reference in New Issue
Block a user