Giter Site home page Giter Site logo

kody2.0's Introduction

Discord Bot Template

Originally Kody2.0, but revamped to act as boilerplate anyone can use.

Here's a quick rundown of every file's purpose

pycache is an autogenerated file that we do not need to touch or worry about

cogs are a separate group of files you can write in, so that bot.py does not become one giant 50000 line file.

(OPTIONAL) myenv is a virtual environment with all of the projects dependencies (or imports). Rather than download the libraries on your PC, you will run this virtual environment from terminal

bot.py is the "brain" of the bot. all functionality will be in modules from /cogs/

.gitignore prevents the json file from being uploaded to discord, because it contains a secret token. This is if you plan to upload your bot to Github.

requirements.txt includes all the dependencies (libraries) we need

NOTE: you may also need git (https://git-scm.com/downloads) and recommended visual studio code (https://code.visualstudio.com/)

How to begin coding

  1. Make sure you have python installed. https://www.python.org/downloads/

  2. Clone a copy of this repo to your system. You can do this by clicking the green "CODE" button on the main page and copying the HTTPS link, then going into a terminal and typing "git clone (PASTE_LINK_HERE). This copies all of the files to your computer.

  3. Open the files in VSCode. You can do this by typing "cd .\kody2.0" in the same terminal. Then typing "code ." to open the current directory in VScode.

  4. (OPTIONAL, you may skip to #4 if this looks too complicated) You should create a virtual environment to keep your dependencies consistent with others. Open a powershell terminal in VSCode

BEFORE CREATING A VIRTUAL ENVIRONMENT, YOU NEED TO ENABLE SCRIPTS ON YOUR PC. OPEN POWER SHELL IN ADMINISTRATER MODE AND TYPE "Set-ExecutionPolicy RemoteSigned"

Go back to VSCODE and open a terminal within vscode. Run "python -m venv myenv" to create your environment. If you choose to name it something else, update that in .gitignore, to prevent your virtual environment from being uploaded to github (if you choose to do that)

run "myenv/Scripts/activate" and you should notice a (myenv) prefix in your terminal. You are now using the virtual environment (very easy yes yes!)

NOTE: To leave the venv, run "deactivate". remember to use this everytime you develop

  1. now run "pip install -r requirements.txt" to download all dependencies to your computer (or virtual environment if you did that)

  2. Duplicate the modularization_test.py file from /cogs/. You can also refer to greetings.py. RENAME THIS FILE! KEEP THIS IN COGS! this is where you should put your code to keep things organized. you can have as many files as youd like

Follow this video (https://www.youtube.com/watch?v=zrNloK9b1ro) to create a bot in the discord developer portal (https://discord.com/developers/applications)

To create a bot, go to https://discord.com/developers/applications and click "new application". Go to the bot tab to copy the token. Also enable all three intents. To invite your bot to a server, go to OAuth2, then under "Default Authorization Link" select "In-app authorization" and check Bot and Administrator. Now under OAuth2 go to URL generator, select Bot, and administator again, and now go to the link that it provides you to add the bot to a server.

Paste your token into config.json

  1. To run Kody, run "python .\bot.py". You can press CTRL C to stop running it.

kody2.0's People

Contributors

dakota-byte avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.