winston-discord
A Discord transport for Winston using webhooks
Usage
The example webhooks were generated by discord but have since been deleted. If you post to these webhooks you will get a "10015: Unknown Webhook" error.
const winston = ; // Default winston options +// the following options are supportedconst options = // A single webhook URL webhooks: 'https://discordapp.com/api/webhooks/446240708299587584/W_y7cmhCv2KY-oKopLHFTTw08L0apQVS0bkrUDHV44Es4Vb-p3Z4uEEHEwpVkHVjpaqg' // Multiple webhooks by URL webhooks: 'https://discordapp.com/api/webhooks/446240708299587584/W_y7cmhCv2KY-oKopLHFTTw08L0apQVS0bkrUDHV44Es4Vb-p3Z4uEEHEwpVkHVjpaqg' 'https://discordapp.com/api/webhooks/446241166493483008/JeOKubEIRAcalZISmjGrG6DuzHX_KdE5Uzq_r0mK0318voc_7TRjC6NA_oe-fYX_eAhn' // Single webhook by id and token webhooks: id: '446241166493483008' token: 'JeOKubEIRAcalZISmjGrG6DuzHX_KdE5Uzq_r0mK0318voc_7TRjC6NA_oe-fYX_eAhn' // Multiple webhooks by id and token webhooks: id: '446240708299587584' token: 'W_y7cmhCv2KY-oKopLHFTTw08L0apQVS0bkrUDHV44Es4Vb-p3Z4uEEHEwpVkHVjpaqg' id: '446241166493483008' token: 'JeOKubEIRAcalZISmjGrG6DuzHX_KdE5Uzq_r0mK0318voc_7TRjC6NA_oe-fYX_eAhn' // Colors (optional Default: true) colors: false // Will only work in Discord in dark mode // Change a level's color colors: 'warn': 0xF58A07 // Inline (optional Default: true) inline: false // Set per meta inline: anythingMeta: false ; const logger = new winstonLogger transports: new DiscordLoggeroptions ; logger;
Planned functionality
- Metadata
- Log levels
- Embeds
- Overwriting username and avatar_url