XDwightsBeetsX / ARCHIVE-discord_bots

Discord bots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

discord-bots

Discord Bots!

Bots can and should:

  • Interact on the server
  • Track member stats
  • Do cool things
    • Music
    • Pictures

Table of Contents

Usage

Add the Bot to Your Server

Follow the guide here

  • Starting a server
  • Creating a bot on the Discord Dev Portal
  • Adding the bot to your server
    • Permissions
  • Getting started with Discord Bots in python

Download the repo

Use one of the following or just download the .zip here.

> gh repo clone XDwightsBeetsX/discord-bots
> git clone https://github.com/XDwightsBeetsX/discord-bots.git
  • Most will need to simply install the discord python API:

    > pip install discord
  • You can also make sure you got it all (it's not much):

    > pip install requirements.txt

Add Your Discord Secrets

  • Store tokens/keys in a folder like keys
    • Add your folder to the .gitignore to keep your key(s) safe
    • Add files like keys/dwight.txt
    • Parse these in with the bot using utils/Parsing

Run the Bot(s)

Easily run bots like any other python script!

> python <bot-name>.py

The first bot!

Discord Command Info
!help Prints off a list of available commands.
!dwight Messages: "Bears, Beets, Battlestar Galactica"
!message_count Dwights lets you know how many messages have been sent.
!member_count Dwight tells you how popular your server is

A template for making new bots.

Offers some skeleton methods:

  • __main__
  • run()
  • sendMessage(message)
  • writeStatsToFile()
  • logLine(line)

with reference to: realpython's tutorial

links: Discord Developer Portal

About

Discord bots

License:MIT License


Languages

Language:Python 100.0%