Organize things better and fix a typo

This commit is contained in:
Teh PeGaSuS
2026-03-06 09:32:13 +01:00
parent a44468bbd3
commit 48a04dbcbd
+17 -8
View File
@@ -93,13 +93,6 @@ namespace eval cmgmt {
bind msg * delop ::cmgmt::delop_msg bind msg * delop ::cmgmt::delop_msg
bind msg * ops ::cmgmt::chanops_msg bind msg * ops ::cmgmt::chanops_msg
# ----------
# Auto add bans
# ----------
# Add bans
bind mode * "*+b*" ::cmgmt::abans
bind mode * "*-b*" ::cmgmt::rbans
# Channel flag to auto add bans to the bot ban list # Channel flag to auto add bans to the bot ban list
setudef flag addBans setudef flag addBans
@@ -126,6 +119,7 @@ namespace eval cmgmt {
return return
} }
} }
::msgcat::mclocale $::cmgmt::locale ::msgcat::mclocale $::cmgmt::locale
::msgcat::mcload [file join $cmgmt::lang_dir] ::msgcat::mcload [file join $cmgmt::lang_dir]
@@ -626,8 +620,13 @@ namespace eval cmgmt {
return 0 return 0
} }
if {![validchan $chan]} {
putserv "PRIVMSG $nick :[::msgcat::mc bot.not.onchan $chan]"
return 0
}
if {![matchattr $hand o|o $chan]} { if {![matchattr $hand o|o $chan]} {
putserv "NOTICE $nick :[::msgcat::mc error.no.access $nick]" putserv "PRIVMSG $nick :[::msgcat::mc error.no.access $nick]"
return 0 return 0
} }
@@ -1233,6 +1232,13 @@ namespace eval cmgmt {
} }
# ---------- DON'T TOUCH UNLESS YOU KNOW WHAT YOU'RE DOING ---------- # # ---------- DON'T TOUCH UNLESS YOU KNOW WHAT YOU'RE DOING ---------- #
# ----------
# Auto add bans binds
# ----------
# Add bans
bind mode * "*+b*" ::cmgmt::abans
bind mode * "*-b*" ::cmgmt::rbans
# ---------- # ----------
# Auto add bans # Auto add bans
# ---------- # ----------
@@ -1274,6 +1280,7 @@ namespace eval cmgmt {
} }
# We also need to deal with the addition of extbans, since we don't deal with them internally # We also need to deal with the addition of extbans, since we don't deal with them internally
# but we need to add them as sticky to our database to prevent the bot from removing them
if {[matchstr "~*" $target] && ![isban $target $chan]} { if {[matchstr "~*" $target] && ![isban $target $chan]} {
newchanban $chan $target $nick EXTBAN 0 sticky newchanban $chan $target $nick EXTBAN 0 sticky
return 0 return 0
@@ -1302,6 +1309,8 @@ namespace eval cmgmt {
# Lets check for existing extbans and add them to our ban list # Lets check for existing extbans and add them to our ban list
# and make them sticky so the bot doesn't remove them # and make them sticky so the bot doesn't remove them
# The removal will be mirrored (if the bot is online) as soon as
# a chanop removes the extban in the channel
bind cron * "*/5 * * * *" ::cmgmt::addextbans bind cron * "*/5 * * * *" ::cmgmt::addextbans
proc addextbans {minute hour day month weekday} { proc addextbans {minute hour day month weekday} {
# putlog "Adding existing extbans to banlist" # putlog "Adding existing extbans to banlist"