Compare commits
No commits in common. "8b09a8b9e754aa02fa4fca87df7d7a32d3af6889" and "c22ee5ee37d2c2d8e4a5d8a046cbdc6c47fb6b4f" have entirely different histories.
8b09a8b9e7
...
c22ee5ee37
|
@ -13,11 +13,7 @@ BTC_URI = "https://api.coindesk.com/v1/bpi/currentprice/{CUR_TO}.json"
|
||||||
@commands('cur', 'currency', 'exchange')
|
@commands('cur', 'currency', 'exchange')
|
||||||
@example('.cur 20 EUR to USD')
|
@example('.cur 20 EUR to USD')
|
||||||
def exchange(bot, trigger):
|
def exchange(bot, trigger):
|
||||||
"""
|
"""Show the exchange rate between two currencies"""
|
||||||
Show the exchange rate between two currencies.
|
|
||||||
|
|
||||||
Supported currencies: https://www.exchangerate-api.com/supported-currencies
|
|
||||||
"""
|
|
||||||
amount = trigger.group(3)
|
amount = trigger.group(3)
|
||||||
cur_from = trigger.group(4)
|
cur_from = trigger.group(4)
|
||||||
cur_to = trigger.group(5)
|
cur_to = trigger.group(5)
|
||||||
|
|
|
@ -8,28 +8,10 @@ from html.parser import HTMLParser
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from module import hook, url_callback
|
from module import hook
|
||||||
|
|
||||||
HEADERS = {"User-Agent": "bix nood gimme the title", "Range": "bytes=0-4096"}
|
HEADERS = {"User-Agent": "bix nood gimme the title", "Range": "bytes=0-4096"}
|
||||||
|
|
||||||
@url_callback('puu.sh/')
|
|
||||||
def get_puush_fname(bot, url):
|
|
||||||
"""
|
|
||||||
Callback puu.sh links. Gets the filename and displays it.
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
res = requests.head(url)
|
|
||||||
except requests.exceptions.RequestException:
|
|
||||||
return
|
|
||||||
|
|
||||||
fname = res.headers.get('Content-Disposition', '')
|
|
||||||
fname = re.search(r'\"(.*)\"', fname).group(1)
|
|
||||||
if not fname:
|
|
||||||
return
|
|
||||||
|
|
||||||
bot.msg(f"[ \x0310puu.sh \x03] - \x0304{fname}")
|
|
||||||
|
|
||||||
|
|
||||||
@hook(True)
|
@hook(True)
|
||||||
def title_auto(bot, trigger):
|
def title_auto(bot, trigger):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user