2.2.0 • Published 3 years ago

gydo.js-dev v2.2.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

Gydo.JS (Gydo-JS) Dev Branch

The Dev branch of Gydo-JS (Unstable Branch)

It will probably receive quite lots of updates, but it will be unstable. Report bugs in our Discord Server

Stable Version: Main Branch

Github Repo

Table of Contents

Setup

const gydo = require("gydo.js-dev");
const bot = new gydo.config({
    // change the <token here> to your bots token, same with the prefix (you can only do one prefix yet)
    token: "<token here>",
    prefix: "<your prefix>"
});

You will automatically have this intents: GUILDS GUILD_MESSAGES

Which is enough, and what is required.

Once you've completed the setup, you can run node . (or node <filename>.js) in your terminal to run the bot.

Commands

If you encounter any bugs, please report it to our Discord Server

Before you put any commands put:

bot.MessageDetect()

For the command to actually work (Make sure to put it above the commands)

To create a command do:

bot.cmd({
    name: "<cmd name>", 
    code: "<code>"
});

Every command will start with your prefix like ?ping

Example Command:

bot.cmd({ 
    name: "ping",
    code: "Pong! ({ping}ms)"
});

Functions: {ping} - Sends the Bot's ping

{message-author-tag} - Sends the tag of the user who sent/ran the command

{message-author-id} - Sends the ID of the User who ran the command

{bot-user-tag} - Sends the tag of your Bot

{bot-user-id} - Sends the ID of your Bot

{guildname} - Sends the Guild's name

Args

{args;<num>}

You can replace <num> with a number.

Example:

Code: {args;0} Message sent by user: "!example gydo" Output: gydo

Raw Args Output: ["gydo"]

Since this is the Dev branch, there is unfortunately, no documentation for this, yet.

Command Handler

Baisc Command Handler Example:

const fs = require('fs');
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
    const command = require(`./commands/${file}`);
    
    bot.cmd(command);
}

Slash Commands

Make sure your bot has the permission to create slash commands

Simple Ping Slash Command:

bot.slashCommand.create({
    name: "ping",
    description: "a simple ping command",
    code: "pong",
    // optional
    guildId: "1234567890"
});

You can also put {ping} inside code: "" to get the bots ping.

If you want your slash command to only be created on a specific server, then you can put the server's guild ID in guildId

If you want it so only the user who created the interaction can see it, add the property in slashCommand.create({}): ephemeral: true

To detect the slash command:

bot.slashCommand.detect("ping")

You will have to do bot.slashCommand.detect("<slashCommandName>") to detect the slash commands you've created, otherwise the bot will say "interaction failed"

ClientError

ClientError extends EventEmitter

const { ClientError } = require('gydo.js-dev');

const ClientErr = new ClientError();

ClientErr.on('error', error => {
    console.error(error);
});

Embeds

To make an embed:

You will first have to specify on what command should the embed be attached on. It'll automatically attached on a command, if you have put one, and does exist.

All things you could add in the embed's property is mentioned here:

new gydo.Embed("<any of your command name>", {
    title: "Embed Title",
    author: "Embed Author",
    authorURL: "<some URL here>",
    description: "Embed Description \n [Hyper Link](https://npmjs.com/package/gydo.js-dev/)",
    footer: "Embed Footer",
    // (You can add more than 2 fields)
    fields: [
        {
            name: "First Field",
            value: "First Field Value",
            // Optional
            inline: true
        },
        {
            name: "Second Field",
            value: "Second Field Value"
        }
    ],
    color: "RANDOM",
    timestamp: true
});

Status

bot.activity.setActivity("<status>", { type: "PLAYING" });

or a Changing Status Loop

bot.activity.loopStatus(["<status>", "another one"], 1000, { type: "PLAYING" })

It must be on an Array, otherwise it'll send an error.

The Second Argument (or the time) is in Miliseconds (1000 = 1 second), and you can't go below 1000 ms, or it'll send an error.

Status Types are: PLAYING, LISTENING, WATCHING, and STREAMING

You can also do just a normal status:

bot.activity.setUserStatus('idle');

Normal Status Types are:

idle (Idle) dnd (Do not Disturb) invisible (Invisible) online (Online)

Member Leave Event

bot.guildMemberRemove({
    message: "Sad to see you leave {member-tag}",
    // put any message you want
    channel: "<CHANNEL ID>"
});

Functions: {member-tag} - Returns the member's tag

{member-id} - Returns the member's ID

{guildname} - Returns the Guild's name

Join Message Event

bot.guildMemberAdd({
    // put any message here
    message: "{member-tag} Welcome to {guildname}!",
    channel: "<channel ID>"
});

Functions: {member-tag} - Return the member's tag

{member} - Mentions the member that just joined

{guildname} - Returns the Guild's name

{member-id} - Returns the member's id

{guild-memmber-count} - Returns the Guild's Member Count (Will Include Bots)

Message Update

MessageUpdate extends Base

Example:

bot.MessageUpdate({
    channel: "<CHANNEL_ID>",
    message: "<MESSAGE>"
});

Functions:

{oldMessage} - Old Message Content before the message were updated

{newMessage} - New Message Content after the message were updated

{message.author.id} - Message Author's ID

{message.author.tag} - Message Author's User Tag

{message.author.mention} - Mentions the Message Author

{message.channel} - the Channel the message was sent on by the author

Links

Report the bugs on our Discord Server, and/or to our GitHub Repository.

Gydo-JS Discord Server

Main Branch

Github Repo

2.2.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.2-b

3 years ago

0.2.3

3 years ago

0.2.4

3 years ago

0.2.26

3 years ago

0.2.25

3 years ago

0.2.24

3 years ago

0.2.23

3 years ago

0.2.22

3 years ago

0.2.21

3 years ago

0.2.2

3 years ago

0.2.12

3 years ago

0.1.97

3 years ago

0.1.98

3 years ago

0.1.99

3 years ago

0.2.11

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.96

3 years ago

0.1.92

3 years ago

0.1.93

3 years ago

0.1.94

3 years ago

0.1.92-beta

3 years ago

0.1.91

3 years ago

0.1.88

3 years ago

0.1.89

3 years ago

0.1.9

3 years ago

0.1.85

3 years ago

0.1.86

3 years ago

0.1.87

3 years ago

0.1.81

3 years ago

0.1.82

3 years ago

0.1.83

3 years ago

0.1.84

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.33

3 years ago

0.1.34

3 years ago

0.1.41

3 years ago

0.1.42

3 years ago

0.1.4

3 years ago

0.1.32

3 years ago

0.1.31

3 years ago

0.1.3

3 years ago

0.1.21

3 years ago

0.1.2

3 years ago

0.1.10

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.95

3 years ago

0.0.94

3 years ago

0.0.93

3 years ago

0.0.91

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.61

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago