Avoid spamming #firemc #6

Closed
9pfs wants to merge 14 commits from 9pfs/FireBot:dont-spam-firemc into master
3 changed files with 4 additions and 11 deletions
Showing only changes of commit 135918a6e5 - Show all commits

2
bot.py
View file

@ -270,7 +270,7 @@ class bot(bare.bot):
tdict = {} tdict = {}
for thread in self.threads: for thread in self.threads:
tdict[thread] = timers.data[thread] tdict[thread] = timers.data[thread]
if tdict[thread]["passInstance"]: if thread in ["radio"]:
Firepup650 marked this conversation as resolved Outdated

Critical change, needs to be un-reverted

Critical change, needs to be un-reverted
9pfs marked this conversation as resolved Outdated

This needs to be indented another layer

This needs to be indented another layer
9pfs marked this conversation as resolved Outdated

We CANNOT use a tab here, this will crash the bot. It absolutely must be 4 spaces.

We CANNOT use a tab here, this will crash the bot. It absolutely must be 4 spaces.
Outdated
Review

Uh, what? I thought that WAS 4 spaces!

Uh, what? I thought that WAS 4 spaces!
tdict[thread]["args"] = [self] tdict[thread]["args"] = [self]
tMgr = Thread(target=timers.threadManager, args=(tdict,)) tMgr = Thread(target=timers.threadManager, args=(tdict,))
tMgr.daemon = True tMgr.daemon = True

View file

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

View file

@ -112,18 +112,11 @@ def radio(instance: bare.bot) -> NoReturn:
instance.log("Thread while loop broken", "FATAL") instance.log("Thread while loop broken", "FATAL")
exit(1) exit(1)
def mcDown(instance: bare.bot) -> None: def mcDown(instance: bare.bot) -> None:
instance.sendraw("TOPIC #firemc :FireMC Relay channel (offline)") instance.sendraw("TOPIC #firemc :FireMC Relay channel (offline)")
Firepup650 marked this conversation as resolved Outdated

radio needs to use "passInstance": True, not "args": []

`radio` needs to use `"passInstance": True`, not `"args": []`
data: dict[str, dict[str, Any]] = { data: dict[str, dict[str, Any]] = {
"radio": {"noWrap": True, "func": radio, "passInstance": True}, "radio": {"noWrap": True, "func": radio, "args": []},
Firepup650 marked this conversation as resolved Outdated

related to my other commit, this needs to use the new passInstance param.

related to my other commit, this needs to use the new `passInstance` param.
"mc-down": { "mc-down": {"noWrap": False, "func": mcDown, "args": [], "interval": 60, "ignoreErrors": True}
Firepup650 marked this conversation as resolved Outdated

Reverting that commit didn't even remove the timer, lol

Reverting that commit didn't even remove the timer, lol
Outdated
Review

Looking for other commits to revert then

Looking for other commits to revert then

Just revert the revert, I'll delete the stuff that needs removal myself if you want.

Just revert the revert, I'll delete the stuff that needs removal myself if you want.
"noWrap": False,
"func": mcDown,
"passInstance": True,
"interval": 60,
"ignoreErrors": True,
},
} }