diff --git a/ai.py b/ai.py new file mode 100644 index 0000000..9a1b0f4 --- /dev/null +++ b/ai.py @@ -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) diff --git a/price.py b/price.py index 80c3a61..8c10b30 100644 --- a/price.py +++ b/price.py @@ -319,7 +319,7 @@ def paprika(bot, trigger): id = i['id'] r = requests.get('https://api.coinpaprika.com/v1/tickers/{}'.format(id)) 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: bot.say('No paprika only salt') @@ -360,6 +360,8 @@ def stock(bot, trigger): def ogre(bot, trigger): if not trigger.group(2): pair = 'BTC-XMR' + elif "hidden" in trigger.group(2) or "gem" in trigger.group(2): + pair = 'BTC-WOW' else: pair = 'BTC-'+trigger.group(2).upper() 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'])) except: stringtosend += "Finex sucks | " - # Bitflyer + # Krak euro price try: - bitflyerresult = requests.get(bitflyerurl) - bitflyerjson = bitflyerresult.json() + r = requests.get(krakbtceur) + 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: - bitflyerjson = False - if bitflyerjson: - stringtosend += "Bitflyer last: ¥{0:,.2f}, vol: {1:,.1f} | ".format(float(bitflyerjson['ltp']), float(bitflyerjson['volume_by_product'])) + bot.say("Error getting BTC/EUR data") # Send the tickers to IRC bot.say(stringtosend[:-2]) diff --git a/trifling.py b/trifling.py index f9a8c9a..820f969 100644 --- a/trifling.py +++ b/trifling.py @@ -45,6 +45,19 @@ def barolo(bot, trigger): def bb(bot, trigger): 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') def bear(bot, trigger): bot.say(u'ʕ ·(エ)· ʔ'.encode('utf8')) @@ -160,7 +173,7 @@ def covid(bot, trigger): if not trigger.group(2): try: r = requests.get( - 'https://corona.lmao.ninja/all') + 'https://corona.lmao.ninja/v2/all') j = r.json() cases = j['cases'] deaths = j['deaths'] @@ -175,7 +188,7 @@ def covid(bot, trigger): try: countryname = trigger.group(2) r = requests.get( - 'https://corona.lmao.ninja/countries/{0}'.format(countryname)) + 'https://corona.lmao.ninja/v2/countries/{0}'.format(countryname)) j = r.json() country = j['country'] cases = j['cases'] @@ -389,6 +402,10 @@ def lietome(bot, trigger): def livermore(bot, trigger): 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') def luigi(bot, trigger): bot.say(u'🍄 luigi is doing. mario is not doing luigi is doing 🍄'.encode('utf8')) @@ -613,6 +630,10 @@ suraeoptions = [ def surae(bot, trigger): 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') def thicc(bot, trigger): 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): 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\/') def wave(bot, trigger): #bot.reply(u'‹^› ‹(•_•)› ‹^›'.encode('utf8'))