jingel top

This commit is contained in:
2025-12-27 22:25:27 +01:00
parent 5a96f58ec4
commit a036786140
3 changed files with 10 additions and 5 deletions
+2 -2
View File
@@ -43,11 +43,11 @@ class Module2(PlayerModule):
def imc(self, imc: InterModuleCommunication) -> None:
super().imc(imc)
self._imc.register(self, "jingle")
def imc_data(self, source: BaseIMCModule, source_name: str | None, data: object, broadcast: bool) -> object:
def imc_data(self, source: BaseIMCModule, source_name: str | None, data: bool, broadcast: bool) -> object:
if broadcast: return
jingle = self.primary
if self.secondary and (random.randint(1,3) == 1): jingle = random.choice(self.secondary)
return self._imc.send(self, "activemod", {"action": "add_to_toplay", "songs": [f"!{jingle}"]})
return self._imc.send(self, "activemod", {"action": "add_to_toplay", "songs": [f"!{jingle}"], "top": bool(data)})
options = Path("/home/user/Jingiel.mp3"), [Path("/home/user/jing2.opus"), Path("Jing3.opus")]
module = Module2(*options)