Various tweaks and improvements (2.0.9)

This commit is contained in:
Firepup Sixfifty 2024-02-15 20:46:39 -06:00
parent 95c2ed64c9
commit 85c81d3c6c
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA
3 changed files with 18 additions and 8 deletions

View file

@ -6,6 +6,13 @@ from typing import Any, Callable
import bare, re, checks import bare, re, checks
def fpmp(bot: bare.bot, chan: str, name: str, message: str) -> None:
bot.msg("Firepup's master playlist", chan)
bot.msg("https://open.spotify.com/playlist/4ctNy3O0rOwhhXIKyLvUZM", chan)
def version(bot: bare.bot, chan: str, name: str, message: str) -> None:
bot.msg("Version: " + bot.__version__, chan)
def goat(bot: bare.bot, chan: str, name: str, message: str) -> None: def goat(bot: bare.bot, chan: str, name: str, message: str) -> None:
bot.log("GOAT DETECTED") bot.log("GOAT DETECTED")
bot.msg("Hello Goat", chan) bot.msg("Hello Goat", chan)
@ -105,7 +112,7 @@ def quote(bot: bare.bot, chan: str, name: str, message: str) -> None:
if q == []: if q == []:
q = [f'No results for "{query}" '] q = [f'No results for "{query}" ']
sel = conf.decode_escapes( sel = conf.decode_escapes(
str(r.sample(q, 1)).strip("[]'").replace("\\n", "").strip('"') str(r.sample(q, 1)).strip("[]'").replace("\\n", "")
) )
bot.msg(sel, chan) bot.msg(sel, chan)
@ -177,17 +184,19 @@ data: dict[str, dict[str, Any]] = {
"restart": {"prefix": True, "aliases": ["reboot"], "check": checks.admin}, "restart": {"prefix": True, "aliases": ["reboot"], "check": checks.admin},
"uptime": {"prefix": True, "aliases": []}, "uptime": {"prefix": True, "aliases": []},
"raw ": {"prefix": True, "aliases": ["cmd "], "check": checks.admin}, "raw ": {"prefix": True, "aliases": ["cmd "], "check": checks.admin},
"debug": {"prefix": True, "aliases": ["dbg"], "check": checks.admin}, "debug": {"prefix": True, "aliases": ["dbg","d"], "check": checks.admin},
"8ball": {"prefix": True, "aliases": ["eightball", "8b"]}, "8ball": {"prefix": True, "aliases": ["eightball", "8b"]},
"join ": {"prefix": True, "aliases": [], "check": checks.admin}, "join ": {"prefix": True, "aliases": [], "check": checks.admin},
"quote": {"prefix": True, "aliases": ["q"]}, "quote": {"prefix": True, "aliases": ["q"]},
"goat.mode.activate": {"prefix": True, "aliases": [], "check": checks.admin}, "goat.mode.activate": {"prefix": True, "aliases": ["g.m.a"], "check": checks.admin},
"goat.mode.deactivate": {"prefix": True, "aliases": [], "check": checks.admin}, "goat.mode.deactivate": {"prefix": True, "aliases": ["g.m.d"], "check": checks.admin},
"help": {"prefix": True, "aliases": []}, "help": {"prefix": True, "aliases": ["?"]},
"amiadmin": {"prefix": True, "aliases": []}, "amiadmin": {"prefix": True, "aliases": []},
"ping": {"prefix": True, "aliases": []}, "ping": {"prefix": True, "aliases": []},
"op me": {"prefix": False, "aliases": [], "check": checks.admin}, "op me": {"prefix": False, "aliases": [], "check": checks.admin},
"whoami": {"prefix": True, "aliases": []}, "whoami": {"prefix": True, "aliases": []},
"fpmp": {"prefix": True, "aliases": []},
"version": {"prefix": True, "aliases": ["ver","v"]},
} }
regexes: list[str] = [conf.npbase, conf.su] regexes: list[str] = [conf.npbase, conf.su]
call: dict[str, Callable[[bare.bot, str, str, str], None]] = { call: dict[str, Callable[[bare.bot, str, str, str], None]] = {
@ -210,4 +219,6 @@ call: dict[str, Callable[[bare.bot, str, str, str], None]] = {
"ping": ping, "ping": ping,
"op me": op, "op me": op,
"whoami": whoami, "whoami": whoami,
"fpmp": fpmp,
"version": version,
} }

View file

@ -6,7 +6,7 @@ from typing import Optional, Any
import bare import bare
load_dotenv() load_dotenv()
__version__ = "v2.0.6" __version__ = "v2.0.9"
npbase: str = "\[\x0303last\.fm\x03\] [A-Za-z0-9_[\]{}\\|\-^]{1,$MAX} (is listening|last listened) to: \x02.+ - .*\x02( \([0-9]+ plays\)( \[.*\])?)?" # pyright: ignore [reportInvalidStringEscapeSequence] npbase: str = "\[\x0303last\.fm\x03\] [A-Za-z0-9_[\]{}\\|\-^]{1,$MAX} (is listening|last listened) to: \x02.+ - .*\x02( \([0-9]+ plays\)( \[.*\])?)?" # pyright: ignore [reportInvalidStringEscapeSequence]
su = "^(su|sudo|(su .*|sudo .*))$" su = "^(su|sudo|(su .*|sudo .*))$"
servers: dict[str, dict[str, Any]] = { servers: dict[str, dict[str, Any]] = {

View file

@ -50,7 +50,7 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str]
bot.current = "user" bot.current = "user"
if ( if (
(name.startswith("saxjax") and bot.server == "efnet") (name.startswith("saxjax") and bot.server == "efnet")
or (name == "ReplIRC" and bot.server == "replirc") or (name in ["ReplIRC", "sshchat"] and bot.server == "replirc")
or ( or (
name in ["FirePyLink_", "FirePyLink"] name in ["FirePyLink_", "FirePyLink"]
and bot.server in ["ircnow", "backupbox"] and bot.server in ["ircnow", "backupbox"]
@ -144,7 +144,6 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str]
str(r.sample(mm.readlines(), 1)) str(r.sample(mm.readlines(), 1))
.strip("[]'") .strip("[]'")
.replace("\\n", "") .replace("\\n", "")
.strip('"')
) )
bot.msg(f"[QUOTE] {sel}", chan) bot.msg(f"[QUOTE] {sel}", chan)
return None, None return None, None