Source code for

from typing import Dict
import miney

[docs]class Chat: """ Chat functions. """ def __init__(self, mt: miney.Minetest): = mt def __repr__(self): return '<minetest chat functions>'
[docs] def send_to_all(self, message: str) -> None: """ Send a chat message to all connected players. :param message: The chat message :return: None """"minetest.chat_send_all('{}')".format(message.replace("\'", "\\'")))
def send_to_player(self, playername: str, message: str): return"return minetest.chat_send_player({}, {}})".format(playername, message)) def format_message(self, playername: str, message: str): return"return minetest.format_chat_message({}}, {}})".format(playername, message)) def registered_commands(self): return"return minetest.registered_chatcommands") def register_command(self, name, parameter: str, callback_function, description: str = "", privileges: Dict = None): if isinstance(callback_function, callable): pass elif isinstance(callback_function, str): pass return """ return minetest.register_chatcommand( {name}, {{params = {params}, description={description}, privs={privs}, func={func}} )""".format( name=name, params=parameter, description=description, if privileges else "{}", func=callback_function ) ) def override_command(self, definition): pass def unregister_command(self, name: str): return"return minetest.register_chatcommand({})".format(name))