Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
avoid crash if guild has Apps context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
k2helix committed Sep 9, 2022
1 parent e5930f9 commit 2e589aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/Patcher/General.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ module.exports = class General {
if (menu?.type?.displayName) {
patchMenu(menu.type.displayName);
} else {
const { getGuild } = getModule([ 'getGuild' ], false);
if (getGuild(menu?.props?.guildId).applicationCommandCounts[2]) {
return menu; // avoid infinite loop if there are context menu commands in the guild
}
menu.type = memorizeRender(menu.type, (res) => {
res.props.children.type = memorizeRender(res.props.children.type, (res2) => {
patchMenu(res2?.type?.displayName);
Expand Down

0 comments on commit 2e589aa

Please sign in to comment.