Formatting
This commit is contained in:
parent
4f0f5d50e6
commit
d8a612b6f6
3 changed files with 27 additions and 8 deletions
|
@ -116,7 +116,7 @@ def quote(bot: bare.bot, chan: str, name: str, message: str) -> None:
|
|||
try:
|
||||
q = list(filter(lambda x: re.search(qfilter, x), mm.readlines()))
|
||||
except re.error:
|
||||
q = ['Sorry, your query is invalid regex. Please try again.']
|
||||
q = ["Sorry, your query is invalid regex. Please try again."]
|
||||
if q == []:
|
||||
q = [f'No results for "{query}" ']
|
||||
sel = conf.decode_escapes(
|
||||
|
@ -209,9 +209,10 @@ def markov(bot: bare.bot, chan: str, name: str, message: str) -> None:
|
|||
word = message.split()[1]
|
||||
proposed = bot.markov.generate_text(word)
|
||||
if proposed == word:
|
||||
proposed = f"Chain failed. (Firepup has never been recorded saying \"{word}\")"
|
||||
proposed = f'Chain failed. (Firepup has never been recorded saying "{word}")'
|
||||
bot.msg(proposed, chan)
|
||||
|
||||
|
||||
data: dict[str, dict[str, Any]] = {
|
||||
"!botlist": {"prefix": False, "aliases": []},
|
||||
"bugs bugs bugs": {"prefix": False, "aliases": []},
|
||||
|
@ -242,7 +243,7 @@ data: dict[str, dict[str, Any]] = {
|
|||
"fpmp": {"prefix": True, "aliases": []},
|
||||
"version": {"prefix": True, "aliases": ["ver", "v"]},
|
||||
"np": {"prefix": True, "aliases": []},
|
||||
"markov": {"prefix": True, "aliases": ["m"]}
|
||||
"markov": {"prefix": True, "aliases": ["m"]},
|
||||
}
|
||||
regexes: list[str] = [conf.npbase, conf.su]
|
||||
call: dict[str, Callable[[bare.bot, str, str, str], None]] = {
|
||||
|
|
22
threads.py
22
threads.py
|
@ -109,7 +109,16 @@ def radio(instance: bare.bot) -> NoReturn:
|
|||
if misses < 0:
|
||||
misses += 1
|
||||
if debug:
|
||||
instance.msg(str({"misses": misses, "missChunk": missChunk, "misses exceed or meet limit": misses <= missCap}), "#fp-radio-debug")
|
||||
instance.msg(
|
||||
str(
|
||||
{
|
||||
"misses": misses,
|
||||
"missChunk": missChunk,
|
||||
"misses exceed or meet limit": misses <= missCap,
|
||||
}
|
||||
),
|
||||
"#fp-radio-debug",
|
||||
)
|
||||
sleep(2)
|
||||
continue
|
||||
instance.msg(
|
||||
|
@ -125,7 +134,16 @@ def radio(instance: bare.bot) -> NoReturn:
|
|||
for line in Err.split("\n"):
|
||||
instance.log(line, "WARN")
|
||||
if debug:
|
||||
instance.msg(str({"misses": misses, "missChunk": missChunk, "misses exceed or meet limit": misses <= missCap}), "#fp-radio-debug")
|
||||
instance.msg(
|
||||
str(
|
||||
{
|
||||
"misses": misses,
|
||||
"missChunk": missChunk,
|
||||
"misses exceed or meet limit": misses <= missCap,
|
||||
}
|
||||
),
|
||||
"#fp-radio-debug",
|
||||
)
|
||||
sleep(2)
|
||||
instance.log("Thread while loop broken", "FATAL")
|
||||
exit(1)
|
||||
|
|
Loading…
Reference in a new issue