feat(melonx): upgrade.py new command

This commit is contained in:
neoarz
2025-11-03 15:47:23 -05:00
parent 44c3c454aa
commit 783333cc53
3 changed files with 78 additions and 2 deletions

View File

@@ -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'")

View File

@@ -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",

60
cogs/melonx/upgrade.py Normal file
View File

@@ -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