Mei has beautiful friend called Snowball, which used to make a Blizzard and cease enemy resistance. Actually, this bot don't used to be in fights, it's just good friend that helps you with your server.
To install bot, you need to have installed LATEST version of NodeJS. Then, you should install TypeScript compiler and dependencies by running these commands:
NPM:
npm install --global typescript
npm install
Yarn:
⚠️ YARN IS NOT SUPPORTED AT THE MOMENT. We love yarn, but there's a big problem comes with it: no git subpackages updates. As we started to use alpha releases ofdiscord.js
, typings ofdiscord.js
don't get downloaded by yarn. It causes errors on build and kills code editor's linting + suggestions.
yarn global add typescript
yarn install
Then try to run build
npm script by using this command:
npm build
All compiled files will stay in directory named out
.
Now, after compilation you should setup your bot for working.
Create file named configuration.json
in out/config
directory. See configuration.example.json
name
(string
): Name of the bot, used for output in consoletoken
(string
): Bot authorization token, get it using My Apps page on Discord Developers site.modules
(IModuleInfo[]
): Represents an array with information about plugins which will be registered once bot started.autoLoad
(string
): Array of names of plugins which should be automatically loaded after registration, be sure you typing their names right: case matters, it's not path.botOwner
(string
): Your (owner) Discord ID. It gives you permission to calleval
command and other stuff which can do damage to bot if you type wrong ID here.localizerOptions
(ILocalizerOptions
): Configuration for your localizerlanguages
(string[]
): Languages code (file names, e.g.en-US
)default_language
(string
): Default language code (it'll be used for new servers)source_language
(string
): Source language code (it'll be used as fallback)directory
(string
): Absolute path fromout
directorydisable_coverage_log
(boolean
, optional): Disables "Translation Coverage" log which shows all untranslated strings
shardingOptions
queueModuleLoading
(boolean
, optional): Enable "Queue Mode" loading for modules, will load modules at same time without waiting forinit
if set tofalse
ravenUrl
(string
, optional): Your URL for Raven generated by Sentry.io, this allows to catch all the errors in more nicer look
I like to use MySQL database, compatible with nice knexjs
library. You need to install it and setup user snowballbot
. Put password into environment variable named DB_PASSWD
. If you want, you can set different name for user, database name and even host IP using this vars:
DB_HOST
: Where database hosted (default falls to127.0.0.1
)DB_NAME
: Name of database where bot will store their tablesDB_PASSWD
: Password for database userDB_USER
: Name of user who connecting to database
To insure saving of unicode 8 emojis I changed my.cfg
(thanks Google):
[mysqld]
init_connect='SET collation_connection = utf8mb4_unicode_ci'
init_connect='SET NAMES utf8mb4'
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
skip-character-set-client-handshake
[mysql]
default-character-set=utf8mb4
You had to setup database, environment variable and configuration json file (locally).
Now, in your out
is real distribute of your bot. You pushing it to your VM (VPS) and starting using:
# installing all deps (that's why we copied package.json)
npm install
# making run.sh executable
chmod +x ./run.sh
# then you just starting bot
./run.sh
🎉 Bot should now work. Not works? Create new Issue and I'll gonna say what's wrong
I really appreciate your contribution to this project. You can fix my errors, create new good cogs, but follow these styles:
- Use Visual Studio Code, it's awesome editor better than others and has good support for TypeScript.
- Use
tslint
, it'll notify you if there's an errors in your code. VSCODE EXTENSION - Use my universal APIs. I created
db
,letters
,utils
,cacheResponse
,time
, be sure you using them, they pretty simple - Make plugin for all servers, not yours one. To be honest, you can create cog for
shib channel
- that's fine (I included same cogs in source just for fun), but you should provide support for other servers if you making serious plugins likeOverwatch statistic
.
Don't be scared of making Pull Requests! Make it! I will suggest you what to change, what to not and etc :)
If you regular user, then report bugs and feedback to Issues section. You also can ask questions there.
You can create private cogs without commiting them to public. Put your cog in private_cogs
directory.
BOT MADE WITH ♥ BY DAFRI_NOCHITEROV.
Mei is hero from Overwatch, game created by Blizzard.
Snowball icon originally created by Rubious Marie [?]