Git Product home page Git Product logo

discord-bot's Introduction

Discord Bot

Discord Python MySQL Docker

Simple discord bot that can give you quotes and handle your todo tasks

Technologies Used

Features

  • Connects to a Discord Server
  • Can give nice quotes
  • Manage your To-Do tasks (CRUD):
    • Create a task
    • Read a task
    • Update a task
    • Delete a task
  • Runs on Docker for easier execution

Screenshots

hello

quote

view-empty

add

select

update

view

delete

clear

Setup

To run this project, here are the requirements:

  • Docker
  • Python (3.9)
  • MySQL
  • Discord Bot setup (You can follow this guide)

To play around with the code please use PyCharm to open this project.

Usage

Docker

To run this project, you can use docker!

First off, create a .env file (use the .env.example for reference)

Next, simply use this command to run the application:

docker-compose up

You will then see something similar to this:

...
discord-bot |                       INFO     connecting to database discord on        db.py:10
discord-bot |                                mysql:3306 as user root
discord-bot |                       INFO     creating table todo                      db.py:21
discord-bot | [2022-11-12 08:46:08] [INFO    ] discord.client: logging in using static token
discord-bot |                       INFO     logging in using static token       client.py:571
discord-bot | [2022-11-12 08:46:11] [INFO    ] discord.gateway: Shard ID None has connected to Gateway (Session ID: ---).
discord-bot | [2022/11/12 08:46;11] INFO     Shard ID None has connected to     gateway.py:560
discord-bot |                                Gateway (Session ID:
discord-bot |                                ----).
discord-bot | [2022/11/12 08:46;13] INFO     We have logged in as mhasan01-bot#--- main.py:15

PyCharm

To run it locally, you can also use PyCharm.

Make sure you make the .env first and configure the DB correctly.

  • To run the application, you can execute the main.py (there should be a green indicator to execute it)
  • To run the tests, you can click right on the folder tests and run the tests.

Room for Improvement

Room for improvement:

  • Add more functionality.
  • More OOP classes could be implemented in the object.
  • Add CI / CD for build / lint / test pipeline.
  • Handle errors more gracefully

Acknowledgements

  • FreeCodeCamp
  • Various codes on the internet
  • StackOverflow answers

Contact

Created by mhasan01 - feel free to contact me!

discord-bot's People

Contributors

muhammadhasan01 avatar

Watchers

 avatar  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.