1.0.3 • Published 6 months ago

discord-logger-midvn v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

Discord Logger

A simple and efficient logger for sending messages and formatted code snippets to a Discord channel using a bot.

Installation

npm install discord-logger-midvn

Usage

1. Initialize the Logger

const DiscordLogger = require('discord-logger');

const discordLogger = DiscordLogger.getInstance({
    discord_token: 'YOUR_TOKEN',
    discord_channel_id: 'YOUR_CHANNEL_ID'
});

2. Send a Simple Message

discordLogger.sendMessage('Hello World');

3. Send a Formatted Code Snippet

discordLogger.sendFormattedCode({
    code: { error: 'Not found' },
    title: 'API Error'
});

Configuration Options

OptionTypeDescription
discord_tokenStringYour Discord bot token.
discord_channel_idStringThe ID of the channel where messages should be sent.

License

This project is licensed under the MIT License.

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago