Skip to content

Commit

Permalink
v4.1.0
Browse files Browse the repository at this point in the history
V4.1.0
  • Loading branch information
Rahuletto authored Jun 29, 2023
2 parents 6052941 + 73422ca commit e55035b
Show file tree
Hide file tree
Showing 50 changed files with 932 additions and 412 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ node_modules/
# Other
**/*.tgz
test.js
gitpush.sh
gitpush.sh

uglify.js
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ node_modules/
tsconfig.json
simplydjs.ts
test.js
gitpush.sh
gitpush.sh

uglify.js
42 changes: 11 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@

[![Version](https://img.shields.io/npm/v/simply-djs.svg?style=for-the-badge)](https://www.npmjs.com/package/simply-djs)
[![Downloads](https://img.shields.io/npm/dt/simply-djs?style=for-the-badge)](https://www.npmjs.com/package/simply-djs)
[![CodeFactor](https://www.codefactor.io/repository/github/rahuletto/simply-djs/badge/v4.x.x?style=for-the-badge)](https://www.codefactor.io/repository/github/rahuletto/simply-djs/overview/v4.x.x)
[![CodeFactor](https://www.codefactor.io/repository/github/rahuletto/simply-djs/badge?style=for-the-badge)](https://www.codefactor.io/repository/github/rahuletto/simply-djs/overview)

[![Documentation](https://img.shields.io/badge/SimplyDJS-Documentation-406dbc?style=for-the-badge)](https://simplyd.js.org)
[![Support](https://img.shields.io/badge/Discord-Support-5865F2?style=for-the-badge&logo=discord)](https://discord.gg/3JzDV9T5Fn)

[![Support](https://invidget.switchblade.xyz/3JzDV9T5Fn)](https://discord.gg/3JzDV9T5Fn)

</div>

<div align="center">
Expand Down Expand Up @@ -55,35 +53,17 @@ pnpm add simply-djs

# What's new 🎁

### Package 📦

- Converted to DiscordJS v14
- All new `strict` mode.
- Proper Typings and Commenting
- Embeds and Buttons are now customized easily yet making it all yours
- Names that just make sense
- Removed `credit` option
- DEPRECATED many functions. [Refer to docs](https://simplyd.js.org/docs/deprecated/renames/)
- Remade all systems and games (For efficient and optimized results)
- Fixed many many bugs

### Documentation 📖

- Redesigned UI
- Documented every thing possible
- New Examples
- New Outputs
- Very much optimized for every device
- Optimized performance
- Better Search engine.
## v4.1.0

### Typings 🔍
- JSDoc updated !. Now every single function gets intellisense upgrade
- Better optimization
- Tictactoe AI is now baked inbuilt.
- Compressed whole package using "uglify-js"
- Smaller, Lighter yet blazing fast !
- Provided documentation links in all jsdoc options
- More Bug fixes

- Splitted every common types and options
- Unified options
- Better intellisense
- Commented every code
- Options now have documentation JSDoc
- ### (478kb => 301kb) -37% lighter than v4.0.1

---

Expand All @@ -107,4 +87,4 @@ pnpm add simply-djs

# 👥 Contact us/Support

[![Support](https://invidget.switchblade.xyz/3JzDV9T5Fn)](https://discord.gg/3JzDV9T5Fn)
https://discord.gg/3JzDV9T5Fn
21 changes: 20 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "simply-djs",
"version": "4.0.1",
"version": "4.1.0",
"description": "The simplest way to build complex Discord bots.",
"main": "lib/simplydjs.js",
"types": "typings/simplydjs.d.ts",
"typings": "typings",
"scripts": {
"test": "node test",
"git": "sh ./gitpush.sh",
"beta": "npm publish --tag beta",
"prepare": "husky install"
"prepare": "husky install",
"ugly": "tsc && node uglify.js"
},
"keywords": [
"discord",
Expand Down Expand Up @@ -112,6 +113,7 @@
"husky": "^8.0.3",
"openai": "^3.2.1",
"pretty-quick": "^3.1.3",
"typescript": "^5.1.3"
"typescript": "^5.1.3",
"uglify-js": "^3.17.4"
}
}
82 changes: 48 additions & 34 deletions simplydjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,49 +45,63 @@ if (Number(discordJSVersion.slice(0, 2)) < 14)
// ------- E X P O R T S --------
// ------------------------------

export const version: string = '4.0.0';
export const version: string = '4.1.0';

export * from './src/misc';
export * from './src/typedef';
export {
https,
ms,
disableButtons,
emitError,
toButtonStyle,
toRgb
} from './src/misc';
export {
CustomizableButton,
CustomizableEmbed,
ExtendedButtonStyle,
ExtendedInteraction,
ExtendedMessage
} from './src/typedef';

export * from './src/meme';
export * from './src/betterBtnRole';
export * from './src/btnRole';
export * from './src/bumpReminder';
export * from './src/calculator';
export * from './src/connect';
export * from './src/chatbot';
export * from './src/embedCreator';
export * from './src/buttonPages';
export * from './src/ghostPing';
export * from './src/giveaway';
export * from './src/menuPages';
export * from './src/rps';
export * from './src/starboard';
export * from './src/suggest';
export * from './src/ticketSetup';
export * from './src/tictactoe';
export { meme } from './src/meme';
export { betterBtnRole } from './src/betterBtnRole';
export { btnRole } from './src/btnRole';
export { bumpReminder } from './src/bumpReminder';
export { calculator } from './src/calculator';
export { connect } from './src/connect';
export { chatbot } from './src/chatbot';
export { embedCreator } from './src/embedCreator';
export { buttonPages } from './src/buttonPages';
export { ghostPing } from './src/ghostPing';
export { giveaway } from './src/giveaway';
export { menuPages } from './src/menuPages';
export { rps } from './src/rps';
export { starboard } from './src/starboard';
export { suggest } from './src/suggest';
export { ticketSetup } from './src/ticketSetup';
export { tictactoe } from './src/tictactoe';

// ------------------------------
// ------ H A N D L E R S -------
// ------------------------------

export * from './src/handler/manageBtnRole';
export * from './src/handler/manageGiveaway';
export * from './src/handler/manageTicket';
export * from './src/handler/manageSuggest';
export { manageBtnRole } from './src/handler/manageBtnRole';
export { manageGiveaway } from './src/handler/manageGiveaway';
export { manageTicket } from './src/handler/manageTicket';
export { manageSuggest } from './src/handler/manageSuggest';

// ------------------------------
// ---- D E P R E C A T E D -----
// ------------------------------

export * from './src/deprecated/DEP-stealEmoji';
export * from './src/deprecated/DEP-bumpSystem';
export * from './src/deprecated/DEP-embedPages';
export * from './src/deprecated/DEP-ticketSystem';
export * from './src/deprecated/DEP-suggestSystem';
export * from './src/deprecated/DEP-embedCreate';
export * from './src/deprecated/DEP-giveawaySystem';
export * from './src/deprecated/DEP-manageBtn';
export * from './src/deprecated/DEP-manageSug';
export * from './src/deprecated/DEP-nqn';
export { automeme } from './src/deprecated/DEP-automeme';
export { bumpSystem } from './src/deprecated/DEP-bumpSystem';
export { embedCreate } from './src/deprecated/DEP-embedCreate';
export { embedPages } from './src/deprecated/DEP-embedPages';
export { giveawaySystem } from './src/deprecated/DEP-giveawaySystem';
export { manageBtn } from './src/deprecated/DEP-manageBtn';
export { manageSug } from './src/deprecated/DEP-manageSug';
export { nqn } from './src/deprecated/DEP-nqn';
export { stealEmoji } from './src/deprecated/DEP-stealEmoji';
export { suggestSystem } from './src/deprecated/DEP-suggestSystem';
export { ticketSystem } from './src/deprecated/DEP-ticketSystem';
17 changes: 12 additions & 5 deletions src/betterBtnRole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,18 @@ export type betterbtnOptions = {
// ------------------------------

/**
* A **Button Role builder** that lets **admins create** button roles. | *Requires: [**manageBtnRole()**](https://simplyd.js.org/docs/handler/manageBtnRole)*
* @param interaction
* @param options
* @link `Documentation:` https://simplyd.js.org/docs/systems/betterBtnRole
* @example simplydjs.betterBtnRole(client, interaction)
* ## betterBtnRole
* ### A **Button Role builder** that lets **admins create** button roles. | *Requires: [**manageBtnRole()**](https://simplyd.js.org/docs/handler/manageBtnRole)*
*
* @async
* @param {ExtendedInteraction} interaction [`ExtendedInteraction`](https://simplyd.js.org/docs/typedef/extendedinteraction)
* @param {betterbtnOptions} options [`betterbtnOptions`](https://simplyd.js.org/docs/systems/betterbtnrole#betterbtnoptions)
* @returns {Promise<void>} `void`
*
* ---
*
* @link [`Documentation`](https://simplyd.js.org/docs/systems/betterBtnRole)
* @example simplydjs.betterBtnRole(interaction)
*/

export async function betterBtnRole(
Expand Down
29 changes: 18 additions & 11 deletions src/btnRole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,22 @@ export type btnRoleOptions = {
// ------------------------------

/**
* A **Button Role System** that lets you create button roles with your own message. | *Requires: [**manageBtnRole()**](https://simplyd.js.org/docs/handler/manageBtnRole)*
* @param msgOrInt
* @param options
* @link `Documentation:` https://simplyd.js.org/docs/general/btnRole
* ## btnRole
* ### A **Button Role System** that lets you create button roles with your own message. | *Requires: [**manageBtnRole()**](https://simplyd.js.org/docs/handler/manageBtnRole)*
*
* @async
* @param {ExtendedMessage|ExtendedInteraction} msgOrint [`ExtendedMessage`](https://simplyd.js.org/docs/typedef/extendedmessage) | [`ExtendedInteraction`](https://simplyd.js.org/docs/typedef/extendedinteraction)
* @param {btnRoleOptions} options [`btnRoleOptions`](https://simplyd.js.org/docs/general/btnrole#btnroleoptions)
* @returns {Promise<boolean>} `boolean`
*
*
* ---
*
* @link [`Documentation`](https://simplyd.js.org/docs/general/btnRole)
* @example simplydjs.btnRole(message, { data: [{...}] })
*/

export async function btnRole(
msgOrInt: ExtendedMessage | ExtendedInteraction,
msgOrint: ExtendedMessage | ExtendedInteraction,
options: btnRoleOptions = { strict: false }
): Promise<boolean> {
return new Promise(async (resolve) => {
Expand All @@ -74,10 +81,10 @@ export async function btnRole(
);
}

const extMessage = msgOrInt as ExtendedMessage;
const extInteraction = msgOrInt as ExtendedInteraction;
const extMessage = msgOrint as ExtendedMessage;
const extInteraction = msgOrint as ExtendedInteraction;

if (msgOrInt.commandId) {
if (msgOrint.commandId) {
if (!extInteraction.deferred)
await extInteraction.deferReply({ fetchReply: true });

Expand All @@ -90,7 +97,7 @@ export async function btnRole(
content: 'You need `ADMINISTRATOR` permission to use this command'
});
return;
} else if (!msgOrInt.customId) {
} else if (!msgOrint.customId) {
if (
!extMessage.member.permissions.has(PermissionFlagsBits.Administrator)
)
Expand Down Expand Up @@ -147,7 +154,7 @@ export async function btnRole(

if (color as string) color = toButtonStyle(color as string);

const role: Role | null = msgOrInt.guild.roles.cache.find(
const role: Role | null = msgOrint.guild.roles.cache.find(
(r) =>
r.id ===
((data[i].role as Role)?.id
Expand Down
19 changes: 13 additions & 6 deletions src/bumpReminder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,27 @@ export type bumpOptions = {
// ------------------------------

/**
* A Very cool bump reminder system that reminds when a bump is necessary [Only Disboard].
* ## bumpReminder
* ### A Very cool bump reminder system that reminds when a bump is necessary [Only Disboard].
*
* **Requires you to have this in `messageCreate` and `ready` event**
* @param client
* @param message
* @param options
* @link `Documentation:` https://simplyd.js.org/docs/systems/bumpReminder
*
* @async
* @param {Client} client
* @param {Message|bumpOptions} message `Message` | [`bumpOptions`](https://simplyd.js.org/docs/systems/bumpreminder#bumpoptions)
* @param {bumpOptions} options [`bumpOptions`](https://simplyd.js.org/docs/systems/bumpreminder#bumpoptions)
* @returns {Promise<boolean>} `boolean`
*
* ---
*
* @link [`Documentation`](https://simplyd.js.org/docs/systems/bumpReminder)
* @example simplydjs.bumpReminder(client, message)
*/

export async function bumpReminder(
client: Client,
message: Message | bumpOptions,
options: bumpOptions
options?: bumpOptions
): Promise<boolean> {
try {
if (!options && message) options = message as bumpOptions;
Expand Down
Loading

0 comments on commit e55035b

Please sign in to comment.