1.2.0 • Published 3 years ago

discord.giveawayclient v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Jettherobot

A simple giveaway npm to enhace the functions of your bot.

Installation

First install Node.js. And discord.js Then:

npm install npm-discord-giveclient

Initializing

// Using Node.js `require()`
const giveawayclient = require("discord.giveawayclient");

// Using ES6 imports
import giveawayclient from "discord.giveawayclient";

🙋‍ Support

Feel free to join my discord server -> https://discord.gg/vZj4CfDXEG


Initialising the Giveaway Client

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

  /**
   * @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? // Mogodb connection string
  emoji? // Default giveaway reaction emoji
  defaultColor? // Default giveaway embed colour
});

module.exports = giveaway;

Giveaway Client 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
 */