├── .env.TEMPLATE
├── .gitignore
├── package.json
├── config.json
├── README.md
└── index.js
/.env.TEMPLATE:
--------------------------------------------------------------------------------
1 | TOKEN=
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .env
2 | node_modules
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "messagelogger",
3 | "version": "1.0.0",
4 | "description": "Sorry to developers that may find this \"too informative\", trying my best to make this available to everyone. :)",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node .",
8 | "dev": "nodemon ."
9 | },
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "console-log-colors": "^0.2.3",
14 | "discord.js-selfbot-v13": "^2.8.4",
15 | "dotenv": "^16.0.3"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "dms": {
4 | "create": false,
5 | "create_info_": "true: Log message creations | false: Do not log message creations",
6 |
7 | "delete": true,
8 | "delete_info_": "true: Log delete message events | false: Do not log delete message events",
9 |
10 | "edit": true,
11 | "edit_info_": "true: Log edit message events | false: Do not log edit message events"
12 | },
13 |
14 | "guilds": {
15 | "create": false,
16 | "create_info_": "true: Log message creations | false: Do not log message creations",
17 |
18 | "delete": true,
19 | "delete_info_": "true: Log delete message events | false: Do not log delete message events",
20 |
21 | "edit": false,
22 | "edit_info_": "true: Log edit message events | false: Do not log edit message events",
23 |
24 | "bots": false,
25 | "bots_info_": "This determines whether or not bot messages are logged"
26 | },
27 |
28 | "servers": [],
29 | "servers_info_": "Disable this module by leaving it blank. This module enables the ability to only see messages from certain servers.",
30 | "servers_info__": "Only put server IDs in this, seperate by a comma (,). Make sure to use quotes when putting server IDs in",
31 |
32 | "servers_ignore": [],
33 | "servers_ignore_info_": "The servers you want to ignore. seperate by a comma and seperate your servers in quotes"
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Sorry to developers that may find this "too informative", trying my best to make this available to everyone. :)
2 |
3 | # ⚠ This program is no longer maintained due to the MessageLogger plugin being fixed.
4 | Please do not contact me about this, I am not longer working on/interested in this project. I will accept pull requests and close any issues that have been solved by such.
5 |
6 | # ❗❗ THIS IS AGAINST TOS! ❗❗ (same with BD)
7 | Discord doesn't take self bots lightly. I recommend looking into other options before moving forward with the use of this. Though, this bot will **NOT** and will **NEVER** interact with your account other than logging in and will simply log events, so it is **undetectable** in a way, but still advised *against* use.
8 |
9 | https://discord.com/tos
10 |
11 | ## CSLMessageLogger - What is it?
12 | CSLMessageLogger was created as an alternative to MessageLoggerV2 (Discord plugin). This bot is, once again, against TOS and I recommend against using it (as with BetterDiscord).
13 |
14 | ## How do I use CSLMessageLogger?
15 | ## I will not help you if you don't read this tutorial first.
16 | ### YOU NEED NODE FOR THIS TO WORK!
17 | *After installing node, make sure to run `npm install` in the console to install all dependencies*\
18 | https://nodejs.dev/en/
19 |
20 | ### Also, make sure you're in the project directory when running any node commands.
21 |
22 | 1. **Firstly**, you need to download this GitHub repository. Handle that how you will, but I recommend using `git clone ` - doesn't matter how you do it though.
23 |
24 | 2. **Afterwards**, you need to rename `.env.TEMPLATE` to `.env`.
25 |
26 | **.ENV: DO NOT SHARE THIS FILE WITH ANYONE, IT CONTAINS EXTREMELY SENSITIVE INFORMATION.**
27 |
28 | 3. **Now**, get your token
29 |
30 | Get your Discord token using this script in the Discord console (key combination: `CTRL+SHIFT+I`):
31 |
32 | ```js
33 | window.webpackChunkdiscord_app.push([
34 | [Math.random()],
35 | {},
36 | req => {
37 | for (const m of Object.keys(req.c)
38 | .map(x => req.c[x].exports)
39 | .filter(x => x)) {
40 | if (m.default && m.default.getToken !== undefined) {
41 | return copy(m.default.getToken());
42 | }
43 | if (m.getToken !== undefined) {
44 | return copy(m.getToken());
45 | }
46 | }
47 | },
48 | ]);
49 |
50 | console.log('%cGrabber worked!', 'font-size: 50px');
51 | console.log(`%cThe token has been copied to your clipboard!`, 'font-size: 16px');
52 | console.log(`%cDo not share this token with anyone.`, 'font-size: 14px');
53 | ```
54 |
55 | This script has been created by https://github.com/hxr404/Discord-Console-hacks
56 |
57 | 4. **In `.env`**, add all the information required.
58 |
59 | 5. Edit the config (`config.json`) to your liking
60 |
61 | 6. **Run the script with `npm run start`**
62 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | require('dotenv').config();
2 |
3 | const { color } = require('console-log-colors');
4 | const { Client } = require('discord.js-selfbot-v13');
5 | const client = new Client({ checkUpdate: false });
6 |
7 | const fs = require('fs');
8 |
9 | if(!fs.existsSync(__dirname + '/config.json')) {
10 | console.log(`${color.redBG('[Exception | FileNotFound]')} Unable to find file "config.json"`);
11 | }
12 |
13 | /**
14 | * Log layout:
15 | * [Notification]
16 | * [Exception | ]
17 | * [Log | | ()] :
18 | */
19 |
20 | let config;
21 | client.on('ready', async () => {
22 | config = JSON.parse(await fs.readFileSync(__dirname + '/config.json', 'utf8'));
23 | console.log(`${color.blue('[Notification]')} CSLMessageLogger has been successfully started`);
24 | });
25 |
26 | client.on('messageCreate', async (message) => {
27 | if(message.author == null) return;
28 |
29 | if(config.modules.dms.create && message.channel.type == 'DM') {
30 | console.log(`${color.greenBright(`[Log | MessageCreate | ${message.author.tag}]`)} ${message.content}`);
31 | return;
32 | }
33 |
34 | if(!config.modules.guilds.bots && message.author.bot) return;
35 |
36 | if(message.guild == null) return;
37 | if(config.modules.servers_ignore.includes(message.guild.id)) return;
38 |
39 | if(
40 | config.modules.servers.length > 0
41 | && config.modules.servers.includes(message.guild.id)
42 | ) {
43 | if(message.guild == null) return;
44 | if(message.author.id === client.user.id) return;
45 |
46 | if(config.modules.guilds.create) {
47 | console.log(`${color.greenBright(`[Log | MessageCreate | ${message.guild.name} (${message.guild.id}) | #${message.channel.name}] `)}`
48 | + `${color.gray(message.author.tag)}: ${message.content}`);
49 |
50 | return;
51 | }
52 | }
53 |
54 | if(config.modules.servers.length === 0) {
55 | if(message.guild == null) return;
56 | if(message.author.id === client.user.id) return;
57 |
58 | if(config.modules.guilds.create) {
59 | console.log(`${color.greenBright(`[Log | MessageCreate | ${message.guild.name} (${message.guild.id}) | #${message.channel.name}] `)}`
60 | + `${color.gray(message.author.tag)}: ${message.content}`);
61 |
62 | return;
63 | }
64 | }
65 | });
66 |
67 | client.on('messageDelete', async (message) => {
68 | if(message.author == null) return;
69 |
70 | if(config.modules.dms.delete && message.channel.type == 'DM') {
71 | console.log(`${color.redBright(`[Log | MessageDelete | ${message.author.tag}]`)} ${message.content}`);
72 | return;
73 | }
74 |
75 | if(!config.modules.guilds.bots && message.author.bot) return;
76 |
77 | if(message.guild == null) return;
78 | if(config.modules.servers_ignore.includes(message.guild.id)) return;
79 |
80 | if(
81 | config.modules.servers.length > 0
82 | && config.modules.servers.includes(message.guild.id)
83 | ) {
84 | if(message.guild == null) return;
85 | if(message.author.id === client.user.id) return;
86 |
87 | if(config.modules.guilds.delete) {
88 | console.log(`${color.redBright(`[Log | MessageDelete | ${message.guild.name} (${message.guild.id})] | #${message.channel.name}] `)}`
89 | + `${color.gray(message.author.tag)}: ${message.content}`);
90 |
91 | return;
92 | }
93 | }
94 |
95 | if(config.modules.servers.length === 0) {
96 | if(message.guild == null) return;
97 | if(message.author.id === client.user.id) return;
98 |
99 | if(config.modules.guilds.delete) {
100 | return console.log(`${color.redBright(`[Log | MessageDelete | ${message.guild.name} (${message.guild.id})] | #${message.channel.name}] `)}`
101 | + `${color.gray(message.author.tag)}: ${message.content}`);
102 |
103 | return;
104 | }
105 | }
106 | });
107 |
108 | client.on('messageUpdate', async (oldMessage, newMessage) => {
109 | if(oldMessage.author == null || newMessage.author == null) return;
110 |
111 | if(config.modules.dms.edit && oldMessage.channel.type == 'DM') {
112 | return console.log(`${color.bgGreenBright(`[Log | MessageEdit | ${newMessage.author.tag}]`)} ${oldMessage.content} > ${newMessage.content}`);
113 | }
114 |
115 | if(!config.modules.guilds.bots && newMessage.author.bot) return;
116 | if(newMessage.guild == null) return;
117 | if(config.modules.servers_ignore.includes(newMessage.guild.id)) return;
118 |
119 | if(
120 | config.modules.servers.length > 0
121 | && config.modules.servers.includes(newMessage.guild.id)
122 | ) {
123 | if(newMessage.guild == null) return;
124 | if(newMessage.author.id === client.user.id) return;
125 |
126 | if(config.modules.guilds.edit) {
127 | console.log(`${color.bgGreenBright(`[Log | MessageEdit | ${newMessage.guild.name} (${newMessage.guild.id}) | #${newMessage.channel.name}]`)} `
128 | + `${color.gray(newMessage.author.tag)}: ${oldMessage.content} > ${newMessage.content}`);
129 |
130 | return;
131 | }
132 | }
133 |
134 | if(config.modules.servers.length === 0) {
135 | if(newMessage.guild == null) return;
136 | if(newMessage.author.id === client.user.id) return;
137 |
138 | if(config.modules.guilds.edit) {
139 | console.log(`${color.bgGreenBright(`[Log | MessageEdit | ${newMessage.guild.name} (${newMessage.guild.id}) | #${newMessage.channel.name}]`)} `
140 | + `${color.gray(newMessage.author.tag)}: ${oldMessage.content} > ${newMessage.content}`);
141 |
142 | return;
143 | }
144 | }
145 | });
146 |
147 | client.login(process.env.TOKEN).catch(() => {
148 | console.log(`${color.redBG('[Exception | TokenError]')} Unable to login. Your token could be invalid or this script could be outdated.`);
149 | process.exit(-1);
150 | });
151 |
--------------------------------------------------------------------------------