diff --git a/cogs/melonx/__init__.py b/cogs/melonx/__init__.py index 44fe054..71abf08 100644 --- a/cogs/melonx/__init__.py +++ b/cogs/melonx/__init__.py @@ -11,6 +11,7 @@ from .gamecrash import crash_command from .requirements import requirements_command from .error import error_command from .ios26 import ios26_command +from .upgrade import upgrade_command @app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True) @@ -74,6 +75,10 @@ class Melonx(commands.GroupCog, name="melonx"): async def melonx_group_26(self, context: Context): await self._invoke_hybrid(context, "26") + @melonx_group.command(name="upgrade") + async def melonx_group_upgrade(self, context: Context): + await self._invoke_hybrid(context, "upgrade") + async def _invoke_hybrid(self, context: Context, name: str): command = self.bot.get_command(name) if command is not None: @@ -148,6 +153,13 @@ class Melonx(commands.GroupCog, name="melonx"): async def ios26(self, context): return await ios26_command()(self, context) + @commands.check(_require_group_prefix) + @commands.hybrid_command( + name="upgrade", description="How can I upgrade my firmware and keys in MeloNX?" + ) + async def upgrade(self, context): + return await upgrade_command()(self, context) + async def setup(bot) -> None: cog = Melonx(bot) @@ -160,4 +172,5 @@ async def setup(bot) -> None: bot.logger.info("Loaded extension 'melonx.requirements'") bot.logger.info("Loaded extension 'melonx.error'") bot.logger.info("Loaded extension 'melonx.26'") + bot.logger.info("Loaded extension 'melonx.upgrade'") bot.logger.info("Loaded extension 'melonx.legal'") diff --git a/cogs/melonx/melonx.py b/cogs/melonx/melonx.py index 6dbc759..6f670ff 100644 --- a/cogs/melonx/melonx.py +++ b/cogs/melonx/melonx.py @@ -1,7 +1,5 @@ import discord -from discord import app_commands from discord.ext import commands -from discord.ext.commands import Context class MelonxSelect(discord.ui.Select): @@ -38,6 +36,11 @@ class MelonxSelect(discord.ui.Select): value="26", description="How can I run MeloNX on iOS 26?", ), + discord.SelectOption( + label="Upgrade", + value="upgrade", + description="How can I upgrade my firmware and keys in MeloNX?", + ), discord.SelectOption( label="Legal", value="legal", diff --git a/cogs/melonx/upgrade.py b/cogs/melonx/upgrade.py new file mode 100644 index 0000000..afe294d --- /dev/null +++ b/cogs/melonx/upgrade.py @@ -0,0 +1,60 @@ +import discord +from discord.ext import commands + + +def upgrade_command(): + @commands.hybrid_command( + name="upgrade", description="How can I upgrade my firmware and keys in MeloNX?" + ) + async def upgrade(self, context): + embed = discord.Embed( + color=0x963155, + description=( + "# How can I upgrade my firmware and keys in MeloNX?\n\n---\n\n" + + "First, dump **BOTH** the firmware and keys from a **MODDED SWITCH**.\n\n" + + "## Keys:\n" + + "1. Go to the root folder of MeloNX in the files app.\n" + + '2. Open the "system" folder.\n' + + '3. Delete the "prod.keys" and "title.keys".\n\n' + + "## Firmware:\n" + + "1. Go to the root folder of MeloNX in the files app.\n" + + '2. Open the "bis" folder.\n' + + '3. Open the "system" folder.\n' + + '4. Delete the "Contents" folder.\n\n' + + "## Lastly:\n" + + "1. Go to MeloNX's advanced tab in settings.\n" + + '2. Select the "Show Setup Screen" option.\n\n' + + "You will now be able to import your new keys and firmware." + ), + ) + embed.set_author( + name="MeloNX", icon_url="https://yes.nighty.works/raw/TLGaVa.png" + ) + embed.set_footer(text="Last Edited by Meshal :D") + embed.timestamp = discord.utils.utcnow() + + view = discord.ui.View() + view.add_item( + discord.ui.Button( + label="Edit Command", + style=discord.ButtonStyle.secondary, + url="https://github.com/neoarz/Syntrel/blob/main/cogs/melonx/upgrade.py", + emoji="<:githubicon:1417717356846776340>", + ) + ) + view.add_item( + discord.ui.Button( + label="MeloNX Discord", + style=discord.ButtonStyle.primary, + url="https://discord.gg/EMXB2XYQgA", + emoji="<:Discord:1428762057758474280>", + ) + ) + + if context.interaction: + await context.interaction.response.send_message(embed=embed, view=view) + else: + await context.send(embed=embed, view=view) + + return upgrade +