Browse Source

chore: Update examples and things

pull/10166/head
DA-344 1 month ago
parent
commit
ab497987ac
  1. 2
      discord/ui/view.py
  2. 10
      examples/views/layout.py

2
discord/ui/view.py

@ -700,7 +700,7 @@ class LayoutView(BaseView):
This object must be inherited to create a UI within Discord.
You can find usage examples in the :resource:`repository <examples>`
.. versionadded:: 2.6

10
examples/views/layout.py

@ -28,11 +28,9 @@ class Layout(discord.ui.LayoutView):
await interaction.response.send_message('Hi!', ephemeral=True)
container = discord.ui.Container(
[
discord.ui.TextDisplay(
'Click the above button to receive a **very special** message!',
),
],
discord.ui.TextDisplay(
'Click the above button to receive a **very special** message!',
),
accent_colour=discord.Colour.blurple(),
)
@ -43,7 +41,7 @@ bot = Bot()
@bot.command()
async def layout(ctx: commands.Context):
"""Sends a very special message!"""
await ctx.send(view=Layout()) # sending LayoutView's does not allow for sending any other content
await ctx.send(view=Layout()) # sending LayoutView's does not allow for sending any content, embed(s), stickers, or poll
bot.run('token')

Loading…
Cancel
Save