npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

discord-rock-paper-scissor

v1.2.2

Published

An module to create Rock Paper Scissor game for discord bots

Downloads

47

Readme

Installations

npm i discord-rock-paper-scissor

What?

This package is created for making Rock Paper Scissor game for discord bots with rich features like Message Components.

Why?

This package is very easy to use and you can request new updates and stuff simple by messaging me on my discord server We supports both Slash command and normal command.

How?

Basic

const RPS = require('discord-rock-paper-scissor');
const rps = new RPS();

/**
 * This method will start a Solo game between The message author and bot, everything is automatic <3
 * @param {Discord.Message} message The message object where command was used
 * @param {Discord.Client} bot Your client object
 */
rps.solo(message,bot);

/**
 * This method will start a Duo game between The message author and Player 2, everything is automatic <3
 * @param {Discord.Message} message The message object where command was used
 * @param {Discord.User} player2 The mentioned User / second player. Note it should be a discord user Object not guild member object
 */
rps.duo(message,player2);

Advanced

const RPS = require('../../../../packages/discord-rock-paper-scissor/src');
const rps = new RPS({
    choiceReply: "You chose {move}",
    endTitle: "Game ended very very victoriously for {winner}",
    readyMessage: "Choose the dang moves kiddos",
    drawEndTitle: "Bruh nerds ended up getting a draw",
    choiceTitle: "Choose the move boiiiiiiiiiiiiiiiii",
    choiceDescription: "I  hope that you can read than click on buttons to choose the move",
    drawEndDescription: "{player1} chose : {player1move}\n\n{player2} chose : {player2move}\nStupid nerds arent they",
    endDescription: "[Winner 👑] {winner}'s move : {winnermove}\n\n[Looser 🤮] {looser}'s move : {loosermove}",
    chooseIn: "channel",
    colors: {
        drawEmbed: "#0505e7",
        endEmbed: "#1ae705",
        errorEmbed: "#e70580",
        readyEmbed: "#05b0e7"
    }
});

/**
 * This method will start a Solo game between The message author and bot, everything is automatic <3
 * @param {Discord.Message} message The message object where command was used
 * @param {Discord.Client} bot Your client object
 */
rps.solo(message,bot);

/**
 * This method will start a Duo game between The message author and Player 2, everything is automatic <3
 * @param {Discord.Message} message The message object where command was used
 * @param {Discord.User} player2 The mentioned User / second player. Note it should be a discord user Object not guild member object
 */
rps.duo(message,player2);

Game Response

const result = await rps.solo(); // or await rps.duo();

/** Result body example
 * {
 * failed: boolean, // false => game ended successfully, true => game failed
 * winner: number, // -1 => no one won, 0 => user 1 won or bot incase of solo, 1 => user 2 won or player incase of solo, null => game failed
 * reason: "", // reason of game end
 * error?: Error, // the error object, sometimes it is attached
 */

Note

  • For discord JS 13, use version 1.2.1
  • For discord JS 14, use version >=1.2.2

Support

If you need any help or something you can get support on my discord server