Coder Social home page Coder Social logo

ochelpbot's Introduction

OKANAGAN COLLEGE DISCORD BOT

============================

Written in Python3 with Flask framework

CURRENT FUNCTIONALITY:

Flask:

  • Register new users
  • Add/Delete Custom Commands in Flask webportal
  • Welcome message from bot upon joining Discord server
  • User profiles

Discord Commands:

  • !create-channel
  • !profquote
  • !addquote
  • !links
  • !help
  • !quiz
    • !makequiz
    • !quizlist
    • !addquestion
  • !roll_dice
  • !courseinfo
  • !register
  • !whoami
  • !whois
  • Custom commands from Flask database

UPCOMING FUNCTIONALITY:

  • add quizzes with flask forms
  • add multiple return commands from flask

Running

  1. Make sure to get Python 3.5 or higher

This is required to actually run the bot.

  1. Set up venv

Run in python: python3.6 -m venv venv

  1. Install dependencies

This is pip install -U -r requirements.txt (full implementation not yet finished)

  1. Create the database in SQLite

Will fill this out in greater detail in future

  1. Setup configuration

The next step is just to create a config.py file in the root directory where the bot is with the following template:

import os
basedir = os.path.abspath(os.path.dirname(__file__))

class Config(object):
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'insert-your-secret-key-here'
    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
        'sqlite:///' + os.path.join(basedir, 'name_of_your_database.db')
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    MAIL_SERVER = os.environ.get('MAIL_SERVER')
    MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25)
    MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
    MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
    MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
    ADMINS = ['[email protected]']

And a .env file in the root directory where the bot is with the following template:

TOKEN=your_token_here
DATABASE_FILE = "your_db_here"
GUILDID=your_guild_ID_number_here
DEFINE_ID=the_dictionary_API_ID
DEFINE_KEY=the_dictionary_API_KEY
  1. Configuration of database

To configure the SQLite database for use by the bot, go to the directory where your database file is located, and run: python3.6 DiscordLaunch.py db init python3.6 app\routes.py db init

Requirements

  • Python 3.6+
  • v1.0.0 of discord.py
  • Flask
  • SQLite

ochelpbot's People

Contributors

vezer917 avatar routable avatar vistuvis avatar robot-c0der avatar

Watchers

James Cloos 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.