feat: show message content on debug mode
This commit is contained in:
parent
dfb74c400c
commit
6969ffd7df
@ -64,3 +64,9 @@ yarn install
|
|||||||
```bash
|
```bash
|
||||||
node . "UR_TOKEN"
|
node . "UR_TOKEN"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To show messages content
|
||||||
|
|
||||||
|
```bash
|
||||||
|
node . "UR_TOKEN" debug
|
||||||
|
```
|
||||||
|
@ -6,7 +6,8 @@ import moment from "moment";
|
|||||||
import "json-bigint-patch";
|
import "json-bigint-patch";
|
||||||
|
|
||||||
const secondsDelay = 2,
|
const secondsDelay = 2,
|
||||||
token = process.argv[2];
|
token = process.argv[2],
|
||||||
|
debugMode = process.argv[3] == "debug";
|
||||||
|
|
||||||
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
|
|
||||||
@ -99,7 +100,7 @@ async function main() {
|
|||||||
const totalTimeReamining: number = (totalMessages - totalDeleted) * secondsDelay;
|
const totalTimeReamining: number = (totalMessages - totalDeleted) * secondsDelay;
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
`Deleting message ${message.ID} in channel ${channelData.id} with user ${destinataireId}
|
`${debugMode ? `${message.Contents}\n` : ""}Deleting message ${message.ID} in channel ${channelData.id} with user ${destinataireId}
|
||||||
- Channel: ${channelMessages.filter((message) => message.Deleted).length}/${channelMessages.length} - ${channelTotalPourcentage}% - ${moment.duration(channelTotalTimeReamining, "seconds").humanize()} remaining
|
- Channel: ${channelMessages.filter((message) => message.Deleted).length}/${channelMessages.length} - ${channelTotalPourcentage}% - ${moment.duration(channelTotalTimeReamining, "seconds").humanize()} remaining
|
||||||
- Total: ${totalDeleted}/${totalMessages} - ${totalPourcentage}% - ${moment.duration(totalTimeReamining, "seconds").humanize()} remaining`
|
- Total: ${totalDeleted}/${totalMessages} - ${totalPourcentage}% - ${moment.duration(totalTimeReamining, "seconds").humanize()} remaining`
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user