Skip to content

Commit

Permalink
Merge pull request #65 from EncryptEx/restyled/FEAT/Femtolink-metrics…
Browse files Browse the repository at this point in the history
…-enhancement

Restyle FEAT: Added shortenlink function and used when necessary
  • Loading branch information
EncryptEx committed Oct 10, 2023
2 parents 7041f34 + a3637fa commit 9b0b9a4
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,17 +373,24 @@ async def SaveSetting(guildid: int, module: str, value: str):
conn.commit()
return


def ShortenLink(link: str):
"""
:param link: str:
"""
headers = {
'Authorization': f"Bearer {FEMTOLINK}",
'Content-Type': 'application/json',
"Authorization": f"Bearer {FEMTOLINK}",
"Content-Type": "application/json",
}

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

response = requests.post('https://femtolink.jaumelopez.dev/api/link', headers=headers, data=data)
return response.json()['link'];

response = requests.post("https://femtolink.jaumelopez.dev/api/link",
headers=headers,
data=data)
return response.json()["link"]


def GenerateChart(datasets):
Expand Down Expand Up @@ -539,7 +546,8 @@ def numToEmoji(num):

def filterMember(member: discord.Member):
"""
:param member: discord.Member:
:param member: discord.Member:
"""
Expand Down

0 comments on commit 9b0b9a4

Please sign in to comment.