Skip to content

Commit

Permalink
Fixed sending stickers from current server
Browse files Browse the repository at this point in the history
  • Loading branch information
cafeed28 committed Mar 5, 2023
1 parent d032884 commit fad70d8
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injector } from "replugged";
import { Injector, common } from "replugged";

import { config, ready, userChanged, userInit } from "./misc";

Expand Down Expand Up @@ -42,8 +42,19 @@ export async function start(): Promise<void> {
// Stickers
injector.instead(stickerInfo, shouldAttachSticker, () => true);
injector.instead(stickerSendability, isSendableSticker, () => true);
injector.instead(stickerPreview, addStickerPreview, async ([_, sticker]) => {
if (ready) await spoofSticker(sticker);

injector.instead(stickerPreview, addStickerPreview, async ([channelId, sticker, draftType]) => {
if (ready) {
const spoofed = await spoofSticker(sticker);
if (!spoofed) {
common.fluxDispatcher.dispatch({
type: "ADD_STICKER_PREVIEW",
channelId,
sticker,
draftType,
});
}
}
});

// Stream quality
Expand Down

0 comments on commit fad70d8

Please sign in to comment.