fixes
This commit is contained in:
parent
b65f6b33ef
commit
e55d79519e
1 changed files with 24 additions and 31 deletions
55
index.ts
55
index.ts
|
@ -1,20 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Vencord, a modification for Discord's desktop app
|
* Vencord, a Discord client mod
|
||||||
* Copyright (c) 2024 nin0dev
|
* Copyright (c) 2025 Vendicated and contributors
|
||||||
*
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* This program is free software: you can redistribute it and/or modify
|
*/
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
|
@ -113,8 +101,27 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
flux: {
|
flux: {
|
||||||
async MESSAGE_CREATE
|
async MESSAGE_CREATE
|
||||||
({ guildId, message }) {
|
({ guildId, message }) {
|
||||||
|
if(Vencord.Plugins.plugins.GoodPerson.settings?.store.incoming) {
|
||||||
|
const msg = message;
|
||||||
|
// @ts-ignore
|
||||||
|
let newMessageContent = Vencord.Plugins.plugins.GoodPerson.replaceBadVerbs(Vencord.Plugins.plugins.GoodPerson.replaceBadNouns(msg.content));
|
||||||
|
if (message.content !== newMessageContent) {
|
||||||
|
newMessageContent += "\n-# <:husk:1280158956341297225> **GoodPerson made this message good. Reload your client to clear changes**";
|
||||||
|
msg.content = newMessageContent;
|
||||||
|
FluxDispatcher.dispatch({
|
||||||
|
type: "MESSAGE_UPDATE",
|
||||||
|
message: msg,
|
||||||
|
guildId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async MESSAGE_UPDATE
|
||||||
|
({ guildId, message }) {
|
||||||
|
if(Vencord.Plugins.plugins.GoodPerson.settings?.store.incoming) {
|
||||||
const msg = message;
|
const msg = message;
|
||||||
|
if(msg.content.includes("-# <:husk:1280158956341297225> **GoodPerson made this message good. Reload your client to clear changes**")) return;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let newMessageContent = Vencord.Plugins.plugins.GoodPerson.replaceBadVerbs(Vencord.Plugins.plugins.GoodPerson.replaceBadNouns(msg.content));
|
let newMessageContent = Vencord.Plugins.plugins.GoodPerson.replaceBadVerbs(Vencord.Plugins.plugins.GoodPerson.replaceBadNouns(msg.content));
|
||||||
if (message.content !== newMessageContent) {
|
if (message.content !== newMessageContent) {
|
||||||
|
@ -126,20 +133,6 @@ export default definePlugin({
|
||||||
guildId
|
guildId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
|
||||||
async MESSAGE_UPDATE
|
|
||||||
({ guildId, message }) {
|
|
||||||
const msg = message;
|
|
||||||
// @ts-ignore
|
|
||||||
let newMessageContent = Vencord.Plugins.plugins.GoodPerson.replaceBadVerbs(Vencord.Plugins.plugins.GoodPerson.replaceBadNouns(msg.content));
|
|
||||||
if (message.content !== newMessageContent) {
|
|
||||||
newMessageContent += "\n-# <:husk:1280158956341297225> **GoodPerson made this message good. Reload your client to clear changes**";
|
|
||||||
msg.content = newMessageContent;
|
|
||||||
FluxDispatcher.dispatch({
|
|
||||||
type: "MESSAGE_UPDATE",
|
|
||||||
message: msg,
|
|
||||||
guildId
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue