From 1e4e9199103b01baf426f75cbea8b4d16681e549 Mon Sep 17 00:00:00 2001 From: iou1name Date: Tue, 15 Oct 2024 09:24:11 -0400 Subject: [PATCH] replace guard dog consul --- modules/ban_join.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modules/ban_join.py diff --git a/modules/ban_join.py b/modules/ban_join.py new file mode 100644 index 0000000..89af4d8 --- /dev/null +++ b/modules/ban_join.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +""" +Bans a user as soon as they join a channel. +""" +import time + +from module import user_joined +from tools import configureHostMask + +@user_joined(True) +def ban_join(bot, trigger): + """ + Bans a user as soon as they join a channel. + """ + banhee = trigger.nick + banmask = configureHostMask(banhee) + period = 30 + + bot.mode(trigger.channel, True, "b", mask=banmask) + time.sleep(period) + bot.mode(trigger.channel, False, "b", mask=banmask)