Commit Graph

107 Commits

Author SHA1 Message Date
Rapptz
ef1cb6a089 Prevent empty dictionaries from being added to the ViewStore
Fix #10405
2026-02-23 02:31:55 -05:00
Michael
38d5d8e47a Use walk_children within remove_view 2026-02-22 16:47:15 -05:00
Steve C
dae46f7d0f Add generics to Interaction params 2026-02-22 15:59:46 -05:00
Rapptz
3ab09be13c Invert View.is_finished condition when there is no associated Future 2026-01-28 16:58:55 -05:00
Michael
bcea13e993 Allow ui.View initialization without a running event loop 2026-01-13 18:08:53 -05:00
Rapptz
0052878983 Guard against Item.view being None when dispatching 2025-12-21 12:18:05 -05:00
Soheab
9580898c97 Detach view from item when removed 2025-11-12 20:02:19 -05:00
DA344
e2cf721e9c Fix container items having out of date internal state 2025-11-07 18:53:04 -05:00
Soheab_
944ffe93c7 Handle resolved data for modal components and types 2025-09-28 16:06:17 -04:00
Rapptz
89d5cbd78a Move v2 item check from BaseView to View 2025-08-31 14:18:50 -04:00
lmaotrigine
50b0d219b5 Add missing versionadded to some BaseView items 2025-08-24 13:22:35 -04:00
Rapptz
9bda89b0d6 Update total count tracking to always consider the wrapper object 2025-08-21 22:20:12 -04:00
DA344
0309aac335 Add a swap method for dynamic item's dispatching 2025-08-20 18:52:31 -04:00
Rapptz
44a44e938f Reformat entire project with ruff instead of black 2025-08-18 20:16:10 -04:00
Rapptz
3ef6272e07 Fix error with View.from_message when having multiple items 2025-08-18 19:04:19 -04:00
Rapptz
d58c055c5b Remove unused import 2025-08-18 15:07:44 -04:00
Rapptz
5d49f11709 Remove View.from_dict typing 2025-08-18 15:00:51 -04:00
Rapptz
fc12a41cdf Run black 2025-08-18 14:49:32 -04:00
Rapptz
064cb7af71 Add View.total_children_count 2025-08-18 14:42:55 -04:00
Rapptz
f08c042217 Add content_length method to LayoutView and container items 2025-08-18 14:33:15 -04:00
Rapptz
9ef5b054e5 Refactor total children count to an overrideable method 2025-08-18 04:49:20 -04:00
Rapptz
2a69ac4ca8 Document difference between View and LayoutView 2025-08-18 04:34:24 -04:00
Rapptz
38c6407ffd Maintain a reference to View dispatched tasks 2025-08-14 00:47:55 -04:00
Rapptz
3fb627d078 Add support for label components and select in modals 2025-08-14 00:47:55 -04:00
Rapptz
9fb74fd7a1 Remove unnecessary TypeGuard 2025-08-13 21:27:38 -04:00
DA344
50caa3c82c Add support for components V2
Co-authored-by: Michael H <michael@michaelhall.tech>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: owocado <24418520+owocado@users.noreply.github.com>
Co-authored-by: Jay3332 <40323796+jay3332@users.noreply.github.com>
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
2025-08-13 20:37:23 -04:00
Leonardo
7f16a06479 Copy Select options when creating View class 2025-06-20 14:24:06 -04:00
Rapptz
8953938a53 Update Pyright to v1.1.394 2025-02-18 03:29:09 -05:00
DA344
6ab747f9e5 Add support for sending views in stateless webhooks 2025-02-17 18:37:20 -05:00
Soheab
2248fc1946 Fix various code around Message.interaction(_metadata) 2024-05-06 18:17:37 -04:00
ナニカ
dc6d33c303 copy over original row position for dynamic items 2024-04-18 03:33:43 -04:00
Rapptz
76666fbcf4 Properly check for maximum number of children 2024-02-17 01:17:31 -05:00
Rapptz
078b500657 Fix dynamic item views having a timeout causing it to evict 2023-12-30 05:00:12 -05:00
Soheab_
698363e76b Refactor from_components for Select classes
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
2023-09-30 21:21:29 -04:00
z03h
e67d00502d Fix View.from_message not creating other Selects 2023-09-12 13:03:29 -04:00
Rapptz
94655cd804 Skip adding views to the synced message store if fully dynamic 2023-09-03 02:52:05 -04:00
Rapptz
f793af0456 Add item parameter to DynamicItem.from_custom_id 2023-09-03 02:52:05 -04:00
Rapptz
7c3868ef3b Add Client.remove_dynamic_items 2023-09-03 02:52:05 -04:00
Rapptz
a852f90358 Add support for dynamic items that parse custom_id for state 2023-09-03 02:52:05 -04:00
Takagi Tasuku
f7e9795495 Call super for __init_subclass__ in View
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
2023-02-12 02:08:39 -05:00
Rapptz
6cb9a84898 Fix views not being removed from message store backing
This uses the original interaction ID if available for cache eviction
2023-01-25 02:37:30 -05:00
Trevor
5009c83bc9 Implement New Select Types
Co-authored-by: Soheab_ <33902984+Soheab@users.noreply.github.com>
Co-authored-by: rdrescher909 <51489753+rdrescher909@users.noreply.github.com>
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
2022-10-27 10:03:45 -04:00
ster
95b6bd8782 Add coro tag to docstrings that were missing it 2022-10-02 17:52:18 -04:00
Ionite
6981eb69c4 Normalize type formatting in TypeError
Normalize most mixed usages of `__class__`, `__class__!r`, 
`__class__.__name__!r` to the standard form of 
`__class__.__name__`
2022-09-12 15:25:55 -04:00
Bryan Forbes
b12b4b18fd Mark public callbacks as positional-only 2022-08-22 15:21:19 -04:00
Rapptz
6327402730 Update View timeout only if interaction_check passes 2022-08-18 18:55:50 -04:00
Mikey
9c38cf3aef Fix ui.Select.values in modals 2022-08-14 15:25:43 -04:00
Rapptz
efdda635fb Fix View.from_message not respecting ActionRow row order 2022-07-23 15:24:26 -04:00
mniip
1be36c9c3e Change View, Modal, and AudioPlayer to use logger instead of stderr 2022-06-22 02:10:02 -04:00
Lilly Rose Berner
7267d18d9e Improve component typing 2022-05-16 15:30:03 -04:00