Make quotes more sane
This commit is contained in:
parent
400a29db99
commit
3c9f11cc52
3 changed files with 4 additions and 4 deletions
|
@ -112,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", "")
|
r.sample(q, 1)[0].replace("\\n", "").replace("\n", "")
|
||||||
)
|
)
|
||||||
bot.msg(sel, chan)
|
bot.msg(sel, chan)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ from typing import Optional, Any
|
||||||
import bare
|
import bare
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
__version__ = "v2.0.11"
|
__version__ = "v2.0.12"
|
||||||
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]] = {
|
||||||
|
|
|
@ -141,9 +141,9 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str]
|
||||||
bot.channels[chan] = 0
|
bot.channels[chan] = 0
|
||||||
with open("mastermessages.txt", "r") as mm:
|
with open("mastermessages.txt", "r") as mm:
|
||||||
sel = conf.decode_escapes(
|
sel = conf.decode_escapes(
|
||||||
str(r.sample(mm.readlines(), 1))
|
r.sample(mm.readlines(), 1)[0]
|
||||||
.strip("[]'")
|
|
||||||
.replace("\\n", "")
|
.replace("\\n", "")
|
||||||
|
.replace("\n", "")
|
||||||
)
|
)
|
||||||
bot.msg(f"[QUOTE] {sel}", chan)
|
bot.msg(f"[QUOTE] {sel}", chan)
|
||||||
return None, None
|
return None, None
|
||||||
|
|
Loading…
Reference in a new issue