syntax fix for other python versions

This commit is contained in:
2021-06-13 14:01:23 +02:00
parent 4f0b7d7ef4
commit 5facd8b5a5
2 changed files with 4 additions and 4 deletions

View File

@@ -20,8 +20,8 @@ client = discord.Client()
e = discord.Embed() e = discord.Embed()
# setup gspread # setup gspread
scope = ['https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/drive'] scope = ['https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name('jeevesbot/secret.json', scope) # creds = ServiceAccountCredentials.from_json_keyfile_name('jeevesbot/secret.json', scope)
gclient = gspread.authorize(creds) # gclient = gspread.authorize(creds)
@client.event @client.event
async def on_message(message): async def on_message(message):
@@ -41,7 +41,7 @@ async def on_message(message):
channel = functions.checkchannel(message.channel.id) channel = functions.checkchannel(message.channel.id)
embed_url = message.content embed_url = message.content
follow_url = embed_url + '.gif' follow_url = embed_url + '.gif'
full_url = asyncio.run(functions.resolve(follow_url)) full_url = await functions.resolve(follow_url)
gif_url = full_url.split('?')[0] gif_url = full_url.split('?')[0]
embed = e.set_image(url=gif_url) embed = e.set_image(url=gif_url)
if channel is True: if channel is True:

View File

@@ -14,7 +14,7 @@ async def resolve(url):
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.get(url) as response: async with session.get(url) as response:
message = response.url message = response.url
return message return str(message)
# use the dice module for rolling. # use the dice module for rolling.
def roll(notation): def roll(notation):