Created
August 29, 2016 08:38
-
-
Save Nikitaw99/ce6469c72d3e8f86673e8bf11ad2dd9f 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 discord | |
import asyncio | |
client = discord.Client() | |
@client.event | |
async def on_ready(): | |
print('Logged in as') | |
print(client.user.name ) | |
print(client.user.id) | |
print('------') | |
@client.event | |
async def on_message(message): | |
if message.content.startswith("?>"): | |
if message.author.id == "151661421845807104": | |
try: | |
cmd = message.content[len('?> '):] | |
if cmd.startswith("await"): | |
result = await eval(cmd[len("await "):]) | |
else: | |
result = eval(cmd) | |
await client.send_message(message.channel, "```" + str(result) + "```") | |
except Exception as e: | |
client.send_message(message.channel, "```" + str(e) + "```") | |
client.run("token", bot=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment