mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-25 06:27:03 +01:00
Add authencated user ban check
This commit is contained in:
parent
21bff1d6ac
commit
11996427fa
@ -36,7 +36,11 @@ def checkUserBanned(guild_id, ip_address=None):
|
|||||||
if usr.lifter_id is not None:
|
if usr.lifter_id is not None:
|
||||||
banned = False
|
banned = False
|
||||||
else:
|
else:
|
||||||
pass #todo: handle authenticated user banned status
|
banned = False
|
||||||
|
bans = discord_api(guild_id)
|
||||||
|
for user in bans:
|
||||||
|
if session['user_id'] == user['id']:
|
||||||
|
return True
|
||||||
return banned
|
return banned
|
||||||
|
|
||||||
def check_guild_existance(guild_id):
|
def check_guild_existance(guild_id):
|
||||||
|
@ -140,6 +140,11 @@ class DiscordREST:
|
|||||||
r = self.request("PATCH", _endpoint, data=kwargs, json=True)
|
r = self.request("PATCH", _endpoint, data=kwargs, json=True)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
def get_guild_bans(self, guild_id):
|
||||||
|
_endpoint = "/guilds/{guild_id}/embed".format(guild_id=guild_id)
|
||||||
|
r = self.request("GET", _endpoint)
|
||||||
|
return r
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# User
|
# User
|
||||||
#####################
|
#####################
|
||||||
|
Loading…
Reference in New Issue
Block a user