Giter Site home page Giter Site logo

hamoudes / automata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from muncomputersciencesociety/automata

0.0 0.0 0.0 510 KB

Discord bot handling the management of the MUN Computer Science Society Discord server.

License: MIT License

Python 99.80% Dockerfile 0.20%

automata's Introduction

Automata

Deploy to Docker Hub Code scanning - action Code style: black

Discord bot handling the management of the MUN Computer Science Society Discord server

For feature requests / help getting the bot running, don't fret to ask questions in the #automata channel in the guild!


Running locally

  1. Clone the project by running https://github.com/MUNComputerScienceSociety/Automata.git, and change into the directory by running cd ./Automata
  2. Copy .env.dist to .env
  3. Fill out the required information in the .env
    • At the moment, the only required environment variable required is AUTOMATA_TOKEN, which is a Discord token, which you can see how to get here

Note about running locally and avoiding spam:

When this bot was smaller, it wasn't so bad to run all the plugins; but since we have 40+, and some of them do some data fetching / loading on startup, so the logs can get a bit loud.

If you're working on a plugin, you can add its name to the AUTOMATA_ENABLED_PLUGINS env. var (like AUTOMATA_ENABLED_PLUGINS=PluginName), and it will be the only plugin that will be loaded.

This is a comma-delimited list as well, so you can enable multiple plugins at once.

Locally Using Docker

  1. Create the directory mounted_plugins within the project by running mkdir ./mounted_plugins
  2. Start the containers by running docker-compose up -d

Locally Without Docker

  1. Run MongoDB

    You can use Docker for running MongoDB (recommended), just add the following to the docker-compose.yml file to expose it to your local machine

      ...
      mongo:
        ...
        ports:
          - "127.0.0.1:27017:27017"
      ...

    And start it only by running docker-compose up -d mongo

  2. Install the requirements found in the requirements.txt file using pip install -r requirements.txt

  3. Run the bot using python Bot.py


Developing your own plugins

  • Automata is built around the discord.py framework, therefore the plugins make heavy use of its decorators to abstract most of the complexity behind the scenes.

Developing using Docker

  1. Create the folder mounted_plugins if it doesn't already exist
    • plugins is baked into the image when it is built, so editing files there won't have an effect
  2. Create a new plugin within the mounted_plugins folder
    1. Create a new Jigsaw plugin manifest
      • You can use plugins/Ping/plugin.json as an example
    2. Create a new plugin
      • You can use plugins/Ping/__init__.py as an example
  3. Start the bot using the instructions from Running locally

When you make changes to your plugins, restart the Automata container using docker-compose restart automata

Developing without Docker

  1. Create a new plugin, following the directions above within 'Using Docker', but within the plugins folder instead
  2. Start the bot using the instructions from Running locally

Developing the bot core and built-in plugins

Developing core using Docker

  1. Edit the docker-compose.yml, replacing the image: muncs/automata line for the automata container with build: .
  2. Edit the bot core or the plugins as you wish
  3. Start the container, forcing a rebuild of the image using docker-compose up -d --build

Developing core without Docker

  1. Just edit the core files / plugins directly :)
  2. Start the bot using the instructions from Running locally

Pushing changes to GitHub

  1. Fork this repository, clone your fork, and commit your changes to a branch on your fork
  2. Create a PR to merge your branch into the master branch here, and make sure to tag an executive / mention the PR in Discord so we see it
  3. We'll likely request some changes before it is merged
  4. Once it's good, a few minutes after the PR is merged the feature should be live, since Automata uses CI/CD :)

Container responsibilities

Automata is comprised of a number of containers, each with distinct responsibilities. Their responsibilities are as follows:

Container Responsibilities
automata The Discord bot itself
mongo A MongoDB server used to provide persistent data storage to the automata container

automata's People

Contributors

7evnzer0 avatar andrewharris709 avatar apolloswagmoney avatar cmoyates avatar coltonfrstt avatar dchicasduena avatar dependabot[bot] avatar diztil avatar donno2048 avatar ecumene avatar hamoodev avatar hamoudes avatar hamzahap avatar jackharrhy avatar koalasthegreat avatar leahhynes avatar m-arafatzaman avatar marcouxjohn avatar mudkip avatar muncssbot avatar nint8835 avatar nishant7rathore avatar nstvnsn avatar omega7379 avatar punkbat avatar saraypide avatar singhripudaman avatar steveparson avatar zcvaters 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.