2020-03-09 23:27:19 +01:00
|
|
|
// @ts-check
|
2017-11-25 19:20:46 +01:00
|
|
|
'use strict';
|
|
|
|
|
2020-03-09 23:27:19 +01:00
|
|
|
/**
|
|
|
|
* @typedef { import('./typings/config').Config } Config
|
|
|
|
* @typedef { import('./typings/config').InlineKeyboard } InlineKeyboard
|
|
|
|
*/
|
|
|
|
|
2017-11-25 19:20:46 +01:00
|
|
|
/*
|
|
|
|
* Create `config.js` by running `cp example.config.js config.js`
|
|
|
|
* in the project folder, then edit it.
|
|
|
|
*
|
|
|
|
* Config file in JSON format (`config.json`) is also supported.
|
|
|
|
* For backwards compatibility, and because why not, it needs no extra code.
|
|
|
|
*/
|
|
|
|
|
2018-11-20 11:47:30 +05:30
|
|
|
/**
|
|
|
|
* Millisecond
|
|
|
|
* String to be parsed by https://npmjs.com/millisecond,
|
|
|
|
* or number of milliseconds. Pass 0 to remove immediately.
|
2018-11-28 18:23:57 +01:00
|
|
|
* @typedef {( number | string )} ms
|
2018-11-20 11:47:30 +05:30
|
|
|
*/
|
|
|
|
|
2020-03-09 23:27:19 +01:00
|
|
|
/**
|
|
|
|
* @type {Config}
|
|
|
|
*/
|
|
|
|
const config = {
|
2017-11-25 19:20:46 +01:00
|
|
|
|
|
|
|
/**
|
2019-01-28 15:20:00 +01:00
|
|
|
* @type {!( number | string | (number|string)[] )}
|
2017-11-25 19:20:46 +01:00
|
|
|
* ID (number) or username (string) of master,
|
|
|
|
* the person who can promote and demote admins,
|
|
|
|
* and add the bot to groups.
|
|
|
|
*/
|
|
|
|
master: 123456789,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {!string}
|
|
|
|
* Telegram Bot token obtained from https://t.me/BotFather.
|
|
|
|
*/
|
|
|
|
token: '',
|
|
|
|
|
|
|
|
|
2019-01-21 17:22:53 +01:00
|
|
|
chats: {
|
2023-09-20 00:05:55 +05:30
|
|
|
/**
|
|
|
|
* @type {(number | false)}
|
|
|
|
* Chat to send member (un)ban/(un)warn/report notifications and relevant messages to.
|
|
|
|
* Pass false to disable this feature.
|
|
|
|
*/
|
|
|
|
adminLog: false,
|
2019-01-21 17:22:53 +01:00
|
|
|
|
2019-07-06 10:10:41 -04:00
|
|
|
/**
|
|
|
|
* @type {(number | false)}
|
|
|
|
* Chat to send member join/leave notifications to.
|
|
|
|
* Pass false to disable this feature.
|
|
|
|
*/
|
|
|
|
presenceLog: false,
|
|
|
|
|
2019-01-21 17:22:53 +01:00
|
|
|
/**
|
|
|
|
* @type {(number | false)}
|
|
|
|
* Chat to send report notifications to.
|
|
|
|
* Pass false to disable this feature.
|
|
|
|
*/
|
2020-10-15 02:48:14 +05:30
|
|
|
report: false,
|
2019-01-21 17:22:53 +01:00
|
|
|
},
|
|
|
|
|
2017-11-25 19:20:46 +01:00
|
|
|
/**
|
|
|
|
* @type {( 'all' | 'own' | 'none' )}
|
|
|
|
* Which messages with commands should be deleted?
|
|
|
|
* Defaults to 'own' -- don't delete commands meant for other bots.
|
|
|
|
*/
|
2018-10-30 11:04:24 +05:30
|
|
|
deleteCommands: 'own',
|
2017-11-25 19:20:46 +01:00
|
|
|
|
2019-04-20 18:05:01 +02:00
|
|
|
deleteCustom: {
|
2020-03-09 23:27:19 +01:00
|
|
|
longerThan: 450, // UTF-16 characters
|
2019-04-20 18:05:01 +02:00
|
|
|
after: '20 minutes'
|
|
|
|
},
|
|
|
|
|
2017-11-25 19:20:46 +01:00
|
|
|
/**
|
2019-02-07 15:54:05 +05:30
|
|
|
* @type {(ms | false)} Millisecond
|
2017-11-25 19:20:46 +01:00
|
|
|
* Timeout before removing join and leave messages.
|
2018-11-20 11:47:30 +05:30
|
|
|
* [Look at typedef above for details.]
|
2018-11-28 18:23:57 +01:00
|
|
|
* Pass false to disable this feature.
|
2017-11-25 19:20:46 +01:00
|
|
|
*/
|
|
|
|
deleteJoinsAfter: '2 minutes',
|
|
|
|
|
2018-11-20 11:47:30 +05:30
|
|
|
/**
|
2019-02-07 15:54:05 +05:30
|
|
|
* @type {(ms | { auto: (ms | false), manual: (ms | false) } | false)}
|
2018-11-20 11:47:30 +05:30
|
|
|
* Timeout before removing auto-warn messages.
|
|
|
|
* [Look at typedef above for details.]
|
|
|
|
* Pass an object with { auto, manual } for more granular control
|
|
|
|
* over which messages get deleted
|
2018-11-28 18:23:57 +01:00
|
|
|
* Pass false to disable this feature.
|
2018-11-20 11:47:30 +05:30
|
|
|
*/
|
|
|
|
deleteWarnsAfter: false,
|
|
|
|
|
|
|
|
/**
|
2019-02-07 15:54:05 +05:30
|
|
|
* @type {(ms | false)}
|
2018-11-20 11:47:30 +05:30
|
|
|
* Timeout before removing ban messages.
|
|
|
|
* [Look at typedef above for details.]
|
2018-11-28 18:23:57 +01:00
|
|
|
* Pass false to disable this feature.
|
2018-11-20 11:47:30 +05:30
|
|
|
*/
|
|
|
|
deleteBansAfter: false,
|
|
|
|
|
2018-10-30 11:04:24 +05:30
|
|
|
/**
|
|
|
|
* @type {string[]}
|
|
|
|
* List of blacklisted domains.
|
|
|
|
* Messages containing blacklisted domains will automatically be warned.
|
|
|
|
* If the link is shortened, an attempt will be made to resolve it.
|
|
|
|
* If resolved link is blacklisted, it will be warned for.
|
|
|
|
*/
|
|
|
|
blacklistedDomains: [],
|
|
|
|
|
2017-11-25 22:55:28 +03:30
|
|
|
/**
|
|
|
|
* @type {( string[] | false )}
|
|
|
|
* List of whitelisted links and usernames,
|
|
|
|
* For channels and groups to stop warning users for them.
|
2020-03-09 23:27:19 +01:00
|
|
|
* Pass false to whitelist all links and channels.
|
2017-11-25 22:55:28 +03:30
|
|
|
*/
|
2017-11-25 19:20:46 +01:00
|
|
|
excludeLinks: [],
|
|
|
|
|
2018-11-28 18:23:57 +01:00
|
|
|
/**
|
|
|
|
* @type {ms}
|
|
|
|
* Don't count warns older than this value towards automatic ban.
|
|
|
|
* [Look at typedef above for details.]
|
|
|
|
*/
|
|
|
|
expireWarnsAfter: Infinity,
|
|
|
|
|
2017-11-25 19:20:46 +01:00
|
|
|
/**
|
2020-03-09 23:27:19 +01:00
|
|
|
* @type {InlineKeyboard}
|
2017-11-25 19:20:46 +01:00
|
|
|
* Inline keyboard to be added to reply to /groups.
|
|
|
|
* We use it to display button opening our webpage.
|
|
|
|
*/
|
|
|
|
groupsInlineKeyboard: [],
|
|
|
|
|
|
|
|
numberOfWarnsToBan: 3,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {string[]}
|
|
|
|
* List of plugin names to be loaded.
|
|
|
|
* See Readme in plugins directory for more details.
|
|
|
|
*/
|
|
|
|
plugins: [],
|
|
|
|
|
|
|
|
/**
|
2020-03-09 23:27:19 +01:00
|
|
|
* @type {InlineKeyboard}
|
2017-11-25 19:20:46 +01:00
|
|
|
* Inline keyboard to be added to warn message.
|
|
|
|
* We use it to display button showing our rules.
|
|
|
|
*/
|
|
|
|
warnInlineKeyboard: [],
|
|
|
|
};
|
|
|
|
|
2020-03-09 23:27:19 +01:00
|
|
|
module.exports = Object.freeze(config);
|