CampbellCrowley / SpikeyBot-Discord

SpikeyBot for Discord. Hunger Games simulator, and other helpful commands.
https://www.spikeybot.com
30 stars 13 forks source link
bot discord discord-bot discord-js hungry-games simulating-games

SpikeyBot is no longer in active development, and cannot be added to your server.

SpikeyBot.com Status Server Count Discord Support Server Build Status SpikeyBot Version Dependencies Status Last Commit Patreon PayPal

Bot's website: SpikeyBot.com

Commands

Web Page with most commands available on the bot's website

Self-Hosting

The bot is not designed to be easily hosted by others, but still may be done.
The below steps outline the minimum required to get the SpikeyBot to run.
This tutorial uses the Discord.js sharding system, which may become deprecated in the future.
1) Have a server/computer

Hungry Games requires a MariaDB server to be available for storage of all events. If this database is not setup properly, HG may run into problems, and is not tested.
MariaDB table descriptions available in ./docs/describe.txt.

Alternate Sharding System

With the v1.14 update an alternate sharding system is included which interfaces with the Discord.js sharding system, but extends it's functionality to support the master shard to be on a different physical host than the rest of the shards.

This system is not yet documented in any form, but the basic structure is one instance of ./src/sharding/ShardingMaster.js is started on a publicly visible host, with a ./src/sharding/ShardingSlave.js also started in the same directory to act as the master shard for the webservers.
Following shards can then be started on remote hosts as ./src/sharding/ShardingSlave.js instances.

ShardingSlaves will be configured using the config file automatically generated by the ShardingMaster.
The ShardingMaster is in turn configured in the ./config/shardMasterConfig.js file (The ".default" file is expected to be copied then modified to your liking).

CLI Arguments

All arguments are optional for normal usage.

--dev: Flips isRelease in ./src/common.js, and changes which ports are used for webservers.
--botname=BOTNAME: Overwrites the name of the bot token to use in the ./auth.js file.
--minimal: Starts the bot normally, but doesn't change the bot's presence, manage reboot/crash handling, command logging, or any default commands in SpikeyBot (not MainModule commands).
--test: Bot will go into unit testing mode.
--nologin: Bot will not attempt to login to Discord, but will continue to do everything else normally, including loading MainModules. If this is used, most SubModules will not do anything as they rely on a connection to Discord to be made. This is to support a single process that acts as the master node of webservers.
--shards[=NUMSHARDS]: Specifies that we wish to use Discord.js built-in sharding. The number of shards does not need to be specified if we wish to use Discord.js' suggested number of shards.
--shardmem=MEMBYTES: The number of bytes to allocate for each shard's heap.
--backup: Runs the bot as a fallback node. It will not attempt to load any MainModules, and essentially does nothing, but sets the default presence to DND in order to signify that the bot is unavailable. This is intended to be expanded in its features to take over when a shard went offline, but that may no longer be feasible.
--delay[=5000]: Time in milliseconds to wait after ready before contacting Discord to login, or start shards.
--inspect: Passes --inspect to the NodeJS process of spawned shards.

Development

Service Release Port Development Port
Proxy 8010 8012
HG 8011 8013
Stats 8016 8017
WebApi 8018 8019
Account 8014 8015
Settings 8020 8021
File Server 8022 8023
Shard Master 8024 8025

Hidden Commands

These commands are not included in the normal help page or help command because they are either easter-eggs, developer commands, or just not useful for most users.

Event Controlled