Skip to content

Commit 4b4148b

Browse files
committed
BUGFIX:
- Error in /server config if stop question was sent.
1 parent f2329b2 commit 4b4148b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/scheduler/commands.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,10 @@ async def on_submit(derived, interaction: discord.Interaction):
11961196
@utils.app_has_role('DCS Admin')
11971197
async def config(self, interaction: discord.Interaction,
11981198
server: app_commands.Transform[Server, utils.ServerTransformer]):
1199+
ephemeral = utils.get_ephemeral(interaction)
1200+
# noinspection PyUnresolvedReferences
1201+
await interaction.response.defer(ephemeral=ephemeral)
1202+
11991203
if server.status in [Status.RUNNING, Status.PAUSED]:
12001204
if await utils.yn_question(interaction, question='Server has to be stopped to change its configuration.\n'
12011205
'Do you want to stop it?'):
@@ -1204,9 +1208,6 @@ async def config(self, interaction: discord.Interaction,
12041208
await interaction.followup.send('Aborted.')
12051209
return
12061210

1207-
ephemeral = utils.get_ephemeral(interaction)
1208-
# noinspection PyUnresolvedReferences
1209-
await interaction.response.defer(ephemeral=ephemeral)
12101211
view = ConfigView(self.bot, server)
12111212
embed = discord.Embed(title=f'Please edit the configuration of server\n"{server.display_name}"')
12121213
msg = await interaction.followup.send(embed=embed, view=view, ephemeral=ephemeral)

0 commit comments

Comments
 (0)