/
config.js
60 lines (49 loc) · 2.17 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require('dotenv').config();
const getConfig = () => {
const messesageFetchCount = Number.parseInt(process.env.MESSAGE_FETCH_COUNT);
const oneBlockedPercent = Number.parseFloat(process.env.ONE_BLOCKED_PERCENT);
const realestOneBlockedPercentneBlockedPercent = Number.parseFloat(process.env.REALEST_ONE_BLOCKED_PERCENT);
const searchPhrasesToBlock = (process.env.SEARCH_PHRASES_TO_BLOCK ?? '').split(',').filter(phrase => phrase.trim() !== '');
return {
/**
* Set to true to allow !configDump
*/
AllowConfigDump: process.env.ALLOW_CONFIG_DUMP?.localeCompare('true', 'en', { sensitivity: 'base' }) === 0,
/**
* Array of people that get the Keroac5 treatment.
*/
TheRealests: process.env.THE_REALEST_MFERS?.split(';') ?? [ 'kerouac5' ],
/**
* Number of messages to fetch when retrieving history.
*/
MessageFetchCount: (messesageFetchCount >= 0) ? messesageFetchCount : 50,
/**
* Path to the scoring database.
*/
ScoreDatabase: process.env.SCORE_DATABASE ?? './score.db3',
/**
* Set to true via the environment variable DISABLE_ONE_BLOCKED_MESSAGE to disable the random one blocked mssage behavior.
*/
DisableOneBlockedMessage: process.env.DISABLE_ONE_BLOCKED_MESSAGE?.localeCompare('true', 'en', { sensitivity: 'base' }) === 0,
/**
* Percentage change of getting "who is one blocked message" for plebians who should be so lucky to be in
* the present of so much KIR.
*/
OneBlockedPercent: (oneBlockedPercent >= 0) ? oneBlockedPercent : 1,
/**
* Percentage change of getting "who is one blocked message" for the realest.
*/
RealestOneBlockedPercent: (realestOneBlockedPercentneBlockedPercent >= 0) ? realestOneBlockedPercentneBlockedPercent : 5,
/**
* Phrases to ignore in a search and replace.
*/
SearchPhrasesToBlock : searchPhrasesToBlock,
/**
* The discord token.
*/
Token: process.env.TOKEN
};
};
module.exports = {
getConfig
};