@tbnritzdoge/tags

2.3.2 • Public • Published

@tbnritzdoge/tags

Small tag parser based on bread-tags. badge

const { Event } = require("klasa");
const Parser = require("@tbnritzdoge/tags");
module.exports = class extends Event {
  constructor(...args) {
    super(...args, {
      enabled: true,
      once: false,
    });
  }

  async run(msg) {
    if (!msg.guild) return null;
    /* Define wether the tag exists or not here */
    const parsedTag = await this.parser.parse(tag[1], {
      args: msg.content.slice(msg.prefixLength).trim().split(/\s+/).slice(1),
      user: msg.author,
      guild: msg.guild,
      channel: msg.channel,
      member: msg.member,
    });
    return msg.send(parsedTag);
  }

  async init() {
    this.parser = new Parser();
  }
};

This example is using the klasa bot framework.

Readme

Keywords

none

Package Sidebar

Install

npm i @tbnritzdoge/tags

Weekly Downloads

1

Version

2.3.2

License

GNU-v3

Unpacked Size

12.8 kB

Total Files

31

Last publish

Collaborators

  • tbnritzdoge