|
|
@@ -1,7 +1,9 @@
|
|
|
|
|
|
|
|
import aiohttp
|
|
|
|
import fluxer
|
|
|
|
import fluxer
|
|
|
|
import requests
|
|
|
|
import requests
|
|
|
|
import json
|
|
|
|
import json
|
|
|
|
import asyncio
|
|
|
|
import asyncio
|
|
|
|
|
|
|
|
import base64
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
import sqlite3
|
|
|
|
import sqlite3
|
|
|
|
import os
|
|
|
|
import os
|
|
|
@@ -118,7 +120,7 @@ async def setChannel(message):
|
|
|
|
|
|
|
|
|
|
|
|
@bot.command()
|
|
|
|
@bot.command()
|
|
|
|
async def version(message):
|
|
|
|
async def version(message):
|
|
|
|
await message.channel.send("Version 0.5.0 is running\nSource code: https://github.com/michelleDeko/ich_iel-bot")
|
|
|
|
await message.channel.send("Version 0.5.1 is running\nSource code: https://github.com/michelleDeko/ich_iel-bot")
|
|
|
|
|
|
|
|
|
|
|
|
# the cat bot died, so i wanted to add this command to this bot
|
|
|
|
# the cat bot died, so i wanted to add this command to this bot
|
|
|
|
@bot.command()
|
|
|
|
@bot.command()
|
|
|
@@ -158,6 +160,21 @@ async def fox(message):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
await message.channel.send("Failed to fetch fox image")
|
|
|
|
await message.channel.send("Failed to fetch fox image")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# time for racoons
|
|
|
|
|
|
|
|
@bot.command()
|
|
|
|
|
|
|
|
async def racoon(message):
|
|
|
|
|
|
|
|
urls = random.choice([
|
|
|
|
|
|
|
|
"https://api.mapach.es/v1/meme",
|
|
|
|
|
|
|
|
"https://api.mapach.es/v1/coon"
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
async with aiohttp.ClientSession() as session:
|
|
|
|
|
|
|
|
async with session.get(urls) as response:
|
|
|
|
|
|
|
|
image_bytes = await response.read()
|
|
|
|
|
|
|
|
if response.status != 200:
|
|
|
|
|
|
|
|
await message.channel.send("Failed to fetch racoon image")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
await message.channel.send(file=fluxer.File(image_bytes, filename="racoon.jpg"))
|
|
|
|
|
|
|
|
|
|
|
|
async def post_reddit():
|
|
|
|
async def post_reddit():
|
|
|
|
subreddit = os.getenv("SUBREDDIT", "ich_iel")
|
|
|
|
subreddit = os.getenv("SUBREDDIT", "ich_iel")
|
|
|
|
posts = await get_latest_post(subreddit)
|
|
|
|
posts = await get_latest_post(subreddit)
|
|
|
|