Clean up bot a bit.
Add messages & kicks for colour
This commit is contained in:
parent
70f7bbb45a
commit
71a988df23
@ -25,6 +25,8 @@ import imp
|
|||||||
import math
|
import math
|
||||||
import fnmatch
|
import fnmatch
|
||||||
|
|
||||||
|
BOLD = "\u0002"
|
||||||
|
|
||||||
COMMANDS = {}
|
COMMANDS = {}
|
||||||
PM_COMMANDS = {}
|
PM_COMMANDS = {}
|
||||||
HOOKS = {}
|
HOOKS = {}
|
||||||
@ -181,6 +183,13 @@ def reset(cli):
|
|||||||
dict.clear(var.DCED_PLAYERS)
|
dict.clear(var.DCED_PLAYERS)
|
||||||
dict.clear(var.DISCONNECTED)
|
dict.clear(var.DISCONNECTED)
|
||||||
|
|
||||||
|
def make_stasis(nick, penalty):
|
||||||
|
try:
|
||||||
|
cloak = var.USERS[nick]['cloak']
|
||||||
|
if cloak is not None:
|
||||||
|
var.illegal_joins[cloak] += penalty
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
@pmcmd("fdie", "fbye", admin_only=True)
|
@pmcmd("fdie", "fbye", admin_only=True)
|
||||||
@cmd("fdie", "fbye", admin_only=True)
|
@cmd("fdie", "fbye", admin_only=True)
|
||||||
@ -980,12 +989,7 @@ def reaper(cli, gameid):
|
|||||||
cli.msg(chan, ("\u0002{0}\u0002 didn't get out of bed "+
|
cli.msg(chan, ("\u0002{0}\u0002 didn't get out of bed "+
|
||||||
"for a very long time. S/He is declared dead. Appears "+
|
"for a very long time. S/He is declared dead. Appears "+
|
||||||
"(s)he was a \u0002{1}\u0002.").format(nck, var.get_role(nck)))
|
"(s)he was a \u0002{1}\u0002.").format(nck, var.get_role(nck)))
|
||||||
try:
|
make_stasis(nck, var.PART_STASIS_PENALTY)
|
||||||
cloak = var.USERS[nck]['cloak']
|
|
||||||
if cloak is not None:
|
|
||||||
var.illegal_joins[cloak] += var.PART_STASIS_PENALTY
|
|
||||||
except KeyError:
|
|
||||||
pass
|
|
||||||
if not del_player(cli, nck):
|
if not del_player(cli, nck):
|
||||||
return
|
return
|
||||||
pl = var.list_players()
|
pl = var.list_players()
|
||||||
@ -1030,7 +1034,16 @@ def update_last_said(cli, nick, chan, rest):
|
|||||||
if var.PHASE not in ("none", "join"):
|
if var.PHASE not in ("none", "join"):
|
||||||
var.LOGGER.logChannelMessage(nick, rest)
|
var.LOGGER.logChannelMessage(nick, rest)
|
||||||
|
|
||||||
|
if var.CARE_BOLD and BOLD in "".join(rest):
|
||||||
|
if var.KILL_BOLD:
|
||||||
|
cli.send("KICK {0} {1} :Using bold is not allowed".format(botconfig.CHANNEL, nick))
|
||||||
|
else:
|
||||||
|
cli.msg(botconfig.CHANNEL, nick + ": Using bold in the channel is not allowed.")
|
||||||
|
if var.CARE_COLOR and "\x03" in "".join(rest):
|
||||||
|
if var.KILL_COLOR:
|
||||||
|
cli.send("KICK {0} {1} :Using color is not allowed".format(botconfig.CHANNEL, nick))
|
||||||
|
else:
|
||||||
|
cli.msg(botconfig.CHANNEL, nick + ": Using color in the channel is not allowed.")
|
||||||
|
|
||||||
@hook("join")
|
@hook("join")
|
||||||
def on_join(cli, raw_nick, chan, acc="*", rname=""):
|
def on_join(cli, raw_nick, chan, acc="*", rname=""):
|
||||||
@ -2716,7 +2729,6 @@ def listroles(cli, nick, chan, rest):
|
|||||||
txt += '{0}: There are \u0002{1}\u0002 playing. '.format(nick, pl)
|
txt += '{0}: There are \u0002{1}\u0002 playing. '.format(nick, pl)
|
||||||
|
|
||||||
for i,v in sorted({i:var.ROLES_GUIDE[i] for i in var.ROLES_GUIDE if i is not None}.items()):
|
for i,v in sorted({i:var.ROLES_GUIDE[i] for i in var.ROLES_GUIDE if i is not None}.items()):
|
||||||
BOLD = "\u0002"
|
|
||||||
if (i <= pl):
|
if (i <= pl):
|
||||||
txt += BOLD
|
txt += BOLD
|
||||||
txt += "[" + str(i) + "] "
|
txt += "[" + str(i) + "] "
|
||||||
|
@ -26,6 +26,11 @@ LEAVE_STASIS_PENALTY = 3
|
|||||||
IDLE_STASIS_PENALTY = 2
|
IDLE_STASIS_PENALTY = 2
|
||||||
PART_STASIS_PENALTY = 4
|
PART_STASIS_PENALTY = 4
|
||||||
|
|
||||||
|
CARE_BOLD = True
|
||||||
|
CARE_COLOR = True
|
||||||
|
KILL_COLOR = True
|
||||||
|
KILL_BOLD = False
|
||||||
|
|
||||||
LOG_FILENAME = ""
|
LOG_FILENAME = ""
|
||||||
BARE_LOG_FILENAME = ""
|
BARE_LOG_FILENAME = ""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user