MCPcopy Create free account
hub / github.com/RocketGod-git/shodanbot / QueryModal

Class QueryModal

main.py:294–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292
293
294class QueryModal(discord.ui.Modal):
295 def __init__(self, *args, **kwargs):
296 super().__init__(*args, **kwargs)
297 self.add_item(discord.ui.TextInput(label="Enter your search query", style=discord.TextStyle.short, custom_id="query_input"))
298
299 async def on_submit(self, interaction: discord.Interaction):
300 await interaction.response.defer(ephemeral=True)
301 query = self.children[0].value # Extract the query from the modal
302 view = MaxResultsView(query)
303 message = await interaction.followup.send(content="Choose the maximum number of results:", view=view, ephemeral=False)
304 view.query_message_id = message.id
305
306class MaxResultsView(discord.ui.View):
307 def __init__(self, query):

Callers 1

searchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected