2.5.0 • Published 9 months ago

aqify.js v2.5.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
9 months ago

Aqify.js

Aqify.js is an open-source utility package made for Discord bots, it has a lot of features and they are simplified at the maximum for everyone!

This package is not affiliated with Discord or/and discord.js.

Features

  • 100% written in TypeScript.
  • Full support for TypeScript and JavaScript.
  • Simple to use & Beginner friendly.
  • Open-source & free to use.
  • No credits required while using it!
  • All possible bugs are eliminated from the source-code.
  • Promise based.

Table of Contents

Install

Before installing the package, please make sure that you have the following requirements below:

If you meet the requirements above, you can install the package safely with no problems:

npm install aqify.js
yarn add aqify.js
pnpm add aqify.js

Other packages:

  • @tfagaming/discord.js-docs: Easy method to fetch discord.js docs.
  • @tfagaming/jsondb: Create a simple JSON database.
  • horizon-handler: A powerful commands & events handler for Discord bots.
  • wandbox-api.js: An unofficial wrapper for Wandbox API (API Compiler).

Import

Typescript:

import { } from 'aqify.js';

JavaScript (CommonJS):

const { } = require('aqify.js');

↑ Table of Contents

Docs

Visit the documentation website: Click here!

Examples

Dropdown paginator

import { EmbedBuilder, StringSelectMenuBuilder } from 'discord.js'; 
import { DropdownPaginatorBuilder, SendMethod } from 'aqify.js';

const paginator = new DropdownPaginatorBuilder(interaction, { time: 60000 });

paginator.addOptions(
    {
        component: {
            label: 'Option 1',
            description: 'Option 1 description'
        },
        message: {
            content: 'This is the option 1 message!'
        }
    },
    {
        component: {
            label: 'Option 2',
            emoji: '✌'
        },
        message: {
            content: 'This is the option 2 message!',
            embeds: [
                new EmbedBuilder()
                    .setDescription('Option 2 embed!')
            ]
        }
    }
);

await paginator.send(SendMethod.Reply,
    new StringSelectMenuBuilder()
        .setCustomId('your_epic_custom_id')
        .setPlaceHolder('Make a selection'), {
    home: {
        content: 'Select something from the menu below!'
    },
    onNotAuthor: async (i) => {
        await i.reply({
            content: 'You are not the author of this interaction.',
            ephemeral: true
        });
    },
    replyWithEphemeralMessage: true
});

↑ Table of Contents

Buttons paginator

import { ButtonStyle } from 'discord.js'; 
import { ButtonsPaginatorBuilder, ButtonPaginatorID, SendMethod } from 'aqify.js';

const paginator = new ButtonsPaginatorBuilder(interaction, {
    time: 60000
});

paginator.addButtons(
    { label: 'Previous',id: ButtonPaginatorID.Previous, type: ButtonStyle.Secondary },
    { label: 'Next', id: ButtonPaginatorID.Next, type: ButtonStyle.Secondary },
    { label: 'Delete', id: ButtonPaginatorID.Delete, type: ButtonStyle.Danger }
);

paginator.addPages(
    { content: 'Page 1' },
    { content: 'Page 2', embeds: [] },
    { content: 'Page 3' },
    { content: 'Page 4', files: [] },
    { content: 'Page 5' }
);

await paginator.send(SendMethod.Reply, {
    onNotAuthor: async (i) => {
        await i.reply({
            content: 'You are not the author of this interaction.',
            ephemeral: true
        });
    },
    disableButtonsOnLastAndFirstPage: true
});

↑ Table of Contents

Buttons confirm (Yes/No/Cancel)

import { ButtonBuilder, ButtonStyle } from 'discord.js'; 
import { ButtonsConfirmBuilder, ButtonConfirmID, SendMethod } from 'aqify.js';

const confirm = new ButtonsConfirmBuilder(interaction, {
    buttons: [
        new ButtonBuilder()
            .setCustomId(ButtonConfirmID.Yes)
            .setLabel('Yes')
            .setStyle(ButtonStyle.Primary),
        new ButtonBuilder()
            .setCustomId(ButtonConfirmID.No)
            .setLabel('No')
            .setStyle(ButtonStyle.Danger)
    ],
    on: {
        yes: async (i) => {
            await i.reply({ content: 'Yes button blocked!' });
        },
        no: async (i) => {
            await i.reply({ content: 'No button clicked!' });
        }
    },
    time: 30000
});

await confirm.send(SendMethod.Reply, {
    home: {
        content: 'Click on Yes or No below!'
    },
    onNotAuthor: async (i) => {
        await i.reply({
            content: 'You are not the author of this interaction.',
            ephemeral: true
        });
    },
    disableButtonsOnEnd: true
});

↑ Table of Contents

Dropdown roles

import { DropdownRolesBuilder } from 'aqify.js';
import { StringSelectMenuBuilder } from 'discord.js';

const menu = new DropdownRolesBuilder(client, [
    {
        roleId: '123456789012345',
        component: { label: 'Role 1' }
    },
    {
        roleId: '123456789012345',
        component: { label: 'Role 2' }
    }
], {
    on: {
        roleAdded: {
            content: (role) => `You have got the role **${role.name}**!`
        },
        roleRemoved: {
            content: (role) => `I have removed the role **${role.name}** from you!`
        }
    }
});

await menu.create(interaction.channelId,
    new StringSelectMenuBuilder()
        .setCustomId('your_epic_custom_id')
        .setPlaceholder('Select a role'),
    {
        message: {
            content: 'Select a role here by clicking on the menu below!'
        }
    }
);     

↑ Table of Contents

YouTube API Manager

Warning: This is a simple manager made for Discord bot commands such as YouTube video/channel statistics command, and not for advanced ones like playlists, watermarks... etc.

import { YouTubeAPIManager } from 'aqify.js';

const manager = new YouTubeAPIManager('Your YouTube API key');

await manager.searchVideos('How to make a Discord bot', { maxResults: 3 });
await manager.searchChannels('T.F.A 7524');

await manager.getVideo('A YouTube video ID');
await manager.getChannel('A YouTube channel ID');

↑ Table of Contents

Plugins

1st Note: It's recommended to use these plugins in the event ready from the client to make sure that the bot is on and ready to use.

<client>.on('ready', () => {
    new Plugin();
});

2nd Note: If you want to edit the messages from one of the plugins, go to node_modules/aqify.js/class/plugins.js, and then find the class which you want to edit.

import * as AqifyJS from 'aqify.js';

new AqifyJS.ModmailPlugin(client, {
    guild: 'Your server ID',
    parent: 'The mails category ID',
    managerRoles: ['Staff role ID']
});

new AqifyJS.TicketPlugin(client, {
    guild: 'Your server ID',
    parent: 'The tickets category ID',
    managerRoles: ['Staff role ID']
}).createPanel('The panel channel ID');

new AqifyJS.BoostDetectorPlugin(client)
    .on('boostCreate', (member) => console.log(member.user.tag + ' has boosted the server!'))
    .on('boostRemove', (member) => console.log(member.user.tag + ' has unboosted the server...'));

new AqifyJS.SuggestionPlugin(client, 'Suggestion channel ID', {
    message: {
        content: (message) => `<@${message.author.id}>`,
        embeds: (message) => [
            new EmbedBuilder()
                .setTitle('New suggestion!')
                .setAuthor({
                    name: message.author.tag,
                    iconURL: message.author.displayAvatarURL()
                })
                .setDescription(message.content)
                .setColor('Blurple')
        ]
    },
    reactions: ['👍', '👎']
});

↑ Table of Contents

Read the docs to get all the information about other classes/functions/variables! Click here

Developers

License

GPL-3.0; General Public License v3.0.

Join our Discord server if you need any help!

© 2023, Aqify.js

2.2.0

10 months ago

2.4.1

9 months ago

2.4.0

9 months ago

2.4.3

9 months ago

2.4.2

9 months ago

2.4.0-pre-2

9 months ago

2.4.0-pre-1

9 months ago

2.4.0-pre-3

9 months ago

2.3.0

10 months ago

2.5.0

9 months ago

2.0.3

10 months ago

2.0.2

10 months ago

2.0.1

10 months ago

2.0.0

10 months ago

2.1.0-pre

10 months ago

2.0.0-pre-1

10 months ago

2.1.2

10 months ago

2.1.1

10 months ago

2.1.0

10 months ago

1.9.0-pre-2

10 months ago

1.9.0-pre-1

10 months ago

1.9.1

10 months ago

1.9.0

10 months ago

1.8.5

11 months ago

1.8.4

11 months ago

1.8.3

11 months ago

1.8.2

11 months ago

1.8.1

11 months ago

1.8.0

11 months ago

1.7.4

11 months ago

1.7.3

11 months ago

1.7.2

11 months ago

1.7.1

11 months ago

1.7.0

11 months ago

1.6.4

11 months ago

1.6.3

11 months ago

1.6.2

11 months ago

1.6.1

11 months ago

1.6.0

11 months ago

1.5.5

11 months ago

1.5.4

11 months ago

1.5.3

11 months ago

1.5.2

11 months ago

1.5.1

11 months ago

1.5.0

11 months ago

1.4.6

11 months ago

1.4.5

11 months ago

1.4.4

11 months ago

1.4.3

11 months ago

1.4.2

11 months ago

1.4.1

11 months ago

1.4.0

11 months ago

1.3.4

11 months ago

1.3.3

11 months ago

1.3.2

11 months ago

1.3.1

11 months ago

1.3.0

11 months ago

1.2.11

11 months ago

1.2.10

11 months ago

1.2.9

11 months ago

1.2.8

11 months ago

1.2.6

11 months ago

1.2.5

11 months ago

1.2.4

11 months ago

1.2.3

11 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.2.0

11 months ago

1.1.0

11 months ago

1.0.0

11 months ago

0.2.0

11 months ago

0.1.0

11 months ago