import discord

client = discord.Client()

@client.event
async def on_message(message):
    if message.author == client.user:
        return
    if message.content.startswith('!ping'):
        msg = 'Pong! This bot is alive.'
        await client.send_message(message.channel, msg)

@client.event
async def on_ready():
    print('Logged in as')
    print('User:',client.user.name)
    print('ID',client.user.id)
    print('------')

client.run('put_your_token_here')

Add basic discord bot functionality