mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-14 01:51:22 +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:
|
||||
banned = False
|
||||
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
|
||||
|
||||
def check_guild_existance(guild_id):
|
||||
|
@ -140,6 +140,11 @@ class DiscordREST:
|
||||
r = self.request("PATCH", _endpoint, data=kwargs, json=True)
|
||||
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
|
||||
#####################
|
||||
|
Loading…
Reference in New Issue
Block a user