mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 11:40:12 +01:00
feat(idevice): add developermode command
This commit is contained in:
@@ -78,6 +78,7 @@ class Help(commands.Cog, name="help"):
|
|||||||
"idevice": "idevice",
|
"idevice": "idevice",
|
||||||
"noapps": "idevice",
|
"noapps": "idevice",
|
||||||
"errorcodes": "idevice",
|
"errorcodes": "idevice",
|
||||||
|
"developermode": "idevice",
|
||||||
|
|
||||||
# Owner Commands
|
# Owner Commands
|
||||||
"sync": "owner",
|
"sync": "owner",
|
||||||
|
|||||||
46
cogs/idevice/developermode.py
Normal file
46
cogs/idevice/developermode.py
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import discord
|
||||||
|
from discord import app_commands
|
||||||
|
from discord.ext import commands
|
||||||
|
from discord.ext.commands import Context
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
class Developermode(commands.Cog, name="developermode"):
|
||||||
|
def __init__(self, bot) -> None:
|
||||||
|
self.bot = bot
|
||||||
|
|
||||||
|
@commands.hybrid_command(
|
||||||
|
name="developermode", description="How to turn on developer mode"
|
||||||
|
)
|
||||||
|
async def developermode(self, context: Context) -> None:
|
||||||
|
embed = discord.Embed(
|
||||||
|
color=0xfa8c4a,
|
||||||
|
description=(
|
||||||
|
'# How to Enable Developer Mode\n\n---\n\n' +
|
||||||
|
'1. Open the "Settings" app\n' +
|
||||||
|
'2. Navigate to "Privacy & Security"\n' +
|
||||||
|
'3. Scroll all the way down to find "Developer Mode"\n\n' +
|
||||||
|
'If you don\'t see the Developer Mode option, you need to install a developer app first.\n\n' +
|
||||||
|
'You can use [SideStore](https://sidestore.io/) for this purpose - follow their installation guide to get started.'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
embed.set_author(name="idevice", icon_url="https://yes.nighty.works/raw/snLMuO.png")
|
||||||
|
embed.set_footer(text=f'Last Edited by neoarz')
|
||||||
|
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/idevice/developermode.py",
|
||||||
|
emoji="<:githubicon:1417717356846776340>"
|
||||||
|
))
|
||||||
|
|
||||||
|
if context.interaction:
|
||||||
|
await context.interaction.response.send_message(embed=embed, view=view)
|
||||||
|
else:
|
||||||
|
await context.send(embed=embed, view=view)
|
||||||
|
|
||||||
|
|
||||||
|
async def setup(bot) -> None:
|
||||||
|
await bot.add_cog(Developermode(bot))
|
||||||
@@ -154,6 +154,11 @@ class ideviceSelect(discord.ui.Select):
|
|||||||
value="errorcodes",
|
value="errorcodes",
|
||||||
description="Browse idevice error codes",
|
description="Browse idevice error codes",
|
||||||
),
|
),
|
||||||
|
discord.SelectOption(
|
||||||
|
label="Developer Mode",
|
||||||
|
value="developermode",
|
||||||
|
description="How to turn on developer mode",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
super().__init__(placeholder="Choose an idevice command...", options=options)
|
super().__init__(placeholder="Choose an idevice command...", options=options)
|
||||||
|
|
||||||
@@ -266,5 +271,6 @@ class idevice(commands.Cog, name="idevice"):
|
|||||||
await context.send(embed=embed, view=view)
|
await context.send(embed=embed, view=view)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot) -> None:
|
async def setup(bot) -> None:
|
||||||
await bot.add_cog(idevice(bot))
|
await bot.add_cog(idevice(bot))
|
||||||
Reference in New Issue
Block a user