-
-
Notifications
You must be signed in to change notification settings - Fork 478
feat: components v2 & View
improvements
#2707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NeloBlivion
wants to merge
245
commits into
Pycord-Development:master
Choose a base branch
from
NeloBlivion:components-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
245 commits
Select commit
Hold shift + click to select a range
714b2f6
base types and flags
NeloBlivion 468f996
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 905b9ff
textdisplayComponent
NeloBlivion 49080e7
more
NeloBlivion e3e7aba
Section, TextDisplay
NeloBlivion e961db5
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 947890d
remaining classes
NeloBlivion 6e7dde9
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d18a9c4
basic view support start
NeloBlivion 5ab45fd
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] fb8d13d
flag clarification
NeloBlivion 65dc63d
complete models
NeloBlivion f86f707
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1cced5a
Merge branch 'master' into components-v2
NeloBlivion 3e03e84
fix
NeloBlivion 0f8c20a
fix2
NeloBlivion bf60ffc
update loading_state
NeloBlivion 5080ff7
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ecd5109
Merge branch 'master' into components-v2
Lulalaby 813812e
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e2e2a71
Merge branch 'master' into components-v2
Lulalaby cc1bb07
Merge branch 'master' into components-v2
NeloBlivion 066d8ca
finish section fr fr
NeloBlivion a054ecf
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8c568ad
small docs
NeloBlivion 6b440f4
section import
NeloBlivion bce9af3
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 61dd2c9
construct id
NeloBlivion 00eeaa2
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9de5041
id...?
NeloBlivion 3bd4b5b
bound
NeloBlivion f890a01
accessory fix
NeloBlivion 6bf9cc0
once more
NeloBlivion 30e2902
flags and with_components
NeloBlivion 9009ca1
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 25deb22
TextDisplay
NeloBlivion bbe4f1d
fix
NeloBlivion 48fc1c6
fix type
NeloBlivion f643b5e
imports :(
NeloBlivion 605beb5
v2 view parsing
NeloBlivion 3bb966c
patch underlying
NeloBlivion cccca77
set_text
NeloBlivion 429f658
fix
NeloBlivion 75e0b3d
underlying raghhhh
NeloBlivion 4198e00
bypass tuple
NeloBlivion 40b1a79
attempt v1-v2 compatability
NeloBlivion 1018de2
i hate groupby
NeloBlivion 5256726
Thumbnail
NeloBlivion aebf510
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a6516cc
minor fixes
NeloBlivion 661a2a4
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4bf9bfe
state?
NeloBlivion 31af377
rough state support on received components
NeloBlivion 403b34f
thumbnail too
NeloBlivion 835138a
fix states
NeloBlivion 5e45569
adjust with_components defaults
NeloBlivion 4fd6fe7
MediaGallery
NeloBlivion 11f30c5
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a883573
gallery fixes
NeloBlivion 0faeab8
append
NeloBlivion 554b4b8
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6f133e0
notuple
NeloBlivion 1c30853
Update discord/ui/section.py
NeloBlivion 40dbb8c
Update discord/ui/section.py
NeloBlivion f9096a9
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0be3e31
file
NeloBlivion 044a052
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8fd981d
Update discord/ui/view.py
Lulalaby 032fb00
Separator
NeloBlivion ea29f72
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 88c65fb
Merge branch 'master' into components-v2
Lulalaby a9671ae
container
NeloBlivion 6c9f3ee
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 85c15d4
nobreak
NeloBlivion cb2ec4c
docs
NeloBlivion 09627f1
int with_components
NeloBlivion 86246a2
container
NeloBlivion 11ac9da
require accessory
NeloBlivion 4bd1647
int
NeloBlivion 04d748a
sep
NeloBlivion 69badd8
fix separator
NeloBlivion f6938d7
fix file
NeloBlivion 7e94257
handle actionrow in container
NeloBlivion 7daff7d
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b963d51
neater fix
NeloBlivion b5cca60
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e64f0b4
maybe?
NeloBlivion 222b504
actual file fix
NeloBlivion 55aa2af
handle ui.File from_component case
NeloBlivion 87ac602
decorator support?
NeloBlivion 5d76987
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4acac2b
setter
NeloBlivion b07825b
swap
NeloBlivion 5608013
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] dd2c16f
silly code thank u plun
NeloBlivion 1d56b9b
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e0b53ae
decorator in section
NeloBlivion 8ea9d3f
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d1a3711
imports
NeloBlivion 505d431
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 64a8223
extend weight
NeloBlivion 45271d8
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a2490f6
subitem
NeloBlivion 5d6f529
meh
NeloBlivion abfa1e6
full ID support and general cleanup
NeloBlivion 5744198
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2ec1256
doc
NeloBlivion 02e65c1
Merge branch 'master' into components-v2
NeloBlivion 3c9278d
Merge branch 'master' into components-v2
NeloBlivion 2ef567f
adjust container item strategy
NeloBlivion 0c97a21
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 16f4c35
import get
NeloBlivion 80499bb
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6857299
extend to section
NeloBlivion 15248c5
implement copy_text
NeloBlivion e7c2399
get
NeloBlivion b63e224
minor fix
NeloBlivion f21a4b8
get_item works on nested items
NeloBlivion 97962f0
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 567858f
recur in container
NeloBlivion 492f70b
id
NeloBlivion 338f8cf
media view setter
NeloBlivion c7c911e
dispatch
NeloBlivion 6dd7a2c
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9ba1f84
maybe fixes
NeloBlivion 09f4e27
Update discord/ui/section.py
NeloBlivion 5ab9dcd
Update discord/ui/container.py
NeloBlivion c7740b3
Update discord/ui/section.py
NeloBlivion e87a2d1
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 96c5792
adjust get_item behavior
NeloBlivion 1314b9e
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 28bfe5d
typing adjustment
NeloBlivion 397acf7
another adjustment
NeloBlivion 64df149
doc clarification
NeloBlivion 94844e2
fix awkward decorator behavior
NeloBlivion 05c8e86
self
NeloBlivion b7fe616
add Section.set_thumbnail shortcut
NeloBlivion d39b31c
add kwargs
NeloBlivion 794acf8
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7e2f8ef
basic paginator support
NeloBlivion 9acbcc0
Update discord/ui/item.py
NeloBlivion a09b8ce
rough example
NeloBlivion 4dee8de
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0d1e695
Apply suggestions from code review
NeloBlivion 19e2f9f
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d3b78aa
Apply suggestions from code review
plun1331 8befa8b
adjust copy_text and fix example
NeloBlivion a1b7ed4
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6cfa8cc
disable_all_items and enable_all_items
NeloBlivion 9c591c6
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b624930
VAR
NeloBlivion 7778210
remove_item qol
NeloBlivion 0f3e7cd
brackets
NeloBlivion 29c1d40
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 98a9bc5
Update discord/ui/view.py
NeloBlivion 45fe45e
Update discord/components.py
NeloBlivion 7c2d96d
textdisplay limits
NeloBlivion bd17372
Merge branch 'master' into components-v2
NeloBlivion 1c54b08
Update discord/components.py
NeloBlivion 2adca36
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2ee8c01
Update discord/components.py
NeloBlivion 6296f72
chaining support
NeloBlivion 381a3c8
raise limits
NeloBlivion 94a313d
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 93f9b5f
adjust weights
NeloBlivion 6e9248a
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a2d9140
Update discord/ui/section.py
plun1331 ebef722
additional weight logic
NeloBlivion 08faba3
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a7e8f47
fixes
NeloBlivion f3f18cf
Merge branch 'master' into components-v2
NeloBlivion a9d095d
view dispatchable
NeloBlivion a3d44b6
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] cbbb623
only store dispatchable views
NeloBlivion 74bf37c
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f29046e
fix
NeloBlivion 3e03fa2
Merge branch 'master' into components-v2
NeloBlivion 3b3384a
fixes
NeloBlivion f17a9e1
again
NeloBlivion 381edff
fix persistance
NeloBlivion 4c3d816
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 097a60f
Interaction and view error convenience
NeloBlivion 3fead8d
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 08cfdaa
fix
NeloBlivion af2c580
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7244eb2
slots
NeloBlivion 31a9389
big refactor for view refreshing
NeloBlivion 9be68ce
Merge branch 'master' into components-v2
NeloBlivion 93b4b6d
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 97975e5
, Iterator
NeloBlivion 68502d1
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 23758f7
again...
NeloBlivion 36d625b
??????
NeloBlivion 3daa1d5
ActionRowComponent
NeloBlivion d202a84
yeild
NeloBlivion 399896b
component.components
NeloBlivion 440fabe
else
NeloBlivion 84c6df8
.refresh
NeloBlivion 518a3f2
fix
NeloBlivion 732722b
from_dict
NeloBlivion 7d11dda
state
NeloBlivion 6e4b17e
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0cf1ebb
emoji
NeloBlivion 874f93e
no state
NeloBlivion 2abab06
restore old get_item
NeloBlivion b3a3180
separator id
NeloBlivion 6b34a29
eh
NeloBlivion 498859e
fix yield
NeloBlivion a653917
forumchannel support
NeloBlivion 101aec7
typing
NeloBlivion ecda5c4
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ade5c63
disable
NeloBlivion 2eb62e9
Update discord/ui/section.py
NeloBlivion 248144a
Merge branch 'master' into components-v2
NeloBlivion 06dad55
Merge branch 'master' into components-v2
NeloBlivion 00ee61d
Merge branch 'Pycord-Development:master' into components-v2
NeloBlivion 98f106f
Merge branch 'master' into components-v2
NeloBlivion 61fad2a
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] fffc848
add new file and unfurledmedia attributes
NeloBlivion 8ef3c14
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9b1aa43
Merge branch 'master' into components-v2
NeloBlivion d92fd92
raise on content/embeds
NeloBlivion d26dba5
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 72234ff
updated docs, streamlined unfurledmedia
NeloBlivion b7d5040
fix with_components
NeloBlivion 969600d
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0c8c719
typing.Self
NeloBlivion c29b967
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ca3f1ce
raise again
NeloBlivion 5490f90
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2fdf147
Apply suggestions from code review
NeloBlivion 310ecf9
Apply suggestions from code review
NeloBlivion 80ff839
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a54223d
Update examples/views/new_components.py
NeloBlivion 3e5fec8
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2930396
typ
NeloBlivion bc88140
item docstring
NeloBlivion 37da37a
i hate this
NeloBlivion c66b668
add repr
NeloBlivion 32f149c
custom_id
NeloBlivion 66bbf2a
Update section.py
NeloBlivion f6de681
keyerror
NeloBlivion b470a36
add warning for Button.row
NeloBlivion b0d4ced
Merge branch 'master' into components-v2
NeloBlivion bcf7aa1
InputText.id
NeloBlivion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,9 +68,11 @@ | |
if TYPE_CHECKING: | ||
from .abc import GuildChannel, PrivateChannel, Snowflake, SnowflakeTime | ||
from .channel import DMChannel | ||
from .interaction import Interaction | ||
from .member import Member | ||
from .message import Message | ||
from .poll import Poll | ||
from .ui.item import Item | ||
from .voice_client import VoiceProtocol | ||
|
||
__all__ = ("Client",) | ||
|
@@ -541,6 +543,38 @@ async def on_error(self, event_method: str, *args: Any, **kwargs: Any) -> None: | |
print(f"Ignoring exception in {event_method}", file=sys.stderr) | ||
traceback.print_exc() | ||
|
||
async def on_view_error( | ||
self, error: Exception, item: Item, interaction: Interaction | ||
) -> None: | ||
"""|coro| | ||
|
||
The default view error handler provided by the client. | ||
|
||
This only fires for a view if you did not define its :func:`~discord.ui.View.on_error`. | ||
""" | ||
|
||
print( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should consider using something else than |
||
f"Ignoring exception in view {interaction.view} for item {item}:", | ||
file=sys.stderr, | ||
) | ||
traceback.print_exception( | ||
error.__class__, error, error.__traceback__, file=sys.stderr | ||
) | ||
|
||
async def on_modal_error(self, error: Exception, interaction: Interaction) -> None: | ||
"""|coro| | ||
|
||
The default modal error handler provided by the client. | ||
The default implementation prints the traceback to stderr. | ||
|
||
This only fires for a modal if you did not define its :func:`~discord.ui.Modal.on_error`. | ||
""" | ||
|
||
print(f"Ignoring exception in modal {interaction.modal}:", file=sys.stderr) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idem |
||
traceback.print_exception( | ||
error.__class__, error, error.__traceback__, file=sys.stderr | ||
) | ||
|
||
# hooks | ||
|
||
async def _call_before_identify_hook( | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.