Your command is forgetting to call the command, which is the double parenthesis, ()
Simply can be fixed by adding: client.command()
to the top where it previously says without the parenthesis
It's better to include "None" in your message decorator, as it allows members to know they must pass a message through, otherwise it would not run the command.
I choose to optionally add some more functionality to your command, (only if you wish for use) and the option of sending it to a different channel, but I have tried this and should work. Hope this helps, change it to whatever you need.
@client.command()
async def poll(ctx, *, message=None):
if message == None:
await ctx.send(f'Cannot create a poll with no message!')
return
questions = [
f"Which channel should your poll be sent to?"
]
answers = []
def check(m):
return m.author == ctx.author and m.channel == ctx.channel
for i in questions:
await ctx.send(i)
try:
msg = await client.wait_for('message', timeout=30.0, check=check)
except asyncio.TimeoutError:
await ctx.send("Setup timed out, please be quicker next time!")
return
else:
answers.append(msg.content)
try:
c_id = int(answers[0][2:-1])
except:
await ctx.send(
f"You didn't mention a channel properly, please format like {ctx.channel.mention} next time."
)
return
channel = client.get_channel(c_id)
embed = discord.Embed(title="Poll", description='{message}', colour=discord.Color.black())
message = await channel.send(embed=embed )
await message.add_reaction('??')
await message.add_reaction('??')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…