discord-logger-midvn
v1.0.3
Published
A simple and efficient logger for sending messages and formatted code snippets to a Discord channel using a bot.
Downloads
22
Readme
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-midvnUsage
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
| Option | Type | Description |
|----------------------|--------|-------------|
| discord_token | String | Your Discord bot token. |
| discord_channel_id | String | The ID of the channel where messages should be sent. |
License
This project is licensed under the MIT License.
