Compare commits

..

No commits in common. "88c8827552d1b268bf2c10e281f7b73142a0a3a5" and "25e97a8b9b753aac49fa5277fa620169ed93bfec" have entirely different histories.

3 changed files with 80 additions and 138 deletions

View File

@ -20,7 +20,7 @@ def fork(bot, trigger):
try: try:
r=requests.get(networkurl) r=requests.get(networkurl)
j=r.json() j=r.json()
except Exception as e: except Exception,e:
pass pass
try: try:
height=j["height"] height=j["height"]
@ -37,7 +37,7 @@ def network(bot, trigger):
try: try:
r=requests.get(networkurl) r=requests.get(networkurl)
j=r.json() j=r.json()
except: except Exception,e:
pass pass
try: try:
height=j["height"] height=j["height"]

View File

@ -225,10 +225,10 @@ def krak(bot, trigger):
try: try:
r=requests.get(kraktrig+coin+'XBT') r=requests.get(kraktrig+coin+'XBT')
j=r.json() j=r.json()
stringtosay += "{0} at {1:.8f} on {2:.2f} 24 h {0} volume. ".format(coin, float(j['result']['X'+str(coin)+'XXBT']['c'][0]), float(j['result']['X'+str(coin)+'XXBT']['v'][1])) stringtosay += "{0} at {1:.8f} on {2:.2f} 24 h {0} volume. ".format(coin, float(j['result']['X'+str(coin)+'XXBT']['c'][0]), float(j['result']['X'+str(coin)+'XXBT']['v'][1]))
except: except:
bot.say("Error connecting to Kraken") bot.say("Error connecting to Kraken")
try: try:
bot.say(stringtosay) bot.say(stringtosay)
except: except:
bot.say("Error getting data") bot.say("Error getting data")
@ -243,11 +243,11 @@ def lending(bot, trigger):
currenttime=time.time() currenttime=time.time()
for i in j['offers']: for i in j['offers']:
amnt+=float(i['amount']) amnt+=float(i['amount'])
bot.say("Total amount of XMR available {0:,.2f}. Changed by {1:.2f} in the last {2:.2f} hours".format(amnt, amnt-prevamnt, (currenttime-prevtime)/3600))
global prevamnt global prevamnt
prevamnt=amnt prevamnt=amnt
global prevtime global prevtime
prevtime=currenttime prevtime=currenttime
bot.say("Total amount of XMR available {0:,.2f}. Changed by {1:.2f} in the last {2:.2f} hours".format(amnt, amnt-prevamnt, (currenttime-prevtime)/3600))
except: except:
bot.say("Something bad happened :o") bot.say("Something bad happened :o")
@ -276,6 +276,7 @@ def metal(bot, trigger):
@sopel.module.commands('polo', 'poloniex', 'marco', 'plol') @sopel.module.commands('polo', 'poloniex', 'marco', 'plol')
@sopel.module.interval(3600)
def polo(bot, trigger): def polo(bot, trigger):
if not trigger.group(2): if not trigger.group(2):
try: try:
@ -289,21 +290,21 @@ def polo(bot, trigger):
sign = '+' sign = '+'
else: else:
sign = '' sign = ''
face = u'\u0000' face = ''
if change > 0.10: if change > 0.10:
face = u'\u263d' face = u'\u263d'.encode('utf8')
if 0.10 >= change > 0.05: if 0.10 >= change > 0.05:
face = u'\u2661' face = u'\u2661'.encode('utf8')
if 0.05 >= change > 0.02: if 0.05 >= change > 0.02:
face = u'\u263a' face = u'\u263a'.encode('utf8')
if 0.02 >= change > -0.02: if 0.02 >= change > -0.02:
face = u'\u2694' face = u'\u2694'.encode('utf8')
if -0.02 >= change > -0.05: if -0.02 >= change > -0.05:
face = u'\u2639' face = u'\u2639'.encode('utf8')
if -0.05 >= change > -0.1: if -0.05 >= change > -0.1:
face = u'\u2620' face = u'\u2620'.encode('utf8')
if change < -0.1: if change < -0.1:
face = u'\u262d' face = u'\u262d'.encode('utf8')
bot.say("Poloniex at {0:.8f} BTC; {1}{2:.2f}% over 24 hours on {3:.3f} BTC volume {4}".format(last, sign, change*100, vol, face)) bot.say("Poloniex at {0:.8f} BTC; {1}{2:.2f}% over 24 hours on {3:.3f} BTC volume {4}".format(last, sign, change*100, vol, face))
except: except:
bot.say("Error retrieving data from Poloniex") bot.say("Error retrieving data from Poloniex")
@ -468,8 +469,8 @@ def top(bot, trigger):
elif limit < 1: elif limit < 1:
bot.say("Dude...") bot.say("Dude...")
return return
r = requests.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page={}&page=1&sparkline=false'.format(limit)) r = requests.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page={}&page=1&sparkline=false'.format(limit))
j = r.json() j = r.json()
for i in j: for i in j:
symbol = i['symbol'] symbol = i['symbol']
name = i['name'] name = i['name']
@ -518,7 +519,7 @@ def tall(bot, trigger):
stampresult = requests.get(stampurl) stampresult = requests.get(stampurl)
stampjson = stampresult.json() stampjson = stampresult.json()
except: except:
stampjson = False stampjson = False
if stampjson: if stampjson:
stringtosend += "Bitstamp last: ${0:,.2f}, vol: {1:,.1f} | ".format(float(stampjson['last']), float(stampjson['volume'])) stringtosend += "Bitstamp last: ${0:,.2f}, vol: {1:,.1f} | ".format(float(stampjson['last']), float(stampjson['volume']))
# Gemini # Gemini
@ -526,7 +527,7 @@ def tall(bot, trigger):
gemiresult = requests.get(gemiurl) gemiresult = requests.get(gemiurl)
gemijson = gemiresult.json() gemijson = gemiresult.json()
except: except:
gemijson = False gemijson = False
if gemijson: if gemijson:
try: try:
stringtosend += "Gemini last: ${0:,.2f}, vol: {1:,.1f} | ".format(float(gemijson['last']), float(gemijson['volume']['BTC'])) stringtosend += "Gemini last: ${0:,.2f}, vol: {1:,.1f} | ".format(float(gemijson['last']), float(gemijson['volume']['BTC']))
@ -539,7 +540,7 @@ def tall(bot, trigger):
gdaxprice = float(gdaxjson['price']) gdaxprice = float(gdaxjson['price'])
gdaxvolume = float(gdaxjson['volume']) gdaxvolume = float(gdaxjson['volume'])
except: except:
gdaxjson = False gdaxjson = False
if gdaxjson: if gdaxjson:
stringtosend += "CBP last: ${0:,.2f}, vol: {1:,.1f} | ".format(gdaxprice, gdaxvolume) stringtosend += "CBP last: ${0:,.2f}, vol: {1:,.1f} | ".format(gdaxprice, gdaxvolume)
# Binance # Binance
@ -551,7 +552,7 @@ def tall(bot, trigger):
binanceprice = float(i['lastPrice']) binanceprice = float(i['lastPrice'])
binancevolume = float(i['volume']) binancevolume = float(i['volume'])
except: except:
binancejson = False binancejson = False
if binancejson: if binancejson:
stringtosend += "Binance last: ${0:,.2f}, vol: {1:,.1f} | ".format(binanceprice, binancevolume) stringtosend += "Binance last: ${0:,.2f}, vol: {1:,.1f} | ".format(binanceprice, binancevolume)
# Bitfinex # Bitfinex
@ -559,7 +560,7 @@ def tall(bot, trigger):
finexresult = requests.get(finexurl) finexresult = requests.get(finexurl)
finexjson = finexresult.json() finexjson = finexresult.json()
except: except:
finexjson = False finexjson = False
try: try:
if finexjson: if finexjson:
stringtosend += "Bitfinex last: ${0:,.2f}, vol: {1:,.1f} | ".format(float(finexjson['last_price']), float(finexjson['volume'])) stringtosend += "Bitfinex last: ${0:,.2f}, vol: {1:,.1f} | ".format(float(finexjson['last_price']), float(finexjson['volume']))
@ -658,13 +659,13 @@ def xmrtall(bot, trigger):
# Polo # Polo
try: try:
r=requests.get(polourl) r=requests.get(polourl)
j=r.json() j=r.json()
xmr=j["BTC_XMR"] xmr=j["BTC_XMR"]
last=float(xmr['last']) last=float(xmr['last'])
# change=float(xmr['percentChange']) # change=float(xmr['percentChange'])
vol=float(xmr['baseVolume']) vol=float(xmr['baseVolume'])
stringtosend += "Poloniex last: {0:.6f} BTC on {1:.2f} BTC volume | ".format(last, vol) stringtosend += "Poloniex last: {0:.6f} BTC on {1:.2f} BTC volume | ".format(last, vol)
except: except:
bot.say("Something borked ¯\(º_o)/¯") bot.say("Something borked ¯\(º_o)/¯")

View File

@ -6,7 +6,7 @@ import requests
import praw import praw
import client import client
from threading import Timer from threading import Timer
from html.parser import HTMLParser from HTMLParser import HTMLParser
@sopel.module.commands('4matter') @sopel.module.commands('4matter')
def fourmatter(bot, trigger): def fourmatter(bot, trigger):
@ -77,7 +77,7 @@ def bbl(bot, trigger):
@sopel.module.commands('bear') @sopel.module.commands('bear')
def bear(bot, trigger): def bear(bot, trigger):
bot.say(u'ʕ ·(エ)· ʔ') bot.say(u'ʕ ·(エ)· ʔ'.encode('utf8'))
@sopel.module.commands('billions') @sopel.module.commands('billions')
def billions(bot, trigger): def billions(bot, trigger):
@ -85,11 +85,11 @@ def billions(bot, trigger):
@sopel.module.commands('brothers') @sopel.module.commands('brothers')
def brothers(bot, trigger): def brothers(bot, trigger):
bot.say(u'http://www.trollaxor.com/2011/11/brief-history-of-ascii-penis.html') bot.say(u'http://www.trollaxor.com/2011/11/brief-history-of-ascii-penis.html'.encode('utf8'))
@sopel.module.commands('bp', 'bps', 'bulletproof', 'bulletproofs') @sopel.module.commands('bp', 'bps', 'bulletproof', 'bulletproofs')
def bulletproofs(bot, trigger): def bulletproofs(bot, trigger):
bot.say(u'https://www.youtube.com/watch?v=Kk8eJh4i8Lo') bot.say(u'https://www.youtube.com/watch?v=Kk8eJh4i8Lo'.encode('utf8'))
@sopel.module.commands('buyorsell') @sopel.module.commands('buyorsell')
def buyorsell(bot, trigger): def buyorsell(bot, trigger):
@ -186,7 +186,7 @@ def collect(bot, trigger):
value_of_items_collected_in_one_day = quantity * value_of_one_item value_of_items_collected_in_one_day = quantity * value_of_one_item
weekly_coins_to_buy = value_of_items_collected_in_one_day * 7 / coin_price weekly_coins_to_buy = value_of_items_collected_in_one_day * 7 / coin_price
bot.say('{0} price: ${1:,.2f}, and {2} price: ${3:,.2f}'.format(item.capitalize(), value_of_one_item, coin.capitalize(), coin_price)) bot.say('{0} price: ${1:,.2f}, and {2} price: ${3:,.3f}'.format(item.capitalize(), value_of_one_item, coin.capitalize(), coin_price))
bot.say('{0}: collect {1} per day to exchange for {2:,.5f} {3} each week!'.format(item.capitalize(), quantity, weekly_coins_to_buy, coin)) bot.say('{0}: collect {1} per day to exchange for {2:,.5f} {3} each week!'.format(item.capitalize(), quantity, weekly_coins_to_buy, coin))
@sopel.module.commands('covid', 'corona', 'conv') @sopel.module.commands('covid', 'corona', 'conv')
@ -247,7 +247,7 @@ def dash(bot, trigger):
@sopel.module.commands('dealwithit') @sopel.module.commands('dealwithit')
def dealwithit(bot, trigger): def dealwithit(bot, trigger):
bot.say(u'(•_•) ( •_•)>⌐■-■ (⌐■_■)') bot.say(u'(•_•) ( •_•)>⌐■-■ (⌐■_■)'.encode('utf8'))
@sopel.module.commands('Deathtobitcoin', 'Deathtobitcoin2') @sopel.module.commands('Deathtobitcoin', 'Deathtobitcoin2')
def deathtobitcoin2(bot, trigger): def deathtobitcoin2(bot, trigger):
@ -255,11 +255,11 @@ def deathtobitcoin2(bot, trigger):
@sopel.module.commands('diiorio') @sopel.module.commands('diiorio')
def diiorio(bot, trigger): def diiorio(bot, trigger):
bot.say(u'http://www.contravex.com/2016/06/29/from-the-scammer-files-anthony-di-iorio/') bot.say(u'http://www.contravex.com/2016/06/29/from-the-scammer-files-anthony-di-iorio/'.encode('utf8'))
@sopel.module.commands('disapprove') @sopel.module.commands('disapprove')
def disapprove(bot, trigger): def disapprove(bot, trigger):
bot.say(u'ಠ_ಠ') bot.say(u'ಠ_ಠ'.encode('utf8'))
@sopel.module.commands('ded') @sopel.module.commands('ded')
def ded(bot, trigger): def ded(bot, trigger):
@ -283,19 +283,19 @@ def encrypt(bot, trigger):
@sopel.module.commands('eth') @sopel.module.commands('eth')
def eth(bot, trigger): def eth(bot, trigger):
bot.say(u'The world computer 💻🌐') bot.say(u'The world computer 💻🌐'.encode('utf8'))
@sopel.module.commands('ferret', 'ferretinjapan') @sopel.module.commands('ferret', 'ferretinjapan')
def ferret(bot, trigger): def ferret(bot, trigger):
bot.say(u'♥‿♥ https://crypto314.com/wp-content/uploads/2017/09/monero-1505185532555-723x1024.png ♥‿♥') bot.say(u'♥‿♥ https://crypto314.com/wp-content/uploads/2017/09/monero-1505185532555-723x1024.png ♥‿♥'.encode('utf8'))
@sopel.module.commands('fib', 'fibonacci') @sopel.module.commands('fib', 'fibonacci')
def fib(bot, trigger): def fib(bot, trigger):
bot.say(u'Pardon me, do you have a moment to discuss our lord and savior ✞Cheesus Monero✞?') bot.say(u'Pardon me, do you have a moment to discuss our lord and savior ✞Cheesus Monero✞?'.encode('utf8'))
@sopel.module.commands('flip') @sopel.module.commands('flip')
def flip(bot, trigger): def flip(bot, trigger):
bot.say(u'(╯°□°)╯︵ ┻━┻') bot.say(u'(╯°□°)╯︵ ┻━┻'.encode('utf8'))
@sopel.module.commands('fuck') @sopel.module.commands('fuck')
def fuck(bot, trigger): def fuck(bot, trigger):
@ -381,7 +381,7 @@ def jaxx(bot, trigger):
bot.say(u'This command will be implemented soon. Honest. Especially if the devs can provide some unpaid assistance. Soon™...') bot.say(u'This command will be implemented soon. Honest. Especially if the devs can provide some unpaid assistance. Soon™...')
@sopel.module.commands('jimbell') @sopel.module.commands('jimbell')
def jimbell(bot, trigger): def jaxx(bot, trigger):
if not trigger.group(2): if not trigger.group(2):
bot.say(u'https://en.wikipedia.org/wiki/Jim_Bell') bot.say(u'https://en.wikipedia.org/wiki/Jim_Bell')
else: else:
@ -409,15 +409,19 @@ def kramer(bot, trigger):
@sopel.module.commands('lambo') @sopel.module.commands('lambo')
def lambo(bot, trigger): def lambo(bot, trigger):
bot.say(u'Our mission is to give you a taste of the lambo dream 🏎 ') bot.say(u'Our mission is to give you a taste of the lambo dream 🏎 '.encode('utf8'))
@sopel.module.commands('lenny')
def lenny(bot, trigger):
bot.say(u'( ͡° ͜ʖ ͡°)'.encode('utf8'))
@sopel.module.commands('lietome') @sopel.module.commands('lietome')
def lietome(bot, trigger): def lietome(bot, trigger):
bot.say(u'https://www.youtube.com/watch?v=R5AsQbLHWbw') bot.say(u'https://www.youtube.com/watch?v=R5AsQbLHWbw'.encode('utf8'))
@sopel.module.commands('livermore') @sopel.module.commands('livermore')
def livermore(bot, trigger): def livermore(bot, trigger):
bot.say(u'https://en.wikipedia.org/wiki/Reminiscences_of_a_Stock_Operator') bot.say(u'https://en.wikipedia.org/wiki/Reminiscences_of_a_Stock_Operator'.encode('utf8'))
@sopel.module.commands('loki') @sopel.module.commands('loki')
def loki(bot, trigger): def loki(bot, trigger):
@ -425,11 +429,11 @@ def loki(bot, trigger):
@sopel.module.commands('luigi') @sopel.module.commands('luigi')
def luigi(bot, trigger): def luigi(bot, trigger):
bot.say(u'🍄 luigi is doing. mario is not doing luigi is doing 🍄') bot.say(u'🍄 luigi is doing. mario is not doing luigi is doing 🍄'.encode('utf8'))
@sopel.module.commands('ltc', 'chikun') @sopel.module.commands('ltc', 'chikun')
def ltc(bot, trigger): def ltc(bot, trigger):
bot.say(u'🐔🐔🐔 https://cdn.meme.am/cache/instances/folder100/48222100.jpg 🐔🐔🐔') bot.say(u'🐔🐔🐔 https://cdn.meme.am/cache/instances/folder100/48222100.jpg 🐔🐔🐔'.encode('utf8'))
@sopel.module.commands('major') @sopel.module.commands('major')
def major(bot, trigger): def major(bot, trigger):
@ -441,43 +445,43 @@ def masternode(bot, trigger):
@sopel.module.commands('monerov', 'v') @sopel.module.commands('monerov', 'v')
def monerov(bot, trigger): def monerov(bot, trigger):
bot.say(u"🔒🔒🔒 MoneroV is more secured than others. That's why it is better invest on moneroV. 💰💰💰") bot.say(u"🔒🔒🔒 MoneroV is more secured than others. That's why it is better invest on moneroV. 💰💰💰".encode('utf8'))
@sopel.module.commands('moon') @sopel.module.commands('moon')
def moon(bot, trigger): def moon(bot, trigger):
bot.say(u'┗(°0°)┛') bot.say(u'┗(°0°)┛'.encode('utf8'))
@sopel.module.commands('multisig') @sopel.module.commands('multisig')
def multisig(bot, trigger): def multisig(bot, trigger):
bot.say(u'𝓼𝓲𝓰𝓷𝓪𝓽𝓾𝓻𝓮 𝓼𝓲𝓰𝓷𝓪𝓽𝓾𝓻𝓮') bot.say(u'𝓼𝓲𝓰𝓷𝓪𝓽𝓾𝓻𝓮 𝓼𝓲𝓰𝓷𝓪𝓽𝓾𝓻𝓮'.encode('utf8'))
@sopel.module.commands('myriad', 'myr', 'myriadcoin') @sopel.module.commands('myriad', 'myr', 'myriadcoin')
def myriad(bot, trigger): def myriad(bot, trigger):
bot.say(u'Myriad - A coin for everyone 🖐') bot.say(u'Myriad - A coin for everyone 🖐'.encode('utf8'))
@sopel.module.commands('needmoney', 'needmoney90', 'nm90') @sopel.module.commands('needmoney', 'needmoney90', 'nm90')
def needmoney(bot, trigger): def needmoney(bot, trigger):
bot.say(u'cash rules everything around me C.R.E.A.M get the money 💵 💵 bill yall') bot.say(u'cash rules everything around me C.R.E.A.M get the money 💵 💵 bill yall'.encode('utf8'))
@sopel.module.commands('nioc') @sopel.module.commands('nioc')
def nioc(bot, trigger): def nioc(bot, trigger):
bot.say(u'https://ifunny.co/fun/laeIohx56') bot.say(u'https://ifunny.co/fun/laeIohx56'.encode('utf8'))
@sopel.module.commands('nobody') @sopel.module.commands('nobody')
def nobody(bot, trigger): def nobody(bot, trigger):
bot.say('https://www.youtube.com/watch?v=YA631bMT9g8') bot.say('https://www.youtube.com/watch?v=YA631bMT9g8')
@sopel.module.commands('nomnomnom', 'nomnom') @sopel.module.commands('nomnomnom')
def nomnomnom(bot, trigger): def nomnomnom(bot, trigger):
bot.say(u'ᗧ•••ᗣ') bot.say(u'ᗧ•••ᗣ'.encode('utf8'))
@sopel.module.commands('noom') @sopel.module.commands('noom')
def noom(bot, trigger): def noom(bot, trigger):
bot.say(u'┏(.0.)┓') bot.say(u'┏(.0.)┓'.encode('utf8'))
@sopel.module.commands('notbad', 'dorian') @sopel.module.commands('notbad', 'dorian')
def notbad(bot, trigger): def notbad(bot, trigger):
bot.say(u'(´ー`) http://hackingdistributed.com/images/2014-01-01-bitcoin/dorian1.jpg (´ー`)') bot.say(u'(´ー`) http://hackingdistributed.com/images/2014-01-01-bitcoin/dorian1.jpg (´ー`)'.encode('utf8'))
@sopel.module.commands('obama') @sopel.module.commands('obama')
def obama(bot, trigger): def obama(bot, trigger):
@ -553,7 +557,7 @@ def projecting(bot, trigger):
@sopel.module.commands('purge') @sopel.module.commands('purge')
def purge(bot, trigger): def purge(bot, trigger):
bot.say(u'♔♔♔ Bow to the king https://preview.redd.it/fr8q7x9utnzy.png?width=612&auto=webp&s=8bf7aa7674d2dc3157b776ae07771144833cd879 ♔♔♔') bot.say(u'♔♔♔ Bow to the king https://preview.redd.it/fr8q7x9utnzy.png?width=612&auto=webp&s=8bf7aa7674d2dc3157b776ae07771144833cd879 ♔♔♔'.encode('utf8'))
@sopel.module.commands('rarepepe', 'rare') @sopel.module.commands('rarepepe', 'rare')
def rarepepe(bot, trigger): def rarepepe(bot, trigger):
@ -575,11 +579,11 @@ def rarepepe(bot, trigger):
@sopel.module.commands('rip') @sopel.module.commands('rip')
def rip(bot, trigger): def rip(bot, trigger):
bot.say(u'(X_X) ☜ (◉▂◉ ) we hardly knew ye') bot.say(u'(X_X) ☜ (◉▂◉ ) we hardly knew ye'.encode('utf8'))
@sopel.module.commands('risto', 'rpietila') @sopel.module.commands('risto', 'rpietila')
def risto(bot, trigger): def risto(bot, trigger):
bot.say(u'Zionists own the media, including Hollywood. It is nothing extraordinary for them to use it to further their goals. Just see what they are propagating every day in every media outlet. And the compulsory disclaimer: Zionist != Jew. Zionists in my understanding are typically mostly not even ethnic Jews, and the supermajority of Jews certainly are not Zionists. Zionism is a purely political supremacy movement.') bot.say(u'Zionists own the media, including Hollywood. It is nothing extraordinary for them to use it to further their goals. Just see what they are propagating every day in every media outlet. And the compulsory disclaimer: Zionist != Jew. Zionists in my understanding are typically mostly not even ethnic Jews, and the supermajority of Jews certainly are not Zionists. Zionism is a purely political supremacy movement.'.encode('utf8'))
@sopel.module.commands('romerito', 'romero') @sopel.module.commands('romerito', 'romero')
def romerito(bot, trigger): def romerito(bot, trigger):
@ -627,15 +631,19 @@ def scam(bot, trigger):
@sopel.module.commands('soon') @sopel.module.commands('soon')
def soon(bot, trigger): def soon(bot, trigger):
bot.say(u'Two weeks™') bot.say(u'Two weeks™'.encode('utf8'))
@sopel.module.commands('shillo', 'cid') @sopel.module.commands('shillo', 'cid')
def shillo(bot, trigger): def shillo(bot, trigger):
bot.say(u'☠☠☠ Crypto is ded https://i.kym-cdn.com/photos/images/original/001/321/553/f03.jpg ☠☠☠ ') bot.say(u'☠☠☠ Crypto is ded https://i.kym-cdn.com/photos/images/original/001/321/553/f03.jpg ☠☠☠ '.encode('utf8'))
@sopel.module.commands('shrug')
def shrug(bot, trigger):
bot.say(u'¯\_(ツ)_/¯'.encode('utf8'))
@sopel.module.commands('softich') @sopel.module.commands('softich')
def softich(bot, trigger): def softich(bot, trigger):
bot.say(u'🐻🐻🐻 https://imgflip.com/i/1ve397 🐻🐻🐻') bot.say(u'🐻🐻🐻 https://imgflip.com/i/1ve397 🐻🐻🐻'.encode('utf8'))
@sopel.module.commands('summon') @sopel.module.commands('summon')
def summon(bot, trigger): def summon(bot, trigger):
@ -683,14 +691,14 @@ def trivia(bot, trigger):
category = j['results'][0]['category'] category = j['results'][0]['category']
difficulty = j['results'][0]['difficulty'] difficulty = j['results'][0]['difficulty']
question = h.unescape(j['results'][0]['question']) question = h.unescape(j['results'][0]['question'])
answers = [j['results'][0]['correct_answer']] answers = [j['results'][0]['correct_answer']]
for i in j['results'][0]['incorrect_answers']: for i in j['results'][0]['incorrect_answers']:
answers.append(i) answers.append(i)
random.shuffle(answers) random.shuffle(answers)
correct_answer = j['results'][0]['correct_answer'] correct_answer = j['results'][0]['correct_answer']
incorrect_answers = j['results'][0]['incorrect_answers'] incorrect_answers = j['results'][0]['incorrect_answers']
bot.say("This question is in the field of {} and is of {} difficulty: {}".format(category, difficulty, question)) bot.say("This question is in the field of {} and is of {} difficulty: {}".format(category, difficulty, question))
bot.say("The possible answers are: {}, {}, {}, or {}".format(answers[0], answers[1], answers[2], answers[3])) bot.say("The possible answers are: {}, {}, {}, or {}".format(answers[0], answers[1], answers[2], answers[3]))
replystr = "If you said {} you are correct, but if you said {}, {}, or {} you should call your parents and complain.".format(correct_answer, incorrect_answers[0], incorrect_answers[1], incorrect_answers[2]) replystr = "If you said {} you are correct, but if you said {}, {}, or {} you should call your parents and complain.".format(correct_answer, incorrect_answers[0], incorrect_answers[1], incorrect_answers[2])
def f(): def f():
bot.say(replystr) bot.say(replystr)
@ -721,6 +729,10 @@ def trump(bot, trigger):
def trumbleweed(bot, trigger): def trumbleweed(bot, trigger):
bot.say("https://rootco.de/2016-03-28-why-use-tumbleweed/") bot.say("https://rootco.de/2016-03-28-why-use-tumbleweed/")
@sopel.module.commands('unflip')
def unflip(bot, trigger):
bot.say(u'┬─┬ノ( º _ ºノ)'.encode('utf8'))
urmomoptions = [ urmomoptions = [
"ur mom is so stupid she bought all the dash", "ur mom is so stupid she bought all the dash",
"ur momma got a peg leg with a kickstand", "ur momma got a peg leg with a kickstand",
@ -744,7 +756,7 @@ def urmom(bot, trigger):
@sopel.module.commands('verge', 'xvg', 'wraith') @sopel.module.commands('verge', 'xvg', 'wraith')
def verge(bot, trigger): def verge(bot, trigger):
bot.say(u"👻🐕 Don't wraith my dark doge bro! 👻🐕") bot.say(u"👻🐕 Don't wraith my dark doge bro! 👻🐕".encode('utf8'))
vitalikoptions = [ vitalikoptions = [
"https://pbs.twimg.com/media/CrWjczJXgAExF2S.jpg", "https://pbs.twimg.com/media/CrWjczJXgAExF2S.jpg",
@ -790,7 +802,7 @@ def test(bot, trigger):
@sopel.module.rule('monerobux o\/') @sopel.module.rule('monerobux o\/')
def wave(bot, trigger): def wave(bot, trigger):
#bot.reply(u'^ (•_•) ^') #bot.reply(u'^ (•_•) ^'.encode('utf8'))
bot.reply('hello') bot.reply('hello')
#@sopel.module.rule('[Tt]rump') #@sopel.module.rule('[Tt]rump')
#def politics(bot, trigger): #def politics(bot, trigger):
@ -888,79 +900,12 @@ def weather(bot, trigger):
location = "zip="+location location = "zip="+location
else: else:
location = "q="+location.replace(' ', '%20') location = "q="+location.replace(' ', '%20')
r = requests.get('https://api.openweathermap.org/data/2.5/weather?{}&appid={}'.format(location, wk)) r = requests.get('https://api.openweathermap.org/data/2.5/weather?{}&appid={}'.format(location, wk))
j = r.json() j = r.json()
location = j['name']+', '+j['sys']['country']
humidity = j['main']['humidity']
wind_speed_m_s = j['wind']['speed']
wind_deg = j['wind']['deg']
description = j['weather'][0]['description']
temp_in_c = float(j['main']['temp'])-273
low_in_c = float(j['main']['temp_min'])-273
high_in_c = float(j['main']['temp_max'])-273
temp = temp_in_c
low = low_in_c
high = high_in_c
def calculate_bearing(d):
dirs = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW']
ix = int(round(d / (360. / len(dirs))))
return dirs[(ix) % len(dirs)]
direction = calculate_bearing(wind_deg)
try: try:
bot.say("In {} it is {:.1f} C with a low of {:.1f} and high of {:.1f} C, humidity is {}%, winds of {} m/s from the {} with {}.".format(location, temp, low, high, humidity, wind_speed_m_s, direction, description)) bot.say("In {} it is {:.2f} C with a low of {:.2f} and high of {:.2f} C, humidity is {}%, winds of {} m/s at an angle of {} deg with {}.".format(j['name']+', '+j['sys']['country'], float(j['main']['temp'])-273, float(j['main']['temp_min'])-273, float(j['main']['temp_max'])-273, j['main']['humidity'], j['wind']['speed'], j['wind']['deg'], j['weather'][0]['description']))
except: except:
bot.say("In {} it is {:.2f} C with a low of {:.2f} and high of {:.2f} C, humidity is {}%, winds of {} m/s with {}.".format(location, temp, low, high, humidity, wind_speed_m_s, description)) bot.say("In {} it is {:.2f} C with a low of {:.2f} and high of {:.2f} C, humidity is {}%, winds of {} m/s with {}.".format(j['name']+', '+j['sys']['country'], float(j['main']['temp'])-273, float(j['main']['temp_min'])-273, float(j['main']['temp_max'])-273, j['main']['humidity'], j['wind']['speed'], j['weather'][0]['description']))
except:
bot.say("The earth is on fire 🌎🔥")
@sopel.module.commands('weatherf')
def weatherf(bot, trigger):
wk = client.weather_key
try:
if not trigger.group(2):
location = q="san%20francisco"
elif trigger.group(2) == 'nioc':
location = 'new york city'
else:
location = trigger.group(2)
if location.isdigit():
location = "zip="+location
else:
location = "q="+location.replace(' ', '%20')
r = requests.get('https://api.openweathermap.org/data/2.5/weather?{}&appid={}'.format(location, wk))
j = r.json()
location = j['name']+', '+j['sys']['country']
humidity = j['main']['humidity']
wind_speed_m_s = j['wind']['speed']
wind_deg = j['wind']['deg']
description = j['weather'][0]['description']
temp_in_c = float(j['main']['temp'])-273
low_in_c = float(j['main']['temp_min'])-273
high_in_c = float(j['main']['temp_max'])-273
temp = (temp_in_c * 9 / 5 ) + 32
low = (low_in_c * 9 / 5 ) + 32
high = (high_in_c * 9 / 5 ) + 32
wind_speed_mph = float(wind_speed_m_s) * 2.236936
def calculate_bearing(d):
dirs = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW']
ix = int(round(d / (360. / len(dirs))))
return dirs[(ix) % len(dirs)]
direction = calculate_bearing(wind_deg)
try:
bot.say("In {} it is {:.1f} F with a low of {:.1f} and high of {:.1f} F, humidity is {}%, winds of {:.1f} mph from the {} with {}.".format(location, temp, low, high, humidity, wind_speed_mph, direction, description))
except:
bot.say("In {} it is {:.1f} F with a low of {:.1f} and high of {:.1f} F, humidity is {}%, winds of {:.1f} mph with {}.".format(location, temp, low, high, humidity, wind_speed_mph, description))
except: except:
bot.say("The earth is on fire 🌎🔥") bot.say("The earth is on fire 🌎🔥")
@ -980,9 +925,5 @@ def mental(bot, trigger):
bot.say('Ahhhhhhhh!!!!') bot.say('Ahhhhhhhh!!!!')
@sopel.module.commands('biden') @sopel.module.commands('biden')
def biden(bot, trigger): def mental(bot, trigger):
bot.say('Come on man...') bot.say('Come on man...')
@sopel.module.commands('smile')
def smile(bot, trigger):
bot.say('https://archive.is/uqHxO')