|
|
5 anos atrás | |
|---|---|---|
| .gitignore | 6 anos atrás | |
| LICENSE | 6 anos atrás | |
| README.md | 6 anos atrás | |
| config.json.example | 5 anos atrás | |
| index.js | 5 anos atrás | |
| package-lock.json | 6 anos atrás | |
| package.json | 6 anos atrás | |
| start.bat | 6 anos atrás |
The purpose of this bot is to dump the messages sent in a chat channel of discord to a MySQL database, with content, time, id, sender id, attachments links and image links all separated.
!dump command (prefix can be changed in the config file)## How to set up
npm install .config.json and configure as detailed below.|Setting|Description|
|--|--|
|token|Discord API bot token|
|prefix|The prefix that will be used to trigger commands|
|servers|Arrays of configured servers|
|servers.channel|ID of Discord channel to listen to|
|servers.mentionsMode| Conversion settings for user mentions in Discord messages. 0 will set as the user ID, e.g. @182925154211332097. 1 will set as just the username, e.g. @Owen. Anything else will set as the username + discriminator, e.g. @Owen#1111|
|servers.authorMode|Same settings as mentionsMode but for message authors|
|servers.dbHost|MySQL database host|
|servers.dbUser|MySQL database username|
|servers.dbPassword|MySQL database password|
|servers.db|MySQL database to store data in|
|servers.dbTable|MySQL database table to store data in|
Setup the MySQL database table with the following query, replacing "TABLE_NAME" as appropriate.
CREATE TABLE `TABLE_NAME` (
`message` longtext NOT NULL,
`id` text NOT NULL,
`time` varchar(25) NOT NULL,
`user` text NOT NULL,
`links` text NOT NULL,
`images` text NOT NULL
) COLLATE 'utf8mb4_unicode_ci';
Start the bot by running node index.js or nodemon (start.bat on Windows)
Congratulation, your bot is up and running!
## If any problem comes up or something please open an issue on github
Have a great life!