Skip to content

Instantly share code, notes, and snippets.

@mpsparrow
Created April 18, 2020 00:53
Show Gist options
  • Select an option

  • Save mpsparrow/6678c24139bdad4b45bcdbf5536ed89d to your computer and use it in GitHub Desktop.

Select an option

Save mpsparrow/6678c24139bdad4b45bcdbf5536ed89d to your computer and use it in GitHub Desktop.

Revisions

  1. Matthew created this gist Apr 18, 2020.
    27 changes: 27 additions & 0 deletions bot.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    '''
    Bot Name:
    Creator:
    Version:
    Date Updated:
    Date Created:
    '''

    import discord
    from discord.ext import commands

    token = 1234567890
    prefix = "bot?"
    bot = commands.Bot(command_prefix=prefix)

    # runs on startup
    @bot.event
    async def on_ready():
    print("Started!")

    # simple ping command
    @bot.command(name='ping', description='pings bot', usage='ping', aliases=['p'])
    async def ping(ctx):
    await ctx.send("pong!")

    # runs bot
    bot.run(token)