anotha oneeee

pull/1/head
michael 2019-09-08 22:13:04 -07:00
parent 83bacdb7ca
commit fffe62a6a0
1 changed files with 11 additions and 0 deletions

11
bot.py
View File

@ -103,6 +103,7 @@ async def addEmote(ctx, emote_name: str):
vote_passed = await take_vote(ctx, "Add emoji `{}`?".format(emote_name), EMOTE_VOTE_TIME, MIN_EMOTE_VOTERS)
# if all_in_favor > not_in_favor and all_in_favor > MIN_EMOTE_VOTERS:
await ctx.send(embed=imgfun(msg, url))
if vote_passed:
file_bytes = await ctx.message.attachments[0].read()
await ctx.guild.create_custom_emoji(name=emote_name, image=file_bytes)
@ -116,6 +117,16 @@ async def shibe(ctx):
url=json.loads(shibe_contents)[0]
await ctx.send(embed=imgfun(msg, url))
@bot.command(aliases=['bird'])
async def birb(ctx):
with urlopen(Request(url="http://random.birb.pw/tweet.json", headers={'User-Agent': 'Mozilla/5.0'})) as json_return:
# get image filename
birb_contents = json_return.read()
msg="{0}, here is your random birb:".format(ctx.message.author.name)
# insert image filename into URL
url="http://random.birb.pw/img/{}".format(json.loads(birb_contents)["file"])
await ctx.send(embed=imgfun(msg, url))
@bot.command(aliases=['latency'])
async def ping(ctx):
await ctx.send("`Bot latency: {}s`".format(round(bot.latency, 2)))