OTS ‐ Msg - Mistium/Origin-OS GitHub Wiki
Messaging Commands Documentation
msg - [username]
and msg [message]
These commands are used to send messages to other users in the system.
msg - [username]
This command is used to select a user to send a message to. Replace [username]
with the username of the recipient. The script checks if the username exists and is not "origin.System". If the username is valid, it prepares to send a message to the selected users. If the username is "origin.System", it returns an error message "Cannot send to origin.System".
Example:
msg - Mist
# Prepares to send a message to the user "Mist"
msg - ["Mist","Mist2"]
# Prepares to send a message to the users "Mist" and "Mist2"
msg [message]
This command is used to send a message to the user(s) selected with the msg - [username]
command. Replace [message]
with the message you want to send. The script loops through the list of selected users and sends the message to each of them. If no users have been selected, it returns an error message "Run 'msg - ['username']' first".
Example:
msg "Hello, how are you?"
# Sends the message "Hello, how are you?" to the previously selected user(s)
Practical Examples
Selecting a User and Sending a Message
To select a user named "Mist" and send them a message:
msg - Mist
msg "Hello, how are you?"
# Prepares and sends the message "Hello, how are you?" to the user "Mist"
Selecting Multiple Users and Sending a Message
To select multiple users, "Mist" and "Mist2", and send them a message:
msg - ["Mist","Mist2"]
msg "Good morning!"
# Prepares and sends the message "Good morning!" to the users "Mist" and "Mist2"
Error Handling
If you attempt to send a message to "origin.System":
msg - origin.System
# Returns an error message "Cannot send to origin.System"
If you attempt to send a message without selecting a user first:
msg "Hello, is anyone there?"
# Returns an error message "Run 'msg - ['username']' first"
Advanced Tips
-
Sending to Multiple Users: Ensure that you enclose multiple usernames in brackets and separate them with commas:
msg - ["User1","User2","User3"] msg "Meeting at 3 PM." # Sends the message "Meeting at 3 PM." to "User1", "User2", and "User3"
-
Automating Messages: You can create a script to automate sending messages to multiple users:
msg - ["User1","User2"] msg "Reminder: Submit your reports by EOD."