forked from Firepup650/FireBot
Formatting
This commit is contained in:
parent
42631780ff
commit
c4c0a4317d
1 changed files with 7 additions and 2 deletions
|
@ -67,9 +67,14 @@ def mfind(message: str, find: list, usePrefix: bool = True) -> bool:
|
||||||
else:
|
else:
|
||||||
return any(message[: len(match)] == match for match in find)
|
return any(message[: len(match)] == match for match in find)
|
||||||
|
|
||||||
def sub(message: str, bot: bare.bot, chan: Optional[str] = "", name: Optional[str] = "") -> str:
|
|
||||||
|
def sub(
|
||||||
|
message: str, bot: bare.bot, chan: Optional[str] = "", name: Optional[str] = ""
|
||||||
|
) -> str:
|
||||||
result = message.replace("$BOTNICK", bot.nick).replace("$NICK", bot.nick)
|
result = message.replace("$BOTNICK", bot.nick).replace("$NICK", bot.nick)
|
||||||
result = result.replace("$NICKLEN", str(bot.nicklen)).replace("$MAX", str(bot.nicklen))
|
result = result.replace("$NICKLEN", str(bot.nicklen)).replace(
|
||||||
|
"$MAX", str(bot.nicklen)
|
||||||
|
)
|
||||||
if chan:
|
if chan:
|
||||||
result = result.replace("$CHANNEL", chan).replace("$CHAN", chan)
|
result = result.replace("$CHANNEL", chan).replace("$CHAN", chan)
|
||||||
if name:
|
if name:
|
||||||
|
|
Loading…
Reference in a new issue