Skip to content

Releases: spuckhafte/breezer.js

No API change

14 Sep 14:10
Compare
Choose a tag to compare
No API change Pre-release
Pre-release

commit

Changes

  • No changes in the API, just some refactoring.

Custom Intents

13 Sep 17:08
Compare
Choose a tag to compare
Custom Intents Pre-release
Pre-release

commit

Changes

  • Define custom intents overriding the default provided by the library.
import { Bot } from 'breezer.js';
import { Intents } from 'discord.js';

const bot = new Bot({
    token: "<TOKEN>",
    commandsFolder: "commands",
    prefix: "!",
    lang: ".js",
    // new
    intents: [Intents.FLAGS.GUILDS]
});

Default intents:

[
    Intents.FLAGS.GUILD_MESSAGES,
    Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
    Intents.FLAGS.MESSAGE_CONTENT,
    Intents.FLAGS.GUILDS,
    Intents.FLAGS.GUILD_MEMBERS,
    Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS
]

Generics

11 Sep 09:13
Compare
Choose a tag to compare
Generics Pre-release
Pre-release

commit

Changes

  • Now you also have to define the type of your cmd structure as Generic to the command class. This well help in inferring the type of each field properly when using this.extract().
// commands/test.ts

export default class extends Command<[string, number|null]> {
    constructor() {
        super({
            structure: ["string", "number|null"]
        });
    }

    async execute() {
        // one: string, two: number|null
        const [one, two] = this.extract();
    }
}

Itty-Bitty Changes

09 Sep 10:41
Compare
Choose a tag to compare

Pre

28 Jun 03:46
Compare
Choose a tag to compare
Pre Pre-release
Pre-release

commit

Changes

  • hasPerm method nd function to check if the bot or any user has certain perm in the channel linked to a cmd's msg.

Inside a Command class (checks only for the bot)

this.botHasPerm( perm: PermissionResolvable ): boolean

Anywhere (checks for any user)

import { userHasPerm } from 'breezer.js';
userHasPerm( perm, userId: string, msg: Message ): Promise<boolean>

Pre

27 Jun 10:06
Compare
Choose a tag to compare
Pre Pre-release
Pre-release

commit

Changes

  • State operations are done inside angle brackets: << $count$ + 1 >>
  • hasPerm function and method to check if a bot or any user has a specific permission. (check the latest :: 0.4.1 release note)

## hasPerm functions
### Inside a command class (checks only for the bot):
- this.hasPermInGuild( perm: PermissionResolvable )
- this.hasPernInChannel( perm: PermissionResolvable )

### Anywhere (checks for any userId)
import { hasPermInGuild, hasPermInChannel } from 'breezer.js'
- hasPermInGuild( perm, msg, userId: optional )
- hasPermInChannel( perm, msg, userId: optional )
- if userId is not specified msg-author's id is used.

Pre

07 Apr 09:38
Compare
Choose a tag to compare
Pre Pre-release
Pre-release

commit

Changes

  • Button Signals
  • Documentation

Initial

27 Mar 06:40
Compare
Choose a tag to compare
Initial Pre-release
Pre-release

First pre-release.
Read the docs.