Skip to content

Commit

Permalink
fix Commands, Badges, RoleColorEverywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated committed Sep 5, 2024
1 parent 61d3c08 commit 8890c8c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/api/Commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import { Logger } from "@utils/Logger";
import { makeCodeblock } from "@utils/text";

import { sendBotMessage } from "./commandHelpers";
Expand Down Expand Up @@ -46,10 +47,10 @@ export let RequiredMessageOption: Option = ReqPlaceholder;
export const _init = function (cmds: Command[]) {
try {
BUILT_IN = cmds;
OptionalMessageOption = cmds.find(c => c.name === "shrug")!.options![0];
RequiredMessageOption = cmds.find(c => c.name === "me")!.options![0];
OptionalMessageOption = cmds.find(c => (c.untranslatedName || c.displayName) === "shrug")!.options![0];
RequiredMessageOption = cmds.find(c => (c.untranslatedName || c.displayName) === "me")!.options![0];
} catch (e) {
console.error("Failed to load CommandsApi");
new Logger("CommandsAPI").error("Failed to load CommandsApi", e, " - cmds is", cmds);
}
return cmds;
} as never;
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/_api/badges/fixBadgeOverflow.css

This file was deleted.

4 changes: 1 addition & 3 deletions src/plugins/_api/badges/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import "./fixBadgeOverflow.css";

import { _getBadges, BadgePosition, BadgeUserArgs, ProfileBadge } from "@api/Badges";
import DonateButton from "@components/DonateButton";
import ErrorBoundary from "@components/ErrorBoundary";
Expand Down Expand Up @@ -79,7 +77,7 @@ export default definePlugin({
replace: "...$1.props,$& $1.image??"
},
{
match: /(?<=text:(\i)\.description,.{0,50})children:/,
match: /(?<=text:(\i)\.description,.{0,200})children:/,
replace: "children:$1.component ? $self.renderBadgeComponent({ ...$1 }) :"
},
// conditionally override their onClick with badge.onClick if it exists
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/roleColorEverywhere/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default definePlugin({
patches: [
// Chat Mentions
{
find: 'location:"UserMention',
find: ".USER_MENTION)",
replacement: [
{
match: /onContextMenu:\i,color:\i,\.\.\.\i(?=,children:)(?<=user:(\i),channel:(\i).{0,500}?)/,
Expand Down

0 comments on commit 8890c8c

Please sign in to comment.