Genesis commit

This commit is contained in:
Malasaur 2025-12-14 16:32:01 +01:00
commit 5d75c332d6
No known key found for this signature in database
4 changed files with 345 additions and 0 deletions

30
main.py Normal file
View file

@ -0,0 +1,30 @@
import asyncio
from libminecraft import Minecraft
from libsignal import Group, ReceivedMessage, Signal
RChat = Group("RS Chat", "5PlbXaPmWZQkhmuyyC/fkWTy8K+BqomjK7byVDyxmpo=")
async def main():
minecraft = Minecraft("http://localhost", 42101, "1234")
signal = Signal("http://localhost", 42069)
##########################
# === RETARDS SERVER === #
##########################
@signal.onMessage(RChat)
async def onRChatMessage(message: ReceivedMessage):
await minecraft.command(
f'tellraw @a "<{message.user.last_nickname or message.user.name}> {message.message.replace('"', '\\"')}"'
)
@minecraft.onPlayerChat()
async def onRServerMessage(player: str, message: str):
await signal.sendMessage(f"<{player}> {message}", RChat)
await signal.loop()
asyncio.run(main())