Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Latest commit

 

History

History
41 lines (31 loc) · 868 Bytes

README.md

File metadata and controls

41 lines (31 loc) · 868 Bytes

Bot for Discord

Add new command

Each command is a .py file that will be loaded dynamically when the bot starts. the command function must have the same file name.
Example: hello.py

# simple command example
async def hello(ctx):
    username = ctx.message.author.name
    await ctx.send(f'Hello {username}!')

The setting.py file defines the list of COMMAND directories, the bot will look for commands in those folders

DESCRIPTION = 'Mi primer bot de discord'
COMMANDS = ['bot/command/basics/']

Execute

  1. clone project
  • git clone https://github.com/luisbarrasandoval/discord_bot
  • cd discord_bot
  1. install pipenv
  • pip3 install pipenv
  • pipenv shell
  1. install dependencies
  • pipenv install
  1. change token in src/config.py
TOKEN = 'YOUR TOKEN'
  1. Run
  • cd src && python3 main.py