@samual/hackmud-chat-api
    TypeScript icon, indicating that this package has built-in type declarations

    0.3.0 • Public • Published

    hackmud-chat-api

    Build Test

    alternative hackmud chat api wrapper for node

    example:

    const { Client, MessageType } = require("@samual/hackmud-chat-api")
    
    const MY_USER = "mr_bot" // this should be one of your users
    const MY_TOKEN = "91w6zc1teswMyIG2QJag" // this can also be your chat pass
    
    const client = new Client(MY_TOKEN)
    
    client.onStart(token => {
        console.log("my token is", token)
    })
    
    client.onMessage(messages => {
        for (const message of messages) {
            if (message.type == MessageType.Tell && message.content == "ping")
                client.tellMessage(MY_USER, message.user, "pong!")
        }
    })
    
    client.sendMessage(MY_USER, "0000", "hello, I am a bot")

    Install

    npm i @samual/hackmud-chat-api

    DownloadsWeekly Downloads

    52

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    15.9 kB

    Total Files

    21

    Last publish

    Collaborators

    • samual