Created
February 15, 2017 09:52
-
-
Save ZucchiniZe/2cd506bc3d44110e2e54c76083c215fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import discord | |
| import asyncio | |
| import aiohttp | |
| from discord.ext import commands | |
| DESC = '''A discord bot made specially for the everest discord featuring such | |
| spicy memes as the testing noise, and others. | |
| Made by alex | |
| ''' | |
| bot = commands.Bot(command_prefix='::', description=DESC) | |
| @bot.event | |
| async def on_ready(): | |
| print('Logged in as:\n{0} (ID: {0.id})'.format(bot.user)) | |
| await bot.change_presence(game=discord.Game(name='TIOS, lets pass those CAs')) | |
| @bot.command(pass_context=True) | |
| async def test(ctx): | |
| counter = 0 | |
| tmp = await bot.say('Calculating messages...') | |
| async for log in bot.logs_from(ctx.message.channel, limit=1000): | |
| if log.author == ctx.message.author: | |
| counter += 1 | |
| await bot.edit_message(tmp, 'You have contributed {} messages to {} in the last 1000 messages.'.format(counter, ctx.message.channel.mention)) | |
| @bot.listen('on_typing') | |
| async def stop_talking(channel, user, when): | |
| await bot.send_message(channel, '{}! STOP TALKING!'.format(user.name)) | |
| @bot.command() | |
| async def cat(): | |
| async with aiohttp.get('http://random.cat/meow') as r: | |
| if r.status == 200: | |
| js = await r.json() | |
| await bot.say(js['file']) | |
| bot.run('MjgwOTcyODUyMTg5MjAwMzg1.C4WgUA.aQkJfNpfKTc2duIny3Dt9dWIQPA') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment