Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tfagaming/aqify.js

The Utility & Fun package that takes you to a whole new level.
https://github.com/tfagaming/aqify.js

Last synced: about 5 hours ago
JSON representation

The Utility & Fun package that takes you to a whole new level.

Awesome Lists containing this project

README

        



The Utility & Fun package that takes you to a whole new level.
















# 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

- [Aqify.js](#aqifyjs)
- [Features](#features)
- [Table of contents](#table-of-contents)
- [Install](#install)
- [Import](#import)
- [Docs](#docs)
- [Examples](#examples)
- [Dropdown paginator](#dropdown-paginator)
- [Buttons paginator](#buttons-paginator)
- [Buttons confirm (Yes/No/Cancel)](#buttons-confirm-yesnocancel)
- [Dropdown roles](#dropdown-roles)
- [YouTube API Manager](#youtube-api-manager)
- [Plugins](#plugins)
- [License](#license)

## Install
Before installing the package, please make sure that you have the following requirements below:
- [axios](https://npmjs.com/package/axios) v^latest.
- [discord.js](https://npmjs.com/package/discord.js) v^14.11.0.
- [@discordjs/voice](https://npmjs.com/package/@discordjs/voice) v^latest.
- [Node.js](https://nodejs.org/en/download) v^16.9.0.

If you meet the requirements above, you can install the package safely with no problems:
```sh-session
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:
```ts
import { } from 'aqify.js';
```

JavaScript (CommonJS):
```js
const { } = require('aqify.js');
```

[↑ Table of Contents](#table-of-contents)

## Docs
Visit the documentation website: [Click here!](https://tfagaming.github.io/Aqify.js)

## Examples
### Dropdown paginator

```ts
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](#table-of-contents)

### Buttons paginator
```ts
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](#table-of-contents)

### Buttons confirm (Yes/No/Cancel)
```ts
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](#table-of-contents)

### Dropdown roles
```ts
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](#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.

```ts
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](#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.
> ```ts
> .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.

```ts
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](#table-of-contents)

Read the docs to get all the information about other classes/functions/variables! [Click here](https://tfagaming.github.io/Aqify.js/)

## Developers
- [TFAGaming](https://github.com/TFAGaming)

## License
[**GPL-3.0**](https://www.gnu.org/licenses/gpl-3.0.en.html); General Public License v3.0.

Join our Discord server if you need any help!



#### © 2023, Aqify.js