djs-image-logger
v1.0.11
Published
Logs images sent in a channel or the entire server with a discord.js bot. A re-write of 'https://nodei.co/npm/discord.js-image-logger'
Downloads
6
Readme
Djs Image Logger
A simple addon for Discord.js bots to log images sent in a specified channel, channels or the entire server. It can log either with RichEmbeds or with the link to the file.
A re-write of the NPM Package discord.js-image-logger!
Installation
npm install djs-image-logger --save
DIL Options
A full list of options and their defaults you can pass in new <DIL>(<Client>, { options });
.
| Option | Type | Description | Default |
| --- | --- | --- | --- |
| method | String | The default logging of image attachments. | "link" |
| channels | Object/Array | A list of channel names or ID's to log images from, if not server wide. | [ ] |
| serverWide | Boolean | Enable/disable server wide attachment logging, rather than channel specific. | false |
| logChannel | String | A name or ID of a channel to log images by default. | "image-logs" |
| logging | Boolean | Enables some extra, none needed logging. | false |
| acceptRole | String | A name of a role to give to accepted users, when their image is accepted through the embed
method | false |
Usage
This will be an extremely basic example of how to setup the module.
// First we require the Discord.js library.
const Discord = require("discord.js");
// Now we require the module.
const DIL = require("djs-image-logger");
// Start a new Discord Client.
const client = new Discord.Client();
// Start the module with some custom options.
DIL(client, {
method: "embed",
logChannel: "image-logs",
channels: [""],
acceptRole: "Accepted"
})
// Login the Client
client.login("your discord bot token");
Credit
This is a re-write of the NPM Package discord.js-image-logger! This one added a neat feature to the embed method, while turning the embed logging method into a picture accept/deny thing.
Can be usefull for Fortnite Item-shops creator codes so user's can get a role if they use the creator code, of course there are more ways you can do this but this is the reason I made it.