Serve/modules/shazam.py
2025-08-30 13:55:22 +02:00

30 lines
1.1 KiB
Python

import libminecraft
import libsignal
import libcommon
malasaurGamemode = "survival"
RetardsServer = libcommon.Group(
"Retards Server", "5PlbXaPmWZQkhmuyyC/fkWTy8K+BqomjK7byVDyxmpo=")
@libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: Set Malasaur's game mode to (.*) Mode")
def malasaurSetGamemode(gamemode: str):
global malasaurGamemode
malasaurGamemode = gamemode.lower()
@libsignal.onMessage(RetardsServer)
def shazam(usr: str, msg: str):
if usr == "Malasaur" and "shazam" in msg.lower():
if malasaurGamemode == "survival":
libminecraft.sendCommand("gamemode creative Malasaur")
libminecraft.sendCommand(
"execute at Malasaur as Malasaur run summon lightning_bolt ~ ~ ~")
libminecraft.sendCommand("op Malasaur")
elif malasaurGamemode == "creative":
libminecraft.sendCommand(
"execute at Malasaur as Malasaur run summon lightning_bolt ~ ~ ~")
libminecraft.sendCommand("gamemode survival Malasaur")
libminecraft.sendCommand("deop Malasaur")