
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@skiilaa/hackmud-chat-api
Advanced tools
An easy-to-use hackmud Chat API module.
Latest NPM release (recommended): npm @skiilaa/install hackmud-chat-api
Latest GitHub version: npm install moriczgergo/hackmud-chat-api
var Hackmud = require('hackmud-chat-api');
var chat = new Hackmud("token or chat_pass");
console.log("Logged in! Token: " + chat.token);
console.log("Users: " + chat.user.join(", "));
chat.subscribe(messages => {
messages.forEach(message => {
console.log("From: " + message.from_user);
console.log("To: " + message.to_user);
if (message.channel) { // If sent in a channel
console.log("Sent in " + message.channel);
chat.send(message.to_user, message.channel, message.msg); // Reply with the same message in the same channel with the user that received the message.
} else { // If sent in private
chat.tell(message.to_user, message.from_user, message.msg) // Reply with the same message in private with the user that received that message.
console.log("Sent in private");
}
console.log(message.msg);
});
});
Unique message ID provided by the API.
Unix timestamp in milliseconds.
The user who sent the message.
The user who received the message.
The message's text. (with color codes)
Optional, only present if the message was sent in a channel, if the message wasn't a tell.
Parameters:
auth
: A token or a chat_pass.Initializes the client.
Example:
var chat = new Client("ghwef");
Params:
handler
: A callback that receives messages.
users
: Array of users to listen with. Optional.Returns: Index of listener. You'll need this if you want to unsubscribe.
Example:
var handlerIndex = chat.subscribe(messages => {
console.log("Messages received:");
messages.forEach(message => {
console.log(message.msg);
});
});
Params:
index
: Index of handler to unsubscribe.Example:
chat.unsubscribe(handlerIndex);
Params:
username
: Username to send message with.channel
: Channel to send message to.msg
: Message to send.Returns: null or error, if there was one.
Example:
var err = chat.send("my_bot", "0000", "my_bot.totally_not_a_scam is the best script ever.");
if (err) console.error("An error occurred: " + err);
Params:
username
: Username to send message with.tell
˙: Username to send message to.msg
: Message to send.Returns: null or error, if there was one.
Example:
var err = chat.tell("my_bot", "me", "Started running.");
if (err) console.error("An error occurred: " + err);
Array of users.
An object. The keys are usernames, and the values are arrays of channel names that the user has joined.
Example:
{
me: ["0000", "town", "CHOICE_EPSILON_2"],
my_bot: ["0000"]
}
The token, either the one passed to the constructor, or the one generated from chat_pass.
FAQs
An easy-to-use hackmud Chat API module.
We found that @skiilaa/hackmud-chat-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.