File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,17 @@ def bot_id(self) -> str:
7777
7878 @property
7979 def owner_id (self ) -> str | None :
80+ """Property returning the ID of the user who owns this bot.
81+
82+ This can be set via the keyword argument `owner_id="..."` in the constructor of this class.
83+
84+ Returns
85+ -------
86+ str
87+ The owner ID that has been set.
88+ None
89+ No owner ID has been set.
90+ """
8091 return self ._owner_id
8192
8293 def _cleanup_component (self , component : Component , / ) -> None :
Original file line number Diff line number Diff line change @@ -123,6 +123,17 @@ def kwargs(self) -> dict[str, Any]:
123123 return self ._kwargs
124124
125125 def is_owner (self ) -> bool :
126+ """Method which returns whether the chatter associated with this context is the owner of the bot.
127+
128+ .. warning::
129+
130+ You must have set the :attr:`~twitchio.Bot.owner_id` first, otherwise this method will always return `False`.
131+
132+ Returns
133+ -------
134+ bool
135+ Whether the chatter that this context is associated with is the owner of this bot.
136+ """
126137 return self .chatter .id == self .bot .owner_id
127138
128139 def is_valid (self ) -> bool :
You can’t perform that action at this time.
0 commit comments