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-probot-transfer

v0.0.9

Published

check when any member transfer probot credit to spefic owner(s) or members, collected system & special event

Downloads

985

Readme

Discord-probot-transfer

Installation

Install discord-probot-transfer

$ npm install discord-probot-transfer

Install discord.js

$ npm install discord.js

Features

  • Simple & easy to use 🎗️
  • Support All probot language 🔗
  • Support discord.js version 12 & 13 & 14 🔖
  • Easy setup & setting for each server ⚙️
  • Edit & Get any data with simple function ⛏️
  • Returns full data of transfer 📡
  • Event & Collection system 🔗

Note !

  • nodeJs v16 <=

Getting Started

At first install the discord-probot-transfer package

const { Client, Intents } = require("discord.js"); // npm i discord.js
const client = new Client({
  intents: [
    Intents.FLAGS.GUILDS,
    Intents.FLAGS.GUILD_MESSAGES,
    Intents.FLAGS.GUILD_MEMBERS,
  ],
});

const { Probot } = require("discord-probot-transfer"); // npm i discord-probot-transfer
/// Important !
client.probot = Probot(client, {
  fetchGuilds: true, // enable event for all bot guilds
  data: [
    // server setting.
    {
      fetchMembers: true, // enable event for all guild member, not only the owner(s)
      guildId: "828240195236266005",
      probotId: "567703512763334685",
      owners: ["496941648576643092"],
    },
  ],
});

client.on("ready", () => console.log("Ready"));

// event.
client.probot.on("transfered", (guild, data, err) => {
  //
  if (err) return console.log(err);
  //
  var { member, price, receiver, isOwner, fullPrice, channel } = data;
  //
  /* What you can do? let's see. */

  member.send(`> Thanks for your donate, \`${price}\`.`); // send message to member
  //
  guild.channel.send(`> ${member.user}, Thanks for your donate \`${price}\``); // send message in same channel (guild.channel or channel)
  //

  guild.channels.cache
    .get("id")
    .send(
      `> ${member.user} transfer \`${price}\` to ${receiver.user} in channel ${guild.channel}`
    ); // send message to specific channel
  //
  member.roles.add("id"); // add role(s) to member
  //
  member.roles.remove("id"); // remove role(s) from member
  //
  // add role(s) for member when price is 40000 **
  if (price == "40000") {
    member.roles.add("id");
  }
  // add role(s) for member when the receiption is owner
  if (isOwner) {
    member.roles.add("id");
  }
  // send file when transfer in specific channel
  if (guild.channel.id == "id") {
    guild.channel.send({ files: ["<Buffer | Link>"] });
  }
  //
});

// messageCreate when your djs version is 13.
client.on("message", async (message) => {
  var args = message.content.split(/ +/);
  if (message.content == "buy") {
    if (client.probot.check(message))
      return message.channel.send(` you already have an order !`);
    message.channel.send(
      "> Hello, \nyou have 5 minute for transfer `$5264` to owners."
    );

    var check = await client.probot.collect(message, {
      probotId: `567703512763334685`,
      owners: ["496941648576643092"],
      time: 1000 * 60 * 5, // 5 min
      userId: message.author.id, // when you not specify the user, return full collection for first transfer in main channel.
      price: 5000,
      fullPrice: true, // member must send the price with tax
    });
    if (check.status) {
      return message.channel.send(
        `> Thanks for your donate ${check.member},  ${check.priceTransfered}.`
      );
    } else if (check.error) {
      return message.channel.send(`> ${check.error.message} 😢`);
    } else {
      return message.channel.send(`> Required credit: ${check.priceRequired},
      you transfered: ${check.fullPrice}, 
      i got: ${check.priceTransfered},
      retry and transfer ${check.priceTotal}`);
    }
  } else if (args[0] == "tax") {
    if (!args[1]) return;
    var price = client.probot.tax(args[1]);
    message.channel.send(`${price.amount} => ${price.withTax}`);
  }
});

// More functions.
client.probot.getData(); // to get all data setup
client.probot.create({ guildId, probotId, owners, fetchMembers }); // create new data for server
client.probot.edit("guildId", { probotId, owners, fetchMembers }); // edit data for specific server
client.probot.delete("guildId"); // delele server data

// for use only tax
const { tax } = require("discord-probot-transfer");
console.log(tax("5000").withTax); // number with tax.

Thanks. Support.