Git Product home page Git Product logo

shea's Introduction

SHEA (a.k.a. "Bae")

Simple Heuristic Entertainment Administrator

Overview.

This one's simple: A Discord bot initially dreamt up to serve the needs of the Feature Film Friday Posse. What will it become? No idea. But even if it doesn't grow to contain an exhaustive set of features, we hope it will serve its purpose.

Installation.

A quick note:

Being as this project is wholly written in Python3, we'd recommend installation of Python3. If you do not currently have a Python3 interpreter installed and do not know how to accomplish this, visit and read the documentation for Python3. Or call the cops, because you might be in trouble.

Setup.

We recommend creating a virtual environment since--after all--this Python we're dealing with. Stuff breaks.

There are two methods provided for setup.

Method 1: Makefile (Preferred)

To create a Python3 virtual environment and install all require modules, simply run:

make setup

To upgrade Python3 modules (utilizing `requirements.txt):

make upgrade

To remove the virtual environment and before running make setup again:

make clean

Method 2: setup-venv.sh

Running the setup-venv.sh script included in this repository will automatically create a virtual environment and install the required packages for you.

./scripts/setup-venv.sh

Once the virtual environment is successfully created, you may activate it with the following command:

source .venv/bin/activate

Launch on boot (optional):

A script that launch SHEA in a tmux session has been included in scripts/tmux_session.sh. It's intended to be invoked at boot in order to ensure that SHEA will persist after power loss or reboot on Debian-based systems by adding the following to /etc/rc.local:

# Start SHEA on boot.
sudo -u <username> bash <path>/shea/scripts/tmux_session.sh

It will create a session, run SHEA, and then detatch the session. In order to access the session, simply run:

tmux attach-session -t shea

Configuration.

Before running SHEA for the first time, create a copy of config.json.example, rename it to config.json, and then configure the contents to your liking.

You will need to specify a Discord API key at the very least.

For more information, please visit the Discord Developer Portal.

Features / Roadmap.

  • Spaghetti wolf ๐Ÿ๐Ÿบ.
  • Virtual environment installer for easy setup.
  • Feature Film Friday functionality.
  • Better logging with adjustable verbosity and rotation.
  • Administrative commands, overrides, and remote update capability.
  • Better documentation and installation instructions.
    • config.json explanation.
    • Explain installation options: make or setup-venv.sh.
  • Script for automated creation of a tmux session (intended for automated launch after reboot).

Wishlist.

  • Ability to query and display plot synopses, ratings, and a list of services where requested content is available to stream.
  • Image generation: fractals, quote cards, etc.
  • Return dice rolls as an image instead of text block.
  • Text-to-speech and other audio playback in voice channels.

License.

The contents of this repository are covered under the MIT standard license. See LICENSE for details.

Issues & Contributions.

Should you desire to contribute to or complain about the contents of this repository, feel free to open an Issue or submit a Pull Request. Additionally, we are open to the idea of expanding SHEA's functionality and welcome any requests or recommendations.

Though we cannot guarantee your satisfaction, all submissions will be considered.

shea's People

Contributors

iodeslykos avatar

Stargazers

 avatar

Watchers

 avatar  avatar

shea's Issues

Implement audio playback functionality in SHEA.

Wish: For SHEA to have connectivity to and functionality within voice channels.

Documentation/guide outlining possible implementation: Voice | Py-Cord Guide

Thoughts:

  • Playback audio files, including but not limited to WAV, MP3, Ogg.
  • Play source and play audio from YouTube links.
    • Best implemented with youtube-dl, but most likely in the form of a Python module.
    • Maybe it can be accomplished in real-time (streaming instead of complete file download)?
  • Have library of audio files with store of related metadata for querying for files and user related data like: first played, times requested by user, etc.
    • Cache previously requested files from web sources to reduce requests and bandwidth requirements.
  • State persistent queues (playlists) with ADD, REMOVE, STOP, START/RESUME, NEXT, PREVIOUS, REWIND n: seconds, PLAY_FROM n: seconds, and INFO methods.

Dice roll feature enhancement; randomly select from user submitted list / user callback

Context: Dice roll function is used to select from a user submitted list of items.

  • Real world example: Dice roll feature called to randomly pick from a list of objects (imdb links; which is a whole other feature request). Bot responds with result and user mention.

Summary: Dice roll feature should be aware of association between user and user submitted list objects. The bot should specify which user had their object randomly chosen in the outcome result.

Detail: Bot function which takes in a collection of objects, rolls an sided die relative to object count, matches the roll result to an object, respond back with: roll result, object.name, object.user.

The structure for the object might look something like ...

{name: "Movie title",
properties:
{length: "1hr 30min",
rating: "10",
year: "2022"}
}

To accommodate different types of objects, the function could probably attempt to map the data structure's key/value pairs.

There is an additional assumption here, in that the bot would receive objects from multiple users in a single channel.

  • Context:

    • Bot listens in #channel
    • 4 users each send a single object for the bot to add to a collection
    • Bot is asked to randomly pick from the collection
    • Bot gets a count of items stored in the collection
    • Bot creates a dice with <collection.count> sides
    • Bot maps each dice side with an object in the collection
    • Bot returns roll result with some information on the associated object
  • Real world example:

    • 4 users add an imdb link to the bots collection
    • User asks bot to randomly select from the collection
    • Bot generates 4 sided dice
    • Bot maps each imdb link to a dice side
    • Bot returns roll result; "Roll result: 4 = <User imdb link>.name (<user imdb link>.year) [<User imdb link>.length] @<User imdb link>.user

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.