Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@samual/hackmud-chat

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@samual/hackmud-chat

typed hackmud chat API wrapper for node and browsers with built in rate limiting

dev
latest
Source
npmnpm
Version
0.1.0-c17339d
Version published
Maintainers
1
Created
Source

Hackmud Chat

Typed hackmud chat API wrapper for node and browsers with built in rate limiting. Also a command hackmud-chat for turning a pass into a token and viewing chat.

Turning Your Chat Pass Into a Chat Token

  • Make sure you have the command installed npm install -g @samual/hackmud-chat
  • Run the command hackmud-chat get-token <chat pass>

Viewing hackmud Chat in Your Terminal

  • Run hackmud-chat
  • Type in your chat token you got from the above process

Chat Bot Example

const { Client, MessageKind, getChannelData } = require("@samual/hackmud-chat")

const MY_USER = "mr_bot" // this should be one of your users
const MY_TOKEN = "91w6zc1teswMyIG2QJag"

(async () => {
    const client = new Client(MY_TOKEN, [ ...(await getChannelData(MY_TOKEN)).users.keys() ])

    client.onMessages(messages => {
        for (const message of messages) {
            if (message.kind == MessageKind.Tell && message.content == "ping")
                client.tellMessage(MY_USER, message.user, "pong!")
        }
    })

    client.sendMessage(MY_USER, "0000", "hello, I am a bot")
})()

Keywords

hackmud

FAQs

Package last updated on 13 Jun 2023

Did you know?

Socket

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.

Install

Related posts