This commit is contained in:
root 2020-05-22 19:42:41 +00:00
parent 4c5f12de8f
commit 86fd923cdb
3 changed files with 58 additions and 9 deletions

23
ai.py Normal file
View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
import requests
import sopel.module
@sopel.module.commands('gp2', 'ai')
def gp2(bot, trigger):
# bot.say("bomb-on ruined it for everyone. thanks bomb-on")
text = trigger.group(2)
r = requests.post(
"https://api.deepai.org/api/text-generator",
data={
'text': text,
},
headers={'api-key': '34b2c164-0c2e-4896-90ab-98dd56eeb290'}
)
#bot.say(r.json())
bot.say(r.json()['output'].split('\n\n')[0])
bot.say(r.json()['output'].split('\n\n')[1])
bot.say(r.json()['output'].split('\n\n')[2])
#bot.say("full output at http://ai.wownero.com")
#stringtowrite = r.json['output'].encode('utf8')
#with open("/root/www/index.html", "w") as f:
# f.write(stringtowrite)

View File

@ -319,7 +319,7 @@ def paprika(bot, trigger):
id = i['id'] id = i['id']
r = requests.get('https://api.coinpaprika.com/v1/tickers/{}'.format(id)) r = requests.get('https://api.coinpaprika.com/v1/tickers/{}'.format(id))
j = r.json() j = r.json()
bot.say("{} ({}) is #{} by marketcap, trading at ${:.2f} with a 24h vol of ${:.2e}. It's changed {}% over 24h, {}% over 7d, {}% over 30d, and {}% over 1y with an ath of ${} on {}.".format(j['name'], j['symbol'], j['rank'], float(j['quotes']['USD']['price']), float(j['quotes']['USD']['volume_24h']), j['quotes']['USD']['percent_change_24h'], j['quotes']['USD']['percent_change_7d'], j['quotes']['USD']['percent_change_30d'], j['quotes']['USD']['percent_change_1y'], j['quotes']['USD']['ath_price'], j['quotes']['USD']['ath_date'])) bot.say("{} ({}) is #{} by marketcap (${:.2e}), trading at ${:.4f} with a 24h vol of ${:.2e}. It's changed {}% over 24h, {}% over 7d, {}% over 30d, and {}% over 1y with an ath of ${} on {}.".format(j['name'], j['symbol'], j['rank'], float(j['quotes']['USD']['market_cap']), float(j['quotes']['USD']['price']), float(j['quotes']['USD']['volume_24h']), j['quotes']['USD']['percent_change_24h'], j['quotes']['USD']['percent_change_7d'], j['quotes']['USD']['percent_change_30d'], j['quotes']['USD']['percent_change_1y'], j['quotes']['USD']['ath_price'], j['quotes']['USD']['ath_date']))
except: except:
bot.say('No paprika only salt') bot.say('No paprika only salt')
@ -360,6 +360,8 @@ def stock(bot, trigger):
def ogre(bot, trigger): def ogre(bot, trigger):
if not trigger.group(2): if not trigger.group(2):
pair = 'BTC-XMR' pair = 'BTC-XMR'
elif "hidden" in trigger.group(2) or "gem" in trigger.group(2):
pair = 'BTC-WOW'
else: else:
pair = 'BTC-'+trigger.group(2).upper() pair = 'BTC-'+trigger.group(2).upper()
try: try:
@ -497,14 +499,13 @@ def tall(bot, trigger):
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']))
except: except:
stringtosend += "Finex sucks | " stringtosend += "Finex sucks | "
# Bitflyer # Krak euro price
try: try:
bitflyerresult = requests.get(bitflyerurl) r = requests.get(krakbtceur)
bitflyerjson = bitflyerresult.json() j = r.json()
stringtosend += "Kraken last: €{0:,.2f}, vol: {1:,.1f} | ".format(float(j['result']['XXBTZEUR']['c'][0]), float(j['result']['XXBTZEUR']['v'][0]))
except: except:
bitflyerjson = False bot.say("Error getting BTC/EUR data")
if bitflyerjson:
stringtosend += "Bitflyer last: ¥{0:,.2f}, vol: {1:,.1f} | ".format(float(bitflyerjson['ltp']), float(bitflyerjson['volume_by_product']))
# Send the tickers to IRC # Send the tickers to IRC
bot.say(stringtosend[:-2]) bot.say(stringtosend[:-2])

View File

@ -45,6 +45,19 @@ def barolo(bot, trigger):
def bb(bot, trigger): def bb(bot, trigger):
bot.say('https://www.youtube.com/watch?v=_VvbP0QNmF0') bot.say('https://www.youtube.com/watch?v=_VvbP0QNmF0')
bbloptions = [
"don't worry",
"it's fine",
"everything is good",
"😇🤣",
"afk",
"it's all good",
"please go back and re-read it, it's good",
]
@sopel.module.commands('bbl')
def bbl(bot, trigger):
bot.say(random.choice(bbloptions))
@sopel.module.commands('bear') @sopel.module.commands('bear')
def bear(bot, trigger): def bear(bot, trigger):
bot.say(u'ʕ ·(エ)· ʔ'.encode('utf8')) bot.say(u'ʕ ·(エ)· ʔ'.encode('utf8'))
@ -160,7 +173,7 @@ def covid(bot, trigger):
if not trigger.group(2): if not trigger.group(2):
try: try:
r = requests.get( r = requests.get(
'https://corona.lmao.ninja/all') 'https://corona.lmao.ninja/v2/all')
j = r.json() j = r.json()
cases = j['cases'] cases = j['cases']
deaths = j['deaths'] deaths = j['deaths']
@ -175,7 +188,7 @@ def covid(bot, trigger):
try: try:
countryname = trigger.group(2) countryname = trigger.group(2)
r = requests.get( r = requests.get(
'https://corona.lmao.ninja/countries/{0}'.format(countryname)) 'https://corona.lmao.ninja/v2/countries/{0}'.format(countryname))
j = r.json() j = r.json()
country = j['country'] country = j['country']
cases = j['cases'] cases = j['cases']
@ -389,6 +402,10 @@ def lietome(bot, trigger):
def livermore(bot, trigger): def livermore(bot, trigger):
bot.say(u'https://en.wikipedia.org/wiki/Reminiscences_of_a_Stock_Operator'.encode('utf8')) bot.say(u'https://en.wikipedia.org/wiki/Reminiscences_of_a_Stock_Operator'.encode('utf8'))
@sopel.module.commands('loki')
def loki(bot, trigger):
bot.say(u'Only $13 to run a masternode 🤑🤡 https://i.imgur.com/aK5kiwi.png')
@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 🍄'.encode('utf8')) bot.say(u'🍄 luigi is doing. mario is not doing luigi is doing 🍄'.encode('utf8'))
@ -613,6 +630,10 @@ suraeoptions = [
def surae(bot, trigger): def surae(bot, trigger):
bot.say(random.choice(suraeoptions)) bot.say(random.choice(suraeoptions))
@sopel.module.commands('tech', 'initforthetech')
def tech(bot, trigger):
bot.say("I'm in it for the tech https://i.imgur.com/h2g7wSe.png 👩‍💻⚙")
@sopel.module.commands('thicc') @sopel.module.commands('thicc')
def thicc(bot, trigger): def thicc(bot, trigger):
bot.say("https://pics.me.me/you-on-the-beach-and-luigi-walk-pass-and-give-42542268.png") bot.say("https://pics.me.me/you-on-the-beach-and-luigi-walk-pass-and-give-42542268.png")
@ -730,6 +751,10 @@ def zcash(bot, trigger):
def zcash(bot, trigger): def zcash(bot, trigger):
bot.say("And by the way, I think we can successfully make Zcash too traceable for criminals like WannaCry, but still completely private & fungible.") bot.say("And by the way, I think we can successfully make Zcash too traceable for criminals like WannaCry, but still completely private & fungible.")
@sopel.module.rule('[Tt]est*.')
def test(bot, trigger):
bot.say("Test failed")
@sopel.module.rule('monerobux o\/') @sopel.module.rule('monerobux o\/')
def wave(bot, trigger): def wave(bot, trigger):
#bot.reply(u'^ (•_•) ^'.encode('utf8')) #bot.reply(u'^ (•_•) ^'.encode('utf8'))