3.0.1 • Published 3 years ago

node-buddy v3.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

node-buddy

A node module that is designed to make your life easier when dealing with errors, logging, and more!


Support


Installation

npm i node-buddy@latest --save


Class Builder

A way that you can log errors to a Discord channel via a Webhook.

EntryTypeDefinition
#1BOOLEANuseDiscord true or false.
#2STRINGIf using Discord, set the webhook username here.
#3STRINGIf using Discord, set the webhook avatarURL here.

Figlify Console Tool

An easier way to use the Figlify module.

EntryTypeDefinition
#1STRINGThe word(s) you want figlified
#2STRINGThe font to use for figlification.
#3STRINGThe CHALK NPM color you wish to use.

Colorizor Console Tool

A cleaner and better way to log your errors in console.

EntryTypeDefinition
#1STRINGThe content you want colorized.
#2STRINGThis is the color/bgColor the content should be logged in.

Message Discord User Fetch

Fetch a Discord user from a message or it's content.

EntryTypeDefinition
#1CLIENTProvide your client here (bot, app, client).
#2MESSAGEThe message variable you can pull mentions from.
#3STRINGA backup ID or args statement when no mentions are provided.

Discord User Fetch

Fetch a Discord user by ID (basic).

EntryTypeDefinition
#1CLIENTProvide your client here (bot, app, client).
#2STRINGThe userID you are trying to fetch info for.

Discord Channel Fetch

Fetch a Discord channel by ID (basic).

EntryTypeDefinition
#1CLIENTProvide your client here (bot, app, client).
#2STRINGThe channelID you are trying to fetch info for.

Discord Guild Fetch

Fetch a Discord guild by ID (basic).

EntryTypeDefinition
#1CLIENTProvide your client here (bot, app, client).
#2STRINGThe guildID you are trying to fetch info for.

Console Errors

A cleaner and better way to log your errors in console.

EntryTypeDefinition
#1STRINGThis is the error that is collected.
#2STRINGThis is the color the error should be logged in.

Webhook Errors

A way that you can log errors to a Discord channel via a Webhook.

EntryTypeDefinition
#1STRINGThis is the error that is collected.
#2STRINGThis is the ID of the webhook to send to.
#3STRINGThis is the TOKEN of the webhook to send to.

Code Example

const nodebuddy = require('node-buddy')
const buddy = new nodebuddy(true, 'NodeBuddy', 'https://seeklogo.com/images/N/nodejs-logo-FBE122E377-seeklogo.com.png')
const Discord = require('discord.js')
const client = new Discord.Client()

client.on('ready', async () => {
    buddy.colorize(`I am now running...`, `blue`)

    let channel = await client.channels.cache.get('848346040511758356')

    if(channel == undefined) {
        buddy.consoleError(`channel variable has returned undefined.`, `red`);
    } else {
        channel.send().catch(e => {
            buddy.webhookError(e, `webhookId`, `webhookToken`);
        });
    }
});

client.login('YOUR_BOT_TOKEN')
3.0.1

3 years ago

3.0.0

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago