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

aoi.js-plugins

v1.6.2

Published

A Package with plugins for aoi.js

Downloads

48

Readme

Aoi.js Plugins!

Requires Node V16+

Downloading:

npm i aoi.js-plugins@latest

Options:

  • Giveaways
  • Command Handler
  • Dashboard (Discord Oauth help.)

Handler

Usage:

const aoijs = require("aoi.js");
const { Handler } = require("aoi.js-plugins");

const bot = new aoijs.Bot({
token: "your very secret token", //Discord Bot Token
prefix: "abcdefg", //Discord Bot Prefix
intents: "all" //Discord Intents
});

const handler = new Handler({
  bot:bot,// your bot client. (required)
  aoijs:aoijs,// aoi.js variable you have defined as. (required)
  varfile:"vars.js",//variables file.
  callbackfile:"callbacks.js",//callbacks file.
  commandsfolder:"/commands/",//commands folder.
  statusfolder:"/status/"//statuses folder.
})

vars.js:

module.exports = {
  hello:"Hi",
  ok:"ok indeed"
}

callbacks.js:

module.exports = (bot) => {
  bot.onMessage();
  bot.onInteractionCreate();
}

status folder: status1.js:

module.exports=({
  text:"Hello World!",
  type:"PLAYING",
  time:"12"
})

status2.js:

module.exports=({
  text:"with Bumblebee!",
  type:"PLAYING",
  time:"12"
})

and so on...

Dashboard

Useage:

const { Dash }=require("aoi.js-plugins")

const dash = new Dash({
  bot:bot,//your bot
  clientID:"943831369832861746",//client id
  clientSecret:process.env.s,//client secret
  redirectURI:"https://example.com/callback"//redirect uri
  //see example dashboard for more info! https://github.com/Bumblebee-3/Aoi.js-dashboard-with-aoi.js-plugins
  
})

Functions Till Now:

All these are Dash functions. (needs to be awaited)

  • generateURL()=> create a login link for the bot.
  • getAccessToken(code)=> from the code getting the user access token.
  • getUser(accesstoken) => Getting basic details of the user.
  • getGuilds(accesstoken)=> Getting users guilds.
  • getAdminGuilds(accesstoken)=> Getting Guilds where the user is admin.
  • getCommonAdminGuilds(accesstoken)=> Getting guilds where user is admin and bot is there.

This dashboard extension was made with help of "Discord-oauth2" to make the creation of dashboards easier for all.

Example dashboard: here

For more inermediate developers, who want to use more functions of discord-oauth2 with aoi.js-plugins you can use this

const oauth = dash.oauth

and with that using discord-oauth2 callbacks.

Giveaways:

const { Giveaways } = require("./plugins.js")

const aoijs = require("aoi.js");


const bot = new aoijs.Bot({
  token:"your token",
  prefix:"your prefix",
  intents:"all"
})

Constructor:

let gm = new Giveaways({
  client:bot,//Your aoi.js client
  storage:"storage.json",//storage file
  botsCanWin:false,//can bots win?
  embedColor: '#FF0000',//giveaway embed color
  reaction: '🎉',//giveaway reaction emoji
  embedColorEnd: '#000000',//ended giveaway message embed color.
  reaction: '🎉',//reaction to join the giveaway.
  dmWinMessage:"Congratulations, {member.username}!! You won {prize}. Link:{link}",//message dmed to the winner on giveaway completion
  dmJoinMessage:"Hey {member.username} || <@{member.id}>!! You seemed to have joined the giveaway for {prize}. All the best! Link:{link}",//message dmed to member on joining the giveaway
  dmLeaveMessage:"Hey {member.username}!! You seemed to have left the giveaway for {prize}. Link:{link}. If this wasn't you, please re-add your reaction!",//message dmed to member on leaving the giveaway/reaction being removed.
  startMessages:{
    giveaway:"🎉🎉 **NEW GIVEAWAY** 🎉🎉",//the message above the embed on giveaway start
    giveawayEnded:"🎉🎉 **GIVEAWAY ENDED** 🎉🎉",//the message above the embed on giveaway end
    inviteToParticipate:"React with 🎉 to participate!",//inviting to participate
    winMessage:"Congratulations, {winners}! You won **{this.prize}**!\n{this.messageURL}",//on winning the message to send.
    drawing:"Ending: {timestamp}",//picking winners in {timestamp}
    embedFooter:"{this.winnerCount} winner(s)",//footer of the giveaway
    noWinner:"Giveaway cancelled, no valid participations. ",//when no winners are there
    winners:"Winner(s):",//winner count
    endedAt:"Ended at",//on giveaway end, shows what time the giveaway ended at
    hostedBy:"Hosted by: {this.hostedBy}"//hosted by {this.hostedBy}
  },
  lastChance:{
    enabled:true,//is lastchance enabled?
    content:"⚠️ **LAST CHANCE TO ENTER !** ⚠️",//last chance content 
    threshold:"30s",//time before the giveaway that it should get edited
    embedColor:"#FF0000"//embed color
  }
})


gm.loadFuncs()//loading the cutom functions.

Currently all params are needed!

Options in DM message:

  • {member.username} => User's username.
  • {member.id} => User's ID.
  • {prize} => prize of the giveaway.
  • {link} => Link of the giveaway.

FUNCTIONS TILL NOW:

  1. $Gstart[<time>;<winners>;<prize>;<channelid>;<hostid>] => Start the giveaway.

Parameters:

  • time: Time of the giveaway. For example: 30s, 1m, 1h, e.t.c.

  • winners: Number of winners. For example: 1,2,7, e.t.c.

  • prize: Prize of the giveaway. For example: Discord Nitro $9.99, XBOX game pass ultimate, e.t.c.

  • channelid: ID of the channel where the giveaway has to be hosted.

  • hostid: ID of the giveaway host.

  1. $Greroll[<messageid>;<winners>] => Reroll a giveaway (new winners).

Parameters:

  • messageid: Message id of the giveaway to reroll.

  • winners: Number of winners to reroll. For example: 1,2,7, e.t.c.

  1. $Gedit[<messageid>;<property>;<data>] => Edit a giveaway.

Parameters:

  • messageid: Message id of the giveaway to edit.

  • property: Property of the giveaway. For example: prize , winners , time .

  • data: Data depends on the property.

If property is prize then data needs to be a string [prize name].

If property is winners then data needs to be a integer [number of winners].

If property is time then data needs to be string [time i.e. 10s, 1d , -10m(to remove time)].

  1. $Gdelete[<messageid>] => Delete a giveaway.

Parameters:

  • messageid: Message id of the giveaway to delete.
  1. $Gpause[<messageid>] => Pause a giveaway.

Parameters:

  • messageid: Message id of the giveaway to pause.
  1. $GUnpause[<messageid>] => Unpause a giveaway.

Parameters:

  • messageid: Message id of the giveaway to unpause.
  1. $isGiveaway[messageid] => If the message id is a giveaway.

Parameters:

  • messageid: Message id of to check if it is a giveaway.
  1. $isActiveGiveaway[messageid] => If the message id is an active [going on currently] giveaway.

Parameters:

  • messageid: Message id of to check if it is a active giveaway.

Note:

If using $Gstart [Giveaways], The packace automaticaly ends the process. If using replit, use: .replit with

run="while true; do node index.js; sleep 2; done"