mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 03:40:11 +01:00
fix(mountddi): fix so that it doesnt timeout
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from discord.ext.commands import Context
|
from discord.ext.commands import Context
|
||||||
import time
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@@ -11,27 +9,33 @@ class Mountddi(commands.Cog, name="mountddi"):
|
|||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.hybrid_command(
|
@commands.hybrid_command(
|
||||||
name="mountddi", description="How to manually mount DDI"
|
name="mountddi",
|
||||||
|
description="How to manually mount DDI"
|
||||||
)
|
)
|
||||||
async def mountddi(self, context: Context) -> None:
|
async def mountddi(self, ctx: Context) -> None:
|
||||||
|
await ctx.defer()
|
||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
color=0xfa8c4a,
|
color=0xfa8c4a,
|
||||||
description=(
|
description=(
|
||||||
'# How to Manually Mount DDI\n\n---\n\n' +
|
'# How to Manually Mount DDI\n\n---\n\n'
|
||||||
'1. **Download the DDI.zip file attached above:**\n' +
|
'1. **Download the DDI.zip file attached above:**\n'
|
||||||
' - Save it to your device and extract the contents\n\n' +
|
' - Save it to your device and extract the contents\n\n'
|
||||||
'2. **Replace the DDI folder in StikDebug:**\n' +
|
'2. **Replace the DDI folder in StikDebug:**\n'
|
||||||
' - Navigate to the StikDebug default directory on your iPhone/iPad\n' +
|
' - Navigate to the StikDebug default directory on your iPhone/iPad\n'
|
||||||
' - Delete the existing DDI folder completely\n' +
|
' - Delete the existing DDI folder completely\n'
|
||||||
' - Replace it with the DDI folder from the downloaded zip\n' +
|
' - Replace it with the DDI folder from the downloaded zip\n'
|
||||||
' - Make sure it\'s in the StikDebug default directory\n\n' +
|
' - Make sure it\'s in the StikDebug default directory\n\n'
|
||||||
'3. **Restart and retry:**\n' +
|
'3. **Restart and retry:**\n'
|
||||||
' - Completely restart StikDebug\n' +
|
' - Completely restart StikDebug\n'
|
||||||
' - See if you get the same error again\n\n'
|
' - See if you get the same error again\n\n'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
embed.set_author(name="idevice", icon_url="https://yes.nighty.works/raw/snLMuO.png")
|
embed.set_author(
|
||||||
embed.set_footer(text=f'Last Edited by neoarz')
|
name="idevice",
|
||||||
|
icon_url="https://yes.nighty.works/raw/snLMuO.png"
|
||||||
|
)
|
||||||
|
embed.set_footer(text="Last Edited by neoarz")
|
||||||
embed.timestamp = discord.utils.utcnow()
|
embed.timestamp = discord.utils.utcnow()
|
||||||
|
|
||||||
view = discord.ui.View()
|
view = discord.ui.View()
|
||||||
@@ -42,26 +46,14 @@ class Mountddi(commands.Cog, name="mountddi"):
|
|||||||
emoji="<:githubicon:1417717356846776340>"
|
emoji="<:githubicon:1417717356846776340>"
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
ddi_file_path = os.path.join(os.path.dirname(__file__), 'files/DDI.zip')
|
ddi_file_path = os.path.join(os.path.dirname(__file__), 'files/DDI.zip')
|
||||||
|
file = discord.File(ddi_file_path, filename='DDI.zip') if os.path.exists(ddi_file_path) else None
|
||||||
try:
|
|
||||||
if context.interaction:
|
if file:
|
||||||
if os.path.exists(ddi_file_path):
|
await ctx.send(embed=embed, view=view, file=file)
|
||||||
file = discord.File(ddi_file_path, filename='DDI.zip')
|
else:
|
||||||
await context.interaction.response.send_message(embed=embed, view=view, file=file)
|
await ctx.send(embed=embed, view=view)
|
||||||
else:
|
|
||||||
await context.interaction.response.send_message(embed=embed, view=view)
|
|
||||||
else:
|
|
||||||
if os.path.exists(ddi_file_path):
|
|
||||||
file = discord.File(ddi_file_path, filename='DDI.zip')
|
|
||||||
await context.send(embed=embed, view=view, file=file)
|
|
||||||
else:
|
|
||||||
await context.send(embed=embed, view=view)
|
|
||||||
except discord.NotFound:
|
|
||||||
if context.interaction:
|
|
||||||
await context.interaction.followup.send(embed=embed, view=view)
|
|
||||||
else:
|
|
||||||
await context.send(embed=embed, view=view)
|
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot) -> None:
|
async def setup(bot) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user