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

modelvnn

v1.0.9

Published

một package tiếng Việt do ModelVNN tạo ra

Downloads

3

Readme

modelvnn-api

một package tiếng Việt do ModelVNN tạo ra

Server

Tham gia server của tui -> https://discord.io/peachlovervietnam

Info

Một api đơn giản để định cấu hình và nâng cao các cách mã hóa bot bất hòa của bạn. Tương thích với discord.js v13.

🛠 Các lệnh

  • [ReactionPages] - phân trang đơn giản để làm cho "MessageEmbed" của bạn có thể tương tác được.
  • [Confirmation] - Một bộ thu thập phản ứng trả về biểu tượng cảm xúc đầu tiên được thu thập, có thể được sử dụng làm lời nhắc xác nhận.
  • [timeout] - Giúp việc xóa tin nhắn theo nhu cầu của bạn dễ dàng hơn
  • [tictactoe] - Trò chơi TicTacToe bây giờ có thể chơi được trong discord.
  • [GiveawayClient] - Giveaway Client, cách dễ dàng để quản lý giveaway của bạn
  • [chatBot] - Một chatbot dễ dàng không cần api (chỉ hỗ trợ tiếng Anh)

nhiều tính năng sắp ra mắt! (hoặc tui lười tui ko lm nx :v)

✈ Import

// Dùng Node.js `require()`
const modelpack = require("modelvnn");
............
// Dùng ES6 import
import modelpack from "modelvnn";

🙋‍♂️ Support

Tham gia server này để được hỗ trợ -> https://discord.io/ModelDev


🔧 Cách dùng


ReactionPages

Ví dụ :

const modelpack = require("modelvnn");
const ReactionPages = modelpack.ReactionPages;

const { MessageEmbed } = require("discord.js");

const embed1 = new MessageEmbed().setTitle("1");

const embed2 = new MessageEmbed().setTitle("2");

const pages = [embed1, embed2];

const textPageChange = true;

const emojis = ["⏪", "⏩"];

const time = 30000;

ReactionPages(msg, pages, textPageChange, emojis, time);

Preview trong danh sách nhạc :

preview


Confirmation

const { confirmation } = require("modelvnn");
message.channel.send("Confirmation for banning members").then(async (msg) => {
    const emoji = await confirmation(msg, ["✅", "❌"], 30000);
    if (emoji === "✅") {
        msg.delete();
        guildMember.ban();
    }
    if (emoji === "❌") {
        msg.delete();
    }
});

timeout

const { timeout } = require("modelvnn");

// ví dụ

const messageToDelete = await message.channel.send("Hello There 👋");

timeout(message, messageToDelete, 5000);

Preview

preview


chatBot

const { chatBot } = require("modelvnn");

/** @parameters
 * message, message.channel
 * input, input to give
 */


chatBot(message, args.join(" "));

Preview

preview


tictactoe

//importing
const { tictactoe } = require("modelvnn");

// parameters
/**
 * @name tictactoe
 * @param {Object} options options
 * @param {any} [options.message] parameter used for message event
 * @param {any} [options.player_two] second player in the game.
 */

// start the game

var game = new tictactoe({
    message: message,
    player_two: message.mentions.members.first(),
});

Preview

preview



GiveawayClient

Initialising the client

const Discord = require('discord.js')
const client = new Discord.Client();
const { GiveawayClient } = require("modelvnn");

  /**
   * @name GiveawayClient
   * @kind constructor
   * @param {Client} client
   * @param {Object} options Options
   * @param {String} [options.mongoURI] mongodb connection string
   * @param {String} [options.emoji] emoji for reaction (must be a unicode)
   * @param {String} [options.defaultColor] default colors for giveaway embeds
   * @description Initiating the giveaway client
   */

const giveaway = new GiveawayClient(client, {
  mongoURI?
  emoji?
  defaultColor?
}); //giveaway cần phải có mongoose

module.exports = giveaway;

Methods

start

/**
 * @method
 * @param {Object} options options
 * @param {TextChannel} [options.channel] Channel for the giveaway to be in
 * @param {Number} [options.time] Duration of this giveaway
 * @param {User} [options.hostedBy] Person that hosted the giveaway
 * @param {String} [options.description] Description of the giveaway
 * @param {Number} [options.winners] Amount of winners for the giveaway
 * @param {String} [options.prize] Prize for the  giveaway
 */

end

/**
 * @method
 * @param {String} MessageID Message ID for the giveaway
 * @param {Boolean} getWinner Choose a winner?
 * @description End a giveaway, choose a winner (optional)
 */

reroll

/**
 * @method
 * @param {String} channel channel of the giveaway
 * @param {String} id message id
 * @param {Number} winners amount of winners
 * @description Change the winners for a giveaway!
 */

getCurrentGiveaways

/**
 * @method
 * @param {Boolean} activatedOnly display activated giveaways only?
 * @param {Boolean} all display giveaways of  all guilds?
 * @param {Message} message message if (all = false)
 * @description Get data on current giveaways hosted by the bot
 */

removeCachedGiveaways

/**
 * @method
 * @param {Boolean} all Get data from all guilds?
 * @param {String} guildID guild id if all=false
 * @description Removes (activated = false) giveaways
 */

modelvnnDB

1. Importing the package

const { modelvnnDB } = require("modelvnn");
// or
import { modelvnnDB } from "modelvnn";

2. Establishing and exporting modelvnnDB

const db = new modelvnnDB(client, {
    uri: "link kết nối mongodb của bạn",
});

module.exports = db;

3. Ví dụ về cách sử dụng nó

const db = require("./db.js"); // replace db.js with the file path to modelvnnDB

db.set("numbers", "123");

Methods

.set

// saves data to database
db.set("key", "value");

.get

// gets value from key
db.get("key"); // returns => value

.has

// returns boolean
db.has("key"); // returns => true

.delete

// deletes data
db.delete("key");

// checking for data
db.has("key"); // returns => false

.collection

//returns the cached data
console.log(modelvnnDB.collection())