mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-28 05:32:51 +01:00
ClientbotBaseProtocol: disallow part() from the main pseudoclient by default
This commit is contained in:
parent
0836845ff9
commit
e25a5df4db
@ -170,6 +170,8 @@ class ClientbotBaseProtocol(PyLinkNetworkCoreWithUtils):
|
||||
|
||||
def part(self, source, channel, reason=''):
|
||||
"""STUB: Parts a user from a channel."""
|
||||
if self.pseudoclient and source == self.pseudoclient.uid:
|
||||
raise NotImplementedError("Explicitly leaving channels is not supported here.")
|
||||
self._channels[channel].remove_user(source)
|
||||
self.users[source].channels.discard(channel)
|
||||
self.call_hooks([source, 'CLIENTBOT_PART', {'channel': channel, 'text': reason}])
|
||||
|
Loading…
Reference in New Issue
Block a user