bitbot-3.11-fork/modules/accept_invite.py

15 lines
548 B
Python
Raw Normal View History

#--depends-on config
from src import ModuleManager, utils
2016-03-29 11:56:58 +00:00
@utils.export("serverset", {"setting": "accept-invites",
"help": "Set whether I accept invites on this server",
2019-05-23 09:28:14 +00:00
"validate": utils.bool_or_none, "example": "on"})
class Module(ModuleManager.BaseModule):
@utils.hook("received.invite")
2016-03-29 11:56:58 +00:00
def on_invite(self, event):
if event["server"].is_own_nickname(event["target_user"].nickname):
if event["server"].get_setting("accept-invites", True):
event["server"].send_join(event["target_channel"])
2018-09-09 09:17:22 +00:00