Improve strange status logging
This commit is contained in:
parent
eaa505bfb1
commit
81526839cb
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "denim_3001",
|
||||
"version": "3001.62.5",
|
||||
"version": "3001.62.6",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "denim_3001",
|
||||
"version": "3001.62.5",
|
||||
"version": "3001.62.6",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@discordjs/voice": "^0.18.0",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "denim_3001",
|
||||
"version": "3001.62.5",
|
||||
"version": "3001.62.6",
|
||||
"description": "Toto je velmi kvalitní bot.",
|
||||
"repository": {
|
||||
"url": "https://github.com/Histmy/Denim-Bot/"
|
||||
|
||||
12
src/app.ts
12
src/app.ts
@ -1,4 +1,4 @@
|
||||
import { ButtonStyle, ChannelType, Client, ClientPresenceStatusData, CommandInteraction, GatewayIntentBits, InteractionReplyOptions, Message, Partials } from "discord.js";
|
||||
import { ButtonStyle, ChannelType, Client, ClientPresenceStatusData, CommandInteraction, GatewayIntentBits, InteractionReplyOptions, Message, Partials, Presence } from "discord.js";
|
||||
import { readdirSync } from "fs";
|
||||
import { CClient, CUser, HelpServer, Komand, KomandNaExport, KomandRaw, ListenerFunkce, Modul, SMessage, SRecord, SuperListenerFunkce } from "./utils/types";
|
||||
import { adminLog, areStatusesSame, formatCas, log, nabidni, oddiakritikovat, prefix, rand, messageReply } from "./utils/utils.js";
|
||||
@ -373,10 +373,8 @@ client.on("messageCreate", async mes => {
|
||||
});
|
||||
});
|
||||
|
||||
function alertPokudNestandardni(client: CClient, presence: ClientPresenceStatusData | null) {
|
||||
if (!presence) {
|
||||
return;
|
||||
}
|
||||
function alertPokudNestandardni(client: CClient, aft: Presence) {
|
||||
const presence = aft.clientStatus;
|
||||
|
||||
for (const pres in presence) {
|
||||
if (["web", "mobile", "desktop"].includes(pres)) {
|
||||
@ -384,7 +382,7 @@ function alertPokudNestandardni(client: CClient, presence: ClientPresenceStatusD
|
||||
}
|
||||
|
||||
// Máme jinej
|
||||
adminLog(client, `zahlidnul jsem zvlastni status "${pres}"`);
|
||||
adminLog(client, `zahlidnul jsem zvlastni status "${pres}".\n\`\`\`${JSON.stringify(presence)}\`\`\`\nod uzivatele ${aft.userId} ${aft.user}`);
|
||||
}
|
||||
}
|
||||
|
||||
@ -396,7 +394,7 @@ client.on("presenceUpdate", async (bef, aft) => {
|
||||
|
||||
if (areStatusesSame(aft.clientStatus, user.presence)) return;
|
||||
|
||||
alertPokudNestandardni(client, aft.clientStatus);
|
||||
alertPokudNestandardni(client, aft);
|
||||
|
||||
const naCo = aft.clientStatus || {};
|
||||
user.presence = naCo;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user