djs-helper is a JavaScript library that helps you to develop your own Discord Bot

Overview

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

npm version npm downloads
  • Download Node.js
  • Write in CMD / Terminal:
npm i djs-helper

Example Code:

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
guildsCount() client Object (Discord.Client()) Get client guilds count (Supports Sharding) Number
usersCount() client Object (Discord.Client()) Get client users count (Supports Sharding) Number
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
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.

You might also like...

Colour me! is a simple Discord bot running on Cloudflare Workers that allows server admins to give users the ability to change the colour of their own assigned colour roles!

Colour me! Colour me! is a simple Discord bot that allows server admins to give users the ability to change the colour of their own assigned colour ro

Dec 24, 2022

Co-Pilot is a discord Bot designed to be the all-in-one, open-source Discord bot that handles all your server needs.

Co-Pilot is a discord Bot designed to be the all-in-one, open-source Discord bot that handles all your server needs.

Welcome to Co-Pilot Bot repo! 👋 🤖 Co-Pilot (All-in-one Discord Bot) Co-Pilot is a discord Bot designed to be the all-in-one, open-source Discord bot

Nov 11, 2022

Aeona is a multi-purpose discord bot ready to skill up and boost up your Discord server! It has an State of the Art AI chatbot to make sure you never feel bored!

Aeona | Chatbot Aeona is an ever-growing multipurpose bot; primarily a fun chatbot you can converse with, but also showcases a wide range of fun comma

Jan 9, 2023

A simple & easy2use API for obtaining information about a discord user, discord bot or discord guild and their use for some purpose on websites!

discord-web-api A simple & easy2use API for obtaining information about a discord user, discord bot or discord guild and their use for some purpose on

Jun 28, 2022

Discord Neura - a Discord bot framework built on discord.js

Discord Neura Description Discord Neura is a Discord bot framework built on discord.js. Features Command Handler, Arguments, Preconditions and Listene

Mar 23, 2022

A discord bot made using discord.js and discord-player

A discord bot made using discord.js and discord-player

Musx A custom discord bot that can play music in your server 🎯 Add the bot to your server If you are looking for a music bot for your Discord server

Mar 28, 2022

This bot is a cool Discord bot made in discord.js using Node.JS

This bot is a cool Discord bot made in discord.js using Node.JS

Anti-Crosspost Discord Bot This bot is a cool Discord bot made in discord.js using Node.JS. It detects when a user cross-posts a message in multiple c

May 31, 2022

New base bot WhatsApp 🈴 bukan self bot lagi atau buka bot yang bisa di pakai oleh bot sendiri 😎

New base bot WhatsApp 🈴 bukan self bot lagi atau buka bot yang bisa di pakai oleh bot sendiri 😎

Installation • Thanks to • Donate Official Group Bot • Settings Instalasi Heroku Buildpack Click the deploy icon below ! heroku/nodejs https://g

Feb 9, 2022

A bot that allows you to control pterodactyl from discord powered by discord.js 12 and mongodb

A bot that allows you to control pterodactyl from discord powered by discord.js 12 and mongodb

A bot that allows you to control pterodactyl from discord powered by discord.js 12 and mongodb

Dec 24, 2022
Comments
  • Get User Banner Easily

    Get User Banner Easily

    'use strict';
    
    const fetch = require('node-fetch');
    /**
     * Get member Banner from guild;
     * @param {Client} client - The discord client.
     * @param {User} id - The User to get.
     * @returns {User} The user.
     * @see 
     https://github.com/Amir-78/djs-helper/tree/master#documentation
     */
    
    async function getUserBannerURL(data) {
      let result = ''
      
       let user = await (await fetch(`https://discord.com/api/v9/users/${data.id}`, { headers: { "Authorization": `Bot ${data.client.token}`, "Content-Type": "application/json" } })).json();
    
        if(user.code){
                result = null;
            }
      if(user.banner === null){
        result = null
      }else{
     let bannerformat = 'pn'
      if(user.banner.startsWith('a_')) {
        bannerformat = 'gif'
      }    
        let userbannerlink = `https://cdn.discordapp.com/banners/${user.id}/${user.banner}.${bannerformat}`
    
        result = userbannerlink
    
        
      }
    
    
      
      return result;
    };
    
    module.exports = { getUserBannerURL }
    
    opened by anasrz 1
  • feat(types): supports params for client methods

    feat(types): supports params for client methods

    In this PR:

    • I've added params for client methods to show types in IDE editors, And it will show what this method returns.
    • Also I've added a tests file, to test code instead of forking the repository.

    example: image

    opened by FnrDev 0
Owner
Amir.
Amir.
About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this command handler.

discordJS-V14 About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this

Umut Bayraktar 36 Dec 28, 2022
Easy-to-use , actively maintained discord bot written in dJS V13 with customizable features

Multi-purpose discord bot Found a bug? Notes There are some modules missing, you can still start the bot but there are some things within the source t

locus 7 Nov 28, 2022
This project was created to help discord.js developers start their own bot, you can take this project as a basic for your bot and add things to it as you want. 🙂

Discord.js Starter-Bot A small & basic discord.js bot to help you get started ??️ This project was created to help discord.js developers start their o

Strike 3 Nov 29, 2022
Discord-Bot - You can use the discord bot codes that are updated in every video of the codes I use in the discord bot making series that I have published on my youtube channel.

Discord-Bot You can use the discord bot codes that are updated in every video of the codes I use in the discord bot making series that I have publishe

Umut Bayraktar 114 Jan 3, 2023
Djs-paginate - Simpler discord.js v13 embed pagination tool

djs-paginate Simpler discord.js v13 embed pagination tool inspired by discordjs-button-pagination. Installation npm install @eugabrielsilva/djs-pagina

Gabriel Silva 1 Jan 4, 2022
This DJS ticket system with transcripts is fully configurable, you can change the transcripts channel, tickets channel, and more

This DJS ticket system with transcripts is fully configurable, you can change the transcripts channel, tickets channel, and more! This command uses embeds, and buttons.

LunarCodes 6 Oct 18, 2022
Full logging system using the djs library (v13.6.0)

Loggin-system-djs-v13.6 Full logging system using the djs library (v13.6.0) NOW ONTO MULTIPLE DISCLAIMERS: ◻ It is crucial that you first understand t

NoBoDy 12 Aug 26, 2022
A multipurpose bot, a clan bot, a all in one bot. The one bot u need for ur server originally made as Milrato discord Bot and by Tomato6966.

Public Bot and Support Server! Invite the Public Version of this Bot so you don't need to host it by yourself or join my Discord server to get a custo

Tomato6966 472 Dec 25, 2022
Yet another advanced djs slash command handler made by dano with ❤️

Advanced djs slash command handler Yet another advanced djs slash command handler made by dano with ❤️ Ultimate, Efficient, Slash command handler for

null 5 Nov 7, 2022
Gitlift Discord Bot is a discord bot which is listening Discord Messages to reply with user gitlift profile and total contributions.

Remoklify - Gitlift Discord Bot Gitlift Discord Bot is a discord bot which is listening Discord Messages to reply with user gitlift profile and total

Remoklify 3 Mar 20, 2022