Skip to content

Views

Views should be typehinted as View[MyClient] or View[Client] (when the client is unknown).

Items

(This includes all items, such as buttons, select menus, etc. Replace Item with the class where applicable)

Items are the basic building blocks of a view. They should always be typehinted as Item[MyView] or Item[View] (when the view is unknown).

Example

from nextcord.ui import Item, View

class MyItem(Item):
    ...


class MyView(View):
    def __init__(self, item: MyItem[MyView]):
        super().__init__()
        self.add_item(MyItem("My Item"))