Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amir-78/djs-helper
djs-helper is a JavaScript library that helps you to develop your own Discord Bot, Still under development, more features will be added in the future
https://github.com/amir-78/djs-helper
discord discord-js djs djs-helper djs-v13 javascript nodejs npm
Last synced: about 2 months ago
JSON representation
djs-helper is a JavaScript library that helps you to develop your own Discord Bot, Still under development, more features will be added in the future
- Host: GitHub
- URL: https://github.com/amir-78/djs-helper
- Owner: Amir-78
- License: mit
- Created: 2022-05-13T20:17:10.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-09-20T11:29:55.000Z (over 2 years ago)
- Last Synced: 2024-11-17T04:37:41.537Z (about 2 months ago)
- Topics: discord, discord-js, djs, djs-helper, djs-v13, javascript, nodejs, npm
- Language: JavaScript
- Homepage:
- Size: 56.6 KB
- Stars: 3
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# djs-helper
**djs-helper** is a JavaScript library that helps you to develop your own Discord Bot, **Still under development, more features will be added in the future**## Installation
- Download [Node.js](https://nodejs.org)
- Write in CMD / Terminal:
```bash
npm i djs-helper
```
## Example Code:```javascript
const { Client, Intents, MessageEmbed } = require('discord.js');
const DjsH = require('djs-helper');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});client.on('messageCreate', async (message) => {
if (!message.guild) return;
if (message.startsWith('!extract-emojis')) {
let emojis = DjsH.matchEmojis(message.content, true);
if (emojis.length === 0) {
let embed = new MessageEmbed()
.setTitle("Extract Emojis")
.setDescription(":x: No emoji found!")
.setColor(DjsH.Colors.HEX.Red)
return message.reply({ embeds: [embed] });
} else {
let embed = new MessageEmbed()
.setTitle("Extract Emojis")
.setDescription(`Emojis found: \`${emojis.join(',')}\``)
.setColor(DjsH.Colors.HEX.Aqua)
message.reply({ embeds: [embed] });
}
}
});client.login('token');
```## Documentation
### Functions:**Name** | **Params** | **Type** | **Function** | **Returns**
---------------|-----------------------|--------------------|------------------------|------------------------------------------------------------------------------------
matchId() | `content` | `String` | `Extract All Discord IDs from content` | `Array`
matchEmojis() | `content`,`unicode` | `String`,`Boolean` | `Extract All Discord Emojis from content, If` **unicode** `is` **true** `it will return Unicode emojis too`| `Array`
isInvite() | `content` | `String` | `Checks if content contains Discord Invites`| `Boolean`
isURL() | `content`,`whitelist` | `String`,`Array` | `Checks if content contains URLs`| `Boolean`
splitMessage() | `content`,`max` | `String`,`Number` | `Split string every` max `default: 2000 max`| `Array`
await getMember() | `guild`,`userID` | `Object`,`String` | `Get member from guild using ID`| `Object`/`null`
await guildsCount() | `client` | `Object (Discord.Client())` | `Get client guilds count (Supports Sharding)`| `Number`
await usersCount() | `client` | `Object (Discord.Client())` | `Get client users count (Supports Sharding)` | `Number`
await channelsCount() | `client` | `Object (Discord.Client())` | `Get client channels count (Supports Sharding)`| `Number`
await getUser() | `client`,`userID` | `Object (Discord.Client())`,`String` | `Get user using ID`| `Object`/`null`| `Object`/`null`
[await Inviter()](https://github.com/Amir-78/djs-helper/blob/master/examples/Inviter.md#await-inviter) | `client`,`member` | `Object (Discord.Client())`,`Object (GuildMember)` | `Get used invite`| `Object`
### Utils:Name | Function | Usage
--------|---------------------|------------------------------------------
Colors | Contains all colors | to Show all colors: `console.log(Colors.HEX)`## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.