bajekek-dcapi

1.1.41 • Public • Published

❔ What's bajekek-dcapi

An easy to use, user friendly API, communicating with Discord.


📜 Infos


⬇ Installation

You need to have Node.js. Then in the console, type:

$ npm install bajekek-dcapi

🛠 Functions

✈ Importing to project

// Import using `require()`
const Bajekek = require("bajekek-dcapi");

🙋‍♂️ Support

Coming soon...


🔧 Usages

Login

You will need a token, wich you can get here.

//To start, copy your token and use this code
//Importing:
const Bajekek = require('bajekek-dcapi');

//Logging in:
Bajekek.Login({
    token: "YOUR BOT TOKEN", //Dont tell this to anyone!!! You need it to run the bot
    prefix: "YOUR BOT PREFIX", //Write here, how you want your commands to start (!test). You can get this variable later with: Bajekek.Client.Prefix
    owner: "YOUR NAME" //This will be used in future updates. You can get this variable later with: Bajekek.Client.Owner
});

Start

You can only use this, if you're logged in!

//Importing:
const Bajekek = require('bajekek-dcapi');

//Starting the bot:
Bajekek.Start({
    activity: { //You can specify, what should be your bot's activity
        name: "ACTIVITY NAME", //What your bot should do. Like: "Playing with pandas"
        type: "ACTIVITY TYPE" //Could be: "PLAYING", "WATCHING", "LISTENING"
    }
});

Discord.js

You can use the discord.js functions with bajekek-dcapi.

//Importing:
const Bajekek = require('bajekek-dcapi');
//Defining client:
const client = Bajekek.Client

//Logging in:
Bajekek.Login({
    token: "YOUR BOT TOKEN", //Dont tell this to anyone!!! You need it to run the bot
    prefix: "YOUR BOT PREFIX", //Write here, how you want your commands to start (!test). You can get this variable later with: Bajekek.Client.Prefix
    owner: "YOUR NAME" //This will be used in future updates. You can get this variable later with: Bajekek.Client.Owner
});

//Starting the bot:
Bajekek.Start({
    activity: { //Setting bot's activity
        name: "ACTIVITY NAME", //What your bot should do. Like: "Playing with pandas"
        type: "ACTIVITY TYPE" //Could be: "PLAYING", "WATCHING", "LISTENING"
    }
});

//Creating a command with discord.js:
client.on('message', (message) => { //Crating a message event
    if(message.content.startsWith(Bajekek.Client.Prefix + 'test')) { //Creating a filter
        //You can put here what should happen when you run the command.
    }
});

//Using embeds:
client.on('message', (message) => { //Crating a message event
    if(message.content.startsWith(Bajekek.Client.Prefix + 'embed')) { //Creating a filter
        const embed = Bajekek.Embed.MessageEmbed //Creating the embed
        //Setting up the embed
        .setTitle('Test Embed')
        .setColor('RANDOM')
        .setDescription('This is a test embed created with the \`bajekek-dcapi\` package.')
        .setAuthor(message.author.username, message.author.displayAvatarURL({ dynamic: true }))
        .setFooter(client.user.tag, client.user.displayAvatarURL())

        message.channel.send(embed) //Sending the embed
    }
});

Confirmation system

You can specify two emojis to react, when you send the command.

//Importing:
const Bajekek = require('bajekek-dcapi');
//Defining client:
const client = Bajekek.Client

//Logging in:
Bajekek.Login({
    token: "YOUR BOT TOKEN", //Dont tell this to anyone!!! You need it to run the bot
    prefix: "YOUR BOT PREFIX", //Write here, how you want your commands to start (!test). You can get this variable later with: Bajekek.Client.Prefix
    owner: "YOUR NAME" //This will be used in future updates. You can get this variable later with: Bajekek.Client.Owner
});

//Starting the bot:
Bajekek.Start({
    activity: { //Setting bot's activity
        name: "ACTIVITY NAME", //What your bot should do. Like: "Playing with pandas"
        type: "ACTIVITY TYPE" //Could be: "PLAYING", "WATCHING", "LISTENING"
    }
});

//Creating a command with discord.js:
client.on('message', (message) => { //Crating a message event
    if(message.content.startsWith(Bajekek.Client.Prefix + 'test')) { //Creating a filter
        message.channel.send('Are you sure you want to test?').then(async (test) => { //Sending the message, and naming it

            const confirm = await Bajekek.Confirm({ //Creating the confirm system
                message: test, //Specifying the named message
                author: message.author, //Specifying the message author
                reactions: ["✅", "❌"], //Setting the reactions
                time: 30000 //Setting the time to react (ms)
            })

            if(confirm === "✅") { //If the reaction is tick
                const embed = Bajekek.Embed.MessageEmbed
                .setTitle('Test Embed')
                .setColor('RANDOM')
                .setDescription('This is a test embed created with the \`bajekek-dcapi\` package.')
                .setAuthor(message.author.username, message.author.displayAvatarURL({ dynamic: true }))
                .setFooter(client.user.tag, client.user.displayAvatarURL())
                message.channel.send(embed)
            }
            if(confirm === "❌") { //If the reaction is x
                return message.channel.send('Testing stopped.')
            }

        })
    }
});

preview preview

More functions coming soon...

Package Sidebar

Install

npm i bajekek-dcapi

Weekly Downloads

1

Version

1.1.41

License

ISC

Unpacked Size

17.4 kB

Total Files

5

Last publish

Collaborators

  • bajekek