What is a sebi bot without sebisauce?

This commit is contained in:
annihilator708 2018-05-21 04:53:36 +02:00
parent 38ab7ce6d5
commit 8ec62c188e
2 changed files with 44 additions and 1 deletions

View File

@ -1,3 +1,4 @@
example
upload
git
git
fun

42
src/cogs/fun.py Normal file
View File

@ -0,0 +1,42 @@
#!/usr/bin/python
# -*- coding: <encoding name> -*-
from discord.ext import commands
import discord
import random
class Fun:
"""
CogName should be the name of the cog
"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def sebisauce(self, ctx):
"""
Get a image related to Sebi.
Sebi is a random guy with perfect code related jokes.
Usage:
- sebisauce
"""
await ctx.trigger_typing()
source = await self.bot.brequest.aio_json('http://ikbengeslaagd.com/API/sebisauce.json')
total_sebi = 0
for key in dict.keys(source):
total_sebi += 1
im = random.randint(0, int(total_sebi) - 1)
msg = await ctx.send(
embed=discord.Embed(
title='\t',
description='\t',
color=0xf20006).set_image(
url=source[str(im)]))
return await msg.add_reaction(self.bot.success)
def setup(bot):
bot.add_cog(Fun(bot))