Skip to content

Instantly share code, notes, and snippets.

@Nikitaw99
Created August 29, 2016 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nikitaw99/74c09c13410bdc2c2575fb0ebf5d8759 to your computer and use it in GitHub Desktop.
Save Nikitaw99/74c09c13410bdc2c2575fb0ebf5d8759 to your computer and use it in GitHub Desktop.
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