Skip to content

Commit

Permalink
Merge pull request #63 from EncryptEx/revert-62-FEAT/Femtolink-metric…
Browse files Browse the repository at this point in the history
…s-enhancement

Revert "FEAT: Added femtolink integration to graph images"
  • Loading branch information
EncryptEx committed Oct 10, 2023
2 parents 27885d5 + ddd9f18 commit 9dd4f09
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ OWNER=12345
ANNOUNCEMENTS=
SECURITYGUILD=
SECURITY=
BANNEDWORDS=
FEMTOLINK=
BANNEDWORDS=
23 changes: 9 additions & 14 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import base64
import datetime
import json
import os
import sqlite3
import sys
import requests
import urllib
from email import message
from os import listdir
from os.path import isfile
from os.path import join
from pydoc import describe
from time import time

import discord
Expand All @@ -24,7 +27,6 @@
from get_enviroment import SECURITY_CHANNEL
from get_enviroment import SECURITY_GUILD
from get_enviroment import SWEAR_WORDS_LIST
from get_enviroment import FEMTOLINK
from get_enviroment import TOKEN

# Language Loading
Expand Down Expand Up @@ -1648,18 +1650,11 @@ async def metrics(ctx):
if len(uurl) < 2048:
embed.set_image(url=uurl)
else:
headers = {
'Authorization': f"Bearer {FEMTOLINK}",
'Content-Type': 'application/json',
}

data ='{ "long_url": "' + uurl + '" }'

response = requests.post('https://femtolink.jaumelopez.dev/api/link', headers=headers, data=data)


embed.set_image(url=response.json()['link'])

rest = uurl
i = 1020
while len(rest) > 0:
await ctx.respond(rest[:i])
rest = rest[i:]
embed.set_footer(
text=await GetTranslatedText(ctx.guild.id,
"footer_executed_by",
Expand Down
1 change: 0 additions & 1 deletion get_enviroment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@
SECURITY_GUILD = os.getenv("SECURITYGUILD")
SECURITY_CHANNEL = os.getenv("SECURITY")
SWEAR_WORDS_LIST = os.getenv("BANNEDWORDS", "").split(",")
FEMTOLINK = os.getenv("FEMTOLINK", "")

0 comments on commit 9dd4f09

Please sign in to comment.