client.wait_for discord py taking global input code example
Example 1: python discord input
@client.command(name="command")
async def _command(ctx):
global times_used
await ctx.send(f"y or n")
def check(msg):
return msg.author == ctx.author and msg.channel == ctx.channel and \
msg.content.lower() in ["y", "n"]
msg = await client.wait_for("message", check=check)
if msg.content.lower() == "y":
await ctx.send("You said yes!")
else:
await ctx.send("You said no!")
times_used = times_used + 1
Example 2: discord py server.channels
bot.get_all_channels()