i recently added a parameter to my slashcommand in discord, and since the command refuses to work. i get no response from the bot. the first code block works fine, but the second one doesnt.
<code>import discord
from discord import app_commands
from discord.ext import commands
class AttendanceCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(description='see which rolemembers are in your voicechannel')
async def attendance(self, interaction: discord.Interaction):
await interaction.response.send_message(f"Attendance command received without parameter")
async def setup(bot):
await bot.add_cog(AttendanceCog(bot))
</code>
<code>import discord
from discord import app_commands
from discord.ext import commands
class AttendanceCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(description='see which rolemembers are in your voicechannel')
async def attendance(self, interaction: discord.Interaction):
await interaction.response.send_message(f"Attendance command received without parameter")
async def setup(bot):
await bot.add_cog(AttendanceCog(bot))
</code>
import discord
from discord import app_commands
from discord.ext import commands
class AttendanceCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(description='see which rolemembers are in your voicechannel')
async def attendance(self, interaction: discord.Interaction):
await interaction.response.send_message(f"Attendance command received without parameter")
async def setup(bot):
await bot.add_cog(AttendanceCog(bot))
<code>import discord
from discord import app_commands
from discord.ext import commands
class AttendanceCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(description='see which rolemembers are in your voicechannel')
@app_commands.describe(test='test')
async def attendance(self, interaction: discord.Interaction, test: str):
await interaction.response.send_message(f"Attendance command received with parameter: {test}")
async def setup(bot):
await bot.add_cog(AttendanceCog(bot))
</code>
<code>import discord
from discord import app_commands
from discord.ext import commands
class AttendanceCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(description='see which rolemembers are in your voicechannel')
@app_commands.describe(test='test')
async def attendance(self, interaction: discord.Interaction, test: str):
await interaction.response.send_message(f"Attendance command received with parameter: {test}")
async def setup(bot):
await bot.add_cog(AttendanceCog(bot))
</code>
import discord
from discord import app_commands
from discord.ext import commands
class AttendanceCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(description='see which rolemembers are in your voicechannel')
@app_commands.describe(test='test')
async def attendance(self, interaction: discord.Interaction, test: str):
await interaction.response.send_message(f"Attendance command received with parameter: {test}")
async def setup(bot):
await bot.add_cog(AttendanceCog(bot))
when i type “/attendance something” i expect the bot to say “Attendance command received with parameter: something”
I get error message in discord: The application did not respond
New contributor
SilverSkips is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.