Git Product home page Git Product logo

moonstone's Introduction

Moonstone NPM version

A simple, standalone, dogehouse.tv API wrapper

Installing

You will need NodeJS and NPM. To install moonstone on your local project, run:

npm install --no-optional --production moonstone-wrapper

If you need audio support, remove the --no-optional.

Usage

You can use the example from below to see how you can use moonstone.

Ping Pong Example

const Moonstone = require("moonstone-wrapper");

var bot = Moonstone("TOKEN"); // Replace TOKEN with your bot account's token

bot.on("ready", async () => {
  // When the bot is ready
  console.log(`Ready! Logged in as ${bot.user.username}`); // Log "Ready!"
  const topRooms = await bot.getTopRooms(); // Grab the top rooms
  bot.joinRoom(topRooms[0]); // Join the top room
});

bot.on("newChatMsg", (msg) => {
  // When a message is created
  if (msg.content === "!ping") {
    // If the message content is "!ping"
    msg.room.sendChatMessage("Pong!"); // Send a message in the same channel with "Pong!"
  } else if (msg.content === "!pong") {
    // Otherwise, if the message is "!pong"
    msg.user.sendWhisper("Ping!"); // Whisper to the user with "Ping!"
  }
});

bot.connect(); // Get the bot to connect to Dogehouse

More examples can be found in the examples folder.

Support

You can find help on the official support server.

License

Distributed under the MIT License. See LICENSE for more information.

Contributors

moonstone's People

Contributors

isaiah-hamilton avatar itsfolf avatar khaledcp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

moonstone's Issues

examples

can you show an example for how to change the bots profile?

dogehouse will be closing soon

@fuwwy I just watched ben awad's (The owner of dogehouse) dogehouse log, and in the video he will be stopping the production of dogehouse. This is just to let people know that are working on moonstone the news. Link to Ben's video to learn more.

I'm Dumb and need help

I'm trying to make it when a user requests to speak it makes them a speaker so far I got this but I get a error

bot.on("handRaised", async (user, room) => {
console.log(user.username);
console.log(room.name)
let role = 'speaker'
room.setRole(role, user)
});

bot.editSelf not working

I was trying to change my bot's username with bot.editSelf, but it doesn't change the username of the bot. My code below.
carbon
If you need more info then let me know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.