feat: show message content on debug mode

This commit is contained in:
M1000fr 2024-09-08 12:56:49 +02:00
parent dfb74c400c
commit 6969ffd7df
2 changed files with 9 additions and 2 deletions

View File

@ -64,3 +64,9 @@ yarn install
```bash
node . "UR_TOKEN"
```
To show messages content
```bash
node . "UR_TOKEN" debug
```

View File

@ -6,7 +6,8 @@ import moment from "moment";
import "json-bigint-patch";
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));
@ -99,7 +100,7 @@ async function main() {
const totalTimeReamining: number = (totalMessages - totalDeleted) * secondsDelay;
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
- Total: ${totalDeleted}/${totalMessages} - ${totalPourcentage}% - ${moment.duration(totalTimeReamining, "seconds").humanize()} remaining`
);