Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wfcd/genesis

:robot: Warframe Discord Cephalon
https://github.com/wfcd/genesis

bot cephalon-sanctuary discord discord-bots discordjs discordjs-bot game genesis hacktoberfest mysql mysql-server nodejs nodejs-bot warframe

Last synced: about 9 hours ago
JSON representation

:robot: Warframe Discord Cephalon

Awesome Lists containing this project

README

        

# Project Genesis Genesis Avatar

[![Supported by the Warframe Community Developers](https://img.shields.io/badge/Warframe_Comm_Devs-supported-blue.svg?color=2E96EF&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTgiIGhlaWdodD0iMTczIiB2aWV3Qm94PSIwIDAgMjk4IDE3MyI%2BPHBhdGggZD0iTTE4NSA2N2MxNSA4IDI4IDE2IDMxIDE5czIzIDE4LTcgNjBjMCAwIDM1LTMxIDI2LTc5LTE0LTctNjItMzYtNzAtNDUtNC01LTEwLTEyLTE1LTIyLTUgMTAtOSAxNC0xNSAyMi0xMyAxMy01OCAzOC03MiA0NS05IDQ4IDI2IDc5IDI2IDc5LTMwLTQyLTEwLTU3LTctNjBsMzEtMTkgMzYtMjIgMzYgMjJ6TTU1IDE3M2wtMTctM2MtOC0xOS0yMC00NC0yNC01MC01LTctNy0xMS0xNC0xNWwxOC0yYzE2LTMgMjItNyAzMi0xMyAxIDYgMCA5IDIgMTQtNiA0LTIxIDEwLTI0IDE2IDMgMTQgNSAyNyAyNyA1M3ptMTYtMTFsLTktMi0xNC0yOWEzMCAzMCAwIDAgMC04LThoN2wxMy00IDQgN2MtMyAyLTcgMy04IDZhODYgODYgMCAwIDAgMTUgMzB6bTE3MiAxMWwxNy0zYzgtMTkgMjAtNDQgMjQtNTAgNS03IDctMTEgMTQtMTVsLTE4LTJjLTE2LTMtMjItNy0zMi0xMy0xIDYgMCA5LTIgMTQgNiA0IDIxIDEwIDI0IDE2LTMgMTQtNSAyNy0yNyA1M3ptLTE2LTExbDktMiAxNC0yOWEzMCAzMCAwIDAgMSA4LThoLTdsLTEzLTQtNCA3YzMgMiA3IDMgOCA2YTg2IDg2IDAgMCAxLTE1IDMwem0tNzktNDBsLTYtNmMtMSAzLTMgNi02IDdsNSA1YTUgNSAwIDAgMSAyIDB6bS0xMy0yYTQgNCAwIDAgMSAxLTJsMi0yYTQgNCAwIDAgMSAyLTFsNC0xNy0xNy0xMC04IDcgMTMgOC0yIDctNyAyLTgtMTItOCA4IDEwIDE3em0xMiAxMWE1IDUgMCAwIDAtNC0yIDQgNCAwIDAgMC0zIDFsLTMwIDI3YTUgNSAwIDAgMCAwIDdsNCA0YTYgNiAwIDAgMCA0IDIgNSA1IDAgMCAwIDMtMWwyNy0zMWMyLTIgMS01LTEtN3ptMzkgMjZsLTMwLTI4LTYgNmE1IDUgMCAwIDEgMCAzbDI2IDI5YTEgMSAwIDAgMCAxIDBsNS0yIDItMmMxLTIgMy01IDItNnptNS00NWEyIDIgMCAwIDAtNCAwbC0xIDEtMi00YzEtMy01LTktNS05LTEzLTE0LTIzLTE0LTI3LTEzLTIgMS0yIDEgMCAyIDE0IDIgMTUgMTAgMTMgMTNhNCA0IDAgMCAwLTEgMyAzIDMgMCAwIDAgMSAxbC0yMSAyMmE3IDcgMCAwIDEgNCAyIDggOCAwIDAgMSAyIDNsMjAtMjFhNyA3IDAgMCAwIDEgMSA0IDQgMCAwIDAgNCAwYzEtMSA2IDMgNyA0aC0xYTMgMyAwIDAgMCAwIDQgMiAyIDAgMCAwIDQgMGw2LTZhMyAzIDAgMCAwIDAtM3oiIGZpbGw9IiMyZTk2ZWYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg%3D%3D)](https://github.com/WFCD/banner/blob/master/PROJECTS.md)
[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)

### A [Discord.js](http://discord.js.org) bot for tracking Warframe alerts, invasions and more.

# Contribute

[![Crowdin](https://d322cqt584bo4o.cloudfront.net/genesis-discord/localized.svg)](https://crowdin.com/project/genesis-discord)
[![Discord](https://img.shields.io/discord/146691885363232769.svg?logo=discord)](https://discord.gg/DuFunUv)

## Live Public Bot info
[![Discord Bots](https://discordbots.org/api/widget/status/123591822579597315.png)](https://discordbots.org/bot/123591822579597315?utm_source=widget)
[![Discord Bots](https://discordbots.org/api/widget/servers/123591822579597315.png)](https://discordbots.org/bot/123591822579597315?utm_source=widget)
[![Discord Bots](https://discordbots.org/api/widget/lib/123591822579597315.png)](https://discordbots.org/bot/123591822579597315?utm_source=widget)

## JetBrains
Thank you to JetBrains for providing us with free licenses to their great tools.

* WebStorm

Feel free to submit a pull request. We are working on build checks and tests, and we use aribnb's codestyle and eslint configuration. Plugins for auto-linting on save are available for many popular editors.

## Thanks, Discord... Legalese things

Due to the New Discord T.O.S , if you continue to use, participate, be in, or not leave Cephalon Sanctuary, you agree to allowing me, any person, user, or member, any bot, service, app, and anything to collect, use, transmit, or any data related to your user account, any data made available by Discord in the API or SDK, any metadata from your user account, any messages and or content you send, and anything else you do or give by staying in Cephalon Sanctuary, or by using my bot.

If you do not agree to letting Genesis, Oratoris, or any other bot there do so, please kick Genesis from your servers.

tl;dr Bots need data. While I don't record any of your personal data or save it off for long-term use, I still need to tell you that bots can access your messages and user ID. If you don't want that, get rid of all of them, cause they all need that data.

## Installation

1. Clone this repo
```sh
# For SSH
git clone [email protected]/genesis.git

# For HTTPS
git clone https://github.com/WFCD/genesis.git
```
2. Install mysql server and configure a database to store settings and data

3. Run `npm i`

4. Start bot with [pm2](http://pm2.keymetrics.io/) using a copy of the provided `pm2.json` file. The scripts assume it's named `genesis.json`

5. See below for available config / commands

## Configuration

Genesis requires a MySQL server. It uses the **MYSQL_*** environment variables for determining where to connect to

### Base
| Environment Variable | Description | Example | Default |
|----------------------|------------------------------------------------------------------------|---------------------------------------------|-------------|
| TOKEN | Discord connection token | `mfa.234089sdfasdf20dfada,f.asd` | N\A |
| LOG_LEVEL | Logging level of the bot, including info, debug, error, fatal | `DEBUG` | `ERROR` |
| MYSQL_DB | MySQL database name, used for connecting to data provider and storage | `genesis` | `genesis` |
| MYSQL_PASSWORD | MySQL database connection password | `password` | N\A |
| MYSQL_USER | MySQL database connection user | `genesis` | `genesis` |
| MYSQL_PORT | MySQL database connection port | 3306 | 3306 |
| MYSQL_HOST | Hostname for conneting to MySQL | `localhost` | `localhost` |
| SHARD_OFFSET | Offset of the first shard id for the local shards, default 0 | 2 | 0 |
| LOCAL_SHARDS | Number of shards locally | 2 | 1 |
| SHARDS | Total number of shards | 1 | 1 |
| OWNER | ID of the person owning/running the bot, used for checking permissions | | |
| PREFIX | Default prefix to use for the instance | `\` | `\` |
| RAVEN_URL | DSN url for logging data to Sentry | `'https://***:***@sentry.io/***'` | N\A |
| CONTROL_WH_ID | Webhook id for the control webhook for system notifications | '0293485092348490834' | N\A |
| CONTROL_WH_TOKEN | Webhook token for the control webhook for system notifications | `asdpiofja[ospdj34095u8340wpodfj+_asdf-oja` | N\A |
| BUG_WH_ID | Webhook id for the bug webhook | '0293485092348490834' | N\A |
| BUG_WH_TOKEN | Webhook token for the bug webhook | `asdpiofja[ospdj34095u8340wpodfj+_asdf-oja` | N\A |

### Stats tracking
| Environment Variable | Description | Example | Default |
|------------------------|------------------------------------------------------------|---------------------|---------|
| DISCORD_BOTS_WEB_TOKEN | Token used to update bots.discord.pw bot statistics | `as;dofiahsdf` | N\A |
| DISCORD_BOTS_WEB_USER | Bot user id on bots.discord.pw to update with server count | 6456514654966321321 | N\A |
| DISCORD_CARBON_TOKEN | Carbonitex bot token for posting server data to Carbonitex | `as;dofiahsdf` | N\A |

### Flair configuration
| Environment Variable | Description | Example | Default |
|----------------------|-------------------------------------------------------------|-----------------------------------------------|-----------------------------------------------|
| EMBED_URL | Default link that embeds use in their title | `https://warframestat.us` | `https://warframestat.us` |
| EMBED_ICON_URL | Default icon URL that embeds use in their footer | `https://warframestat.us/wfcd_logo_color.png` | `https://warframestat.us/wfcd_logo_color.png` |
| BASE_PRES_MSG | Default presence message | `@Bot help` | `@Bot help` |
| BASE_PRES_ACT | Default presence activity. Must be a valid discord.js value | `WATCHING` | `PLAYING` |

### Feature Flags

| Environment Variable | Description | Example | Default |
|----------------------|-------------------------|-------------------------|---------|
| GAMES | Feature flags to enable | `WARFRAME,UTIL,LOGGING` | `CORE` |

* `CORE` does not need to be specified ever, it will always load

| Flag | Feature | Default |
|-----------|-----------------------------------------------------------------------------|---------|
| CORE | Core features of the bot | ✓ |
| UTIL | Common utility functions that are domain agnostic, such as LFG and builds | ✗ |
| LOGGING | Just what it sounds like, logging guild actions | ✗ |
| CODES | Managing promo codes, like Warframe Glyph codes | ✗ |
| FUN | Fun stuff, like 8Ball and corgis | ✗ |
| WARFRAME | Warframe functionality, like tracking and Warframe informational Commands | ✗ |
| DESTINY2 | For an in-progress section allowing people to expand Genesis into Destiny 2 | ✗ |
| GIVEAWAYS | Giveaway functionality | ✗ |
| CUST_CMDS | Custom commands - user-generated simple commands | ✗ |
| ROOMS | Automated & manual room creation | ✗ |
| BLOCK | Enable user disable features | ✗ |
| CMD_MGMT | Command management | ✗ |
| BOT_MGMT | Bot Management | ✗ |

### Setting up Twitch

| Environment Variable | Description | Example | Default |
|-------------------------|---------------------------------------------------------------|--------------------------------|----------|
| TWITCH_CLIENT_ID | Twitch Client ID for querying Twitch API | uo6dggojyb8d6soh92zknwmi5ej1q2 | N/A |
| TWITCH_USER_LOGIN | The Twitch user login to watch | warframe | warframe |
| TWITCH_POLL_INTERVAL_MS | How often to poll Twitch for stream updates (in milliseconds) | 10000 | 10000 |

In order to setup Twitch you need to specify your Twitch API Client ID. See the following link on how to get one:
* Twitch API Client ID: https://dev.twitch.tv/docs/v5/ (See Getting a client ID)

### Other Features

| Environment Variable | Description | Example | Default |
|----------------------|------------------------------------------------|--------------|--------------|
| LFG_ACTIVE_COLOR | Hex color as a string for an active LFG embed | `"0xaf01ff"` | `"0x9370db"` |
| LFG_EXPIRED_COLOR | Hex color as a string for an expired LFG embed | `"0xff0000"` | `"0xff0000"` |

## Commands

Honestly too many to put here

## License

[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)

### Private Docker Build!

Want to build your own image? All you (should) need to do is:
- clone this repo
- install docker
- install nodejs (and npm)
- run `npm run build` (builds the docker image and punishes locally)
- Copy `docker-compose.example.yaml` and update the environment variables to your needing
- Run `docker-compose up -d`
- If you'd like to check logs, use `docker logs genesis --follow`