Genesis commit
This commit is contained in:
commit
5d75c332d6
4 changed files with 345 additions and 0 deletions
30
main.py
Normal file
30
main.py
Normal 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())
|
||||
Loading…
Add table
Add a link
Reference in a new issue