Skip to content

Instantly share code, notes, and snippets.

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