File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ def __init__(
5454 client_id : str ,
5555 client_secret : str ,
5656 bot_id : str ,
57+ owner_id : str | None = None ,
5758 prefix : Prefix_T ,
5859 ** options : Unpack [ClientOptions ],
5960 ) -> None :
@@ -64,6 +65,7 @@ def __init__(
6465 ** options ,
6566 )
6667
68+ self ._owner_id : str | None = owner_id
6769 self ._get_prefix : Prefix_T = prefix
6870 self ._components : dict [str , Component ] = {}
6971 self ._base_converter : _BaseConverter = _BaseConverter (self )
@@ -73,6 +75,10 @@ def bot_id(self) -> str:
7375 assert self ._bot_id
7476 return self ._bot_id
7577
78+ @property
79+ def owner_id (self ) -> str | None :
80+ return self ._owner_id
81+
7682 def _cleanup_component (self , component : Component , / ) -> None :
7783 for command in component .__all_commands__ .values ():
7884 self .remove_command (command .name )
Original file line number Diff line number Diff line change @@ -122,6 +122,9 @@ def args(self) -> list[Any]:
122122 def kwargs (self ) -> dict [str , Any ]:
123123 return self ._kwargs
124124
125+ def is_owner (self ) -> bool :
126+ return self .chatter .id == self .bot .owner_id
127+
125128 def is_valid (self ) -> bool :
126129 return self ._prefix is not None
127130
You can’t perform that action at this time.
0 commit comments