forked from rDrama/rDrama
fdsfs
parent
dc0285206c
commit
0dd5c42776
|
@ -44,13 +44,6 @@ def add_role(user, role_name):
|
||||||
headers = {"Authorization": f"Bot {BOT_TOKEN}"}
|
headers = {"Authorization": f"Bot {BOT_TOKEN}"}
|
||||||
requests.put(url, headers=headers)
|
requests.put(url, headers=headers)
|
||||||
|
|
||||||
@discord_wrap
|
|
||||||
def delete_role(user, role_name):
|
|
||||||
role_id = ROLES[role_name]
|
|
||||||
url = f"https://discordapp.com/api/guilds/{SERVER_ID}/members/{user.discord_id}/roles/{role_id}"
|
|
||||||
headers = {"Authorization": f"Bot {BOT_TOKEN}"}
|
|
||||||
requests.delete(url, headers=headers)
|
|
||||||
|
|
||||||
@discord_wrap
|
@discord_wrap
|
||||||
def remove_user(user):
|
def remove_user(user):
|
||||||
url=f"https://discordapp.com/api/guilds/{SERVER_ID}/members/{user.discord_id}"
|
url=f"https://discordapp.com/api/guilds/{SERVER_ID}/members/{user.discord_id}"
|
||||||
|
|
|
@ -220,7 +220,7 @@ def sanitize(sanitized, noimages=False):
|
||||||
for i in re.finditer('<p>:([^ ]{1,30}?):</p>', sanitized):
|
for i in re.finditer('<p>:([^ ]{1,30}?):</p>', sanitized):
|
||||||
emoji = i.group(1).lower()
|
emoji = i.group(1).lower()
|
||||||
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
|
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
|
||||||
sanitized = sanitized.replace(f'<p>:{emoji}:</p>', f'<p style="margin-bottom:0;"><img loading="lazy" data-toggle="tooltip" title="{emoji}" delay="0" height=60 src="https://{site}/assets/images/emojis/{emoji}.webp"></p>')
|
sanitized = sanitized.replace(f'<p>:{emoji}:</p>', f'<p style="margin-bottom:0;"><img loading="lazy" data-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=60 src="https://{site}/assets/images/emojis/{emoji}.webp"></p>')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
|
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
|
||||||
|
@ -231,7 +231,7 @@ def sanitize(sanitized, noimages=False):
|
||||||
for i in re.finditer(':([^ ]{1,30}?):', sanitized):
|
for i in re.finditer(':([^ ]{1,30}?):', sanitized):
|
||||||
emoji = i.group(1).lower()
|
emoji = i.group(1).lower()
|
||||||
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
|
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
|
||||||
sanitized = sanitized.replace(f':{emoji}:', f'<img loading="lazy" data-toggle="tooltip" title="{emoji}" delay="0" height=30 src="https://{site}/assets/images/emojis/{emoji}.webp">')
|
sanitized = sanitized.replace(f':{emoji}:', f'<img loading="lazy" data-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=30 src="https://{site}/assets/images/emojis/{emoji}.webp">')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
|
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
|
||||||
|
|
Loading…
Reference in New Issue