Files
discord-jeeves/jeevesbot/functions.py

20 lines
524 B
Python
Raw Normal View History

2021-06-06 22:08:18 +02:00
#!/usr/bin/env python 3
from jeevesbot import env
import aiohttp
2021-06-06 22:08:18 +02:00
import dice
# This function is necessary for tenor, because they do not allow linking directly to the gif and need resolving. ASYNC VERSION
async def resolve(url):
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
message = response.url
2021-06-13 14:01:23 +02:00
return str(message)
2021-06-06 22:08:18 +02:00
2021-06-07 17:10:47 +02:00
# use the dice module for rolling.
2021-06-06 22:08:18 +02:00
def roll(notation):
roll = dice.roll(notation)
result = int(roll)
return roll,result