Python
6
Вклад в тег
@bot.command()
async def test(ctx):
await ctx.send(
embed=discord.Embed(title="тебе нравится наш сервер?"),
components=[
Button(style=ButtonStyle.red, label="ДА!", custom_id="yes"),
Button(style=ButtonStyle.green, label="ну такое..", custom_id="no"),
]
)
response = await bot.wait_for("button_click")
if response.channel == ctx.channel:
if response.custom_id == "yes":
await response.respond(content="рады стараться!")
else:
await response.respond(content="в чем проблема?")
def response_check(inter):
return inter.channel == ctx.channel
response = await bot.wait_for("button_click", check=response_check)
response = await bot.wait_for("button_click", check=lambda inter: inter.channel == ctx.channel)
@bot.command()
async def test(ctx):
await ctx.send(
embed=discord.Embed(title="тебе нравится наш сервер?"),
components=[
Button(style=ButtonStyle.red, label="ДА!", custom_id="yes"),
Button(style=ButtonStyle.green, label="ну такое..", custom_id="no"),
]
)
response = await bot.wait_for("button_click", check=lambda inter: inter.channel == ctx.channel)
if response.custom_id == "yes":
await response.respond(content="рады стараться!")
else:
await response.respond(content="в чем проблема?")
@client.command()
async def news(ctx):
guild = ctx.guild
async for member in guild.fetch_members(limit=None):
if member != client.user:
await member.send("Приветики!")
print("Отправил", member)
@client.command()
async def news(ctx):
guild = ctx.guild
async for member in guild.fetch_members(limit=None):
if not member.bot:
await member.send("Приветики!")
print("Отправил", member)