Created
July 19, 2017 15:32
-
-
Save SamArroyos22/ff61532b569ac6891d60e688d2d1fd85 to your computer and use it in GitHub Desktop.
Discord Bot Tutorial
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 time | |
from discord.ext.commands import Bot | |
client = Bot("tb.") | |
@client.event | |
async def on_ready(): | |
print("----------------------") | |
print("Logged In As") | |
print("Username: %s"%client.user.name) | |
print("ID: %s"%client.user.id) | |
print("----------------------") | |
@client.command() | |
async def ping(): | |
'''See if The Bot is Working''' | |
pingtime = time.time() | |
pingms = await client.say("Pinging...") | |
ping = time.time() - pingtime | |
await client.edit_message(pingms, "Pong! The ping time is `%.01f seconds`" % ping) | |
client.run("Your_bot_token_here") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment