award-api

0.0.1 • Public • Published

Award | Event Handler

Installation

npm install award-api

Example

const Award = require("award-api");

const awardClient = new Award({
	guild: "SERVER_ID",
	intents: [
      "BOOST",
      "UNBOOST",
      "GIVEAWAY_JOIN",
      "GIVEAWAY_FINISH",
      "GIVEAWAY_REROLL",
      "GIVEAWAY_CREATE",
	] // Join our Discord server to intents list and event names
});

awardClient.on("ready", () => {
	console.log("Connected to Award");
});

awardClient.on("boost", ({ user }) => {
	// You can give a role to the user.
	console.log(`${user.username} boosted our server!`);
});

awardClient.on("unboost", ({ user }) => {
	console.log(`${user.username} remove the boost from server. :(`);
});

awardClient.on("giveawayJoin", ({ user, giveaway }) => {
	console.log(`${user.username} joined the ${giveaway.title} giveaway.`);
});

awardClient.on("giveawayFinish", ({ giveaway, winners }) => {
	console.log(`${giveaway.title} has been ended. Winners: ${winners.map(_w => _w.id).join(",")}`);
});

awardClient.on("giveawayReroll", ({ giveaway, winners }) => {
	console.log(`${giveaway.title} has been rerolled. New Winners: ${winners.map(_w => _w.id).join(",")}`);
});

awardClient.on("giveawayDelete", ({ giveaway })  => {
	console.log(`${giveaway.title} has been deleted.`);
});

Readme

Keywords

Package Sidebar

Install

npm i award-api

Weekly Downloads

1

Version

0.0.1

License

Apache-2.0

Unpacked Size

2.42 kB

Total Files

3

Last publish

Collaborators

  • trker4ktas