Created
August 29, 2016 16:33
-
-
Save Nikitaw99/74c09c13410bdc2c2575fb0ebf5d8759 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 | |
import textile | |
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) + "```") | |
if message.content.startswith(".textile"): | |
text1 = message.content[len('.textile ```'):-3] | |
text2 = textile.textile(text1) | |
await client.send_message(message.channel, "```html\n" + str(text2) + "\n```") | |
client.run("token", bot=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment