Various tweaks and improvements (2.0.9)
This commit is contained in:
parent
95c2ed64c9
commit
85c81d3c6c
3 changed files with 18 additions and 8 deletions
21
commands.py
21
commands.py
|
@ -6,6 +6,13 @@ from typing import Any, Callable
|
|||
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:
|
||||
bot.log("GOAT DETECTED")
|
||||
bot.msg("Hello Goat", chan)
|
||||
|
@ -105,7 +112,7 @@ def quote(bot: bare.bot, chan: str, name: str, message: str) -> None:
|
|||
if q == []:
|
||||
q = [f'No results for "{query}" ']
|
||||
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)
|
||||
|
||||
|
@ -177,17 +184,19 @@ data: dict[str, dict[str, Any]] = {
|
|||
"restart": {"prefix": True, "aliases": ["reboot"], "check": checks.admin},
|
||||
"uptime": {"prefix": True, "aliases": []},
|
||||
"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"]},
|
||||
"join ": {"prefix": True, "aliases": [], "check": checks.admin},
|
||||
"quote": {"prefix": True, "aliases": ["q"]},
|
||||
"goat.mode.activate": {"prefix": True, "aliases": [], "check": checks.admin},
|
||||
"goat.mode.deactivate": {"prefix": True, "aliases": [], "check": checks.admin},
|
||||
"help": {"prefix": True, "aliases": []},
|
||||
"goat.mode.activate": {"prefix": True, "aliases": ["g.m.a"], "check": checks.admin},
|
||||
"goat.mode.deactivate": {"prefix": True, "aliases": ["g.m.d"], "check": checks.admin},
|
||||
"help": {"prefix": True, "aliases": ["?"]},
|
||||
"amiadmin": {"prefix": True, "aliases": []},
|
||||
"ping": {"prefix": True, "aliases": []},
|
||||
"op me": {"prefix": False, "aliases": [], "check": checks.admin},
|
||||
"whoami": {"prefix": True, "aliases": []},
|
||||
"fpmp": {"prefix": True, "aliases": []},
|
||||
"version": {"prefix": True, "aliases": ["ver","v"]},
|
||||
}
|
||||
regexes: list[str] = [conf.npbase, conf.su]
|
||||
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,
|
||||
"op me": op,
|
||||
"whoami": whoami,
|
||||
"fpmp": fpmp,
|
||||
"version": version,
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ from typing import Optional, Any
|
|||
import bare
|
||||
|
||||
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]
|
||||
su = "^(su|sudo|(su .*|sudo .*))$"
|
||||
servers: dict[str, dict[str, Any]] = {
|
||||
|
|
|
@ -50,7 +50,7 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str]
|
|||
bot.current = "user"
|
||||
if (
|
||||
(name.startswith("saxjax") and bot.server == "efnet")
|
||||
or (name == "ReplIRC" and bot.server == "replirc")
|
||||
or (name in ["ReplIRC", "sshchat"] and bot.server == "replirc")
|
||||
or (
|
||||
name in ["FirePyLink_", "FirePyLink"]
|
||||
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))
|
||||
.strip("[]'")
|
||||
.replace("\\n", "")
|
||||
.strip('"')
|
||||
)
|
||||
bot.msg(f"[QUOTE] {sel}", chan)
|
||||
return None, None
|
||||
|
|
Loading…
Reference in a new issue