Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slash command ephemeral message fix #614

Merged
merged 6 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export const WEBLATE_URL = "https://i18n.replugged.dev";
export const WEBSITE_URL = "https://replugged.dev";
export const BETA_WEBSITE_URL = "https://beta.replugged.dev";
export const DISCORD_BLURPLE = "#7289da";
export const REPLUGGED_CLYDE_ID = "826980768571716968"; // "REPLUGGED" in ASCII codes
3 changes: 2 additions & 1 deletion src/renderer/apis/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type { Store } from "../modules/common/flux";
import { Logger } from "../modules/logger";
import { filters, getByStoreName, waitForModule } from "../modules/webpack";
import icon from "../assets/logo.png";
import { REPLUGGED_CLYDE_ID } from "../../constants";
const logger = Logger.api("Commands");

let RepluggedUser: User | undefined;
Expand All @@ -29,7 +30,7 @@ interface CommandsAndSection {
void waitForModule<typeof User>(filters.bySource("hasHadPremium(){")).then((User) => {
RepluggedUser = new User({
avatar: "replugged",
id: "replugged",
id: REPLUGGED_CLYDE_ID,
bot: true,
username: "Replugged",
system: true,
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/coremods/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {

import { commandAndSections, defaultSection } from "../../apis/commands";
import { loadCommands, unloadCommands } from "./commands";
import { REPLUGGED_CLYDE_ID } from "../../../constants";

const logger = Logger.api("Commands");
const injector = new Injector();
Expand Down Expand Up @@ -293,7 +294,7 @@ async function injectProfileFetch(): Promise<void> {
);
const fetchProfileKey = getFunctionKeyBySource(mod, "fetchProfile")!;
injector.instead(mod, fetchProfileKey, (args, res) => {
if (args[0] === "replugged") {
if (args[0] === REPLUGGED_CLYDE_ID) {
return;
}
return res(...args);
Expand Down