1.0.6 • Published 3 years ago

discord.js-arguments v1.0.6

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

discord.js-arguments

A simple argument parser for discord.js that returns a collection of the arguments.

Installation

npm install discord.js-arguments

Example

const argumentParser = require('discord.js-arguments');
const Discord = require('discord.js');

const client = new Discord.Client();

client.on('ready', () => console.log('ready'));

client.on('message', (message) => {
    const arguments = argumentParser(message.content);
    message.reply(arguments);
})

client.login('BOT TOKEN HERE');

or in TypeScript

import argumentParser from 'discord.js-arguments';
import Discord from 'discord.js';

const client: Discord.Client = new Discord.Client();

client.on('ready', (): void => console.log('ready'));

client.on('message', (message: Discord.Message): void => {
    const arguments = argumentParser(message.content);
    message.reply(arguments);
})

client.login('BOT TOKEN HERE');

Parser Arguments

ArgumentType - RequiredDescription
contentstring - trueThe message content to parse the arguments from.
prefixstring - falseThe prefix to look for (e.g. '--').
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago