1.0.11 • Published 4 years ago

discordjs-chatlog v1.0.11

Weekly downloads
519
License
ISC
Repository
-
Last release
4 years ago

discord.js chat log

Lightweight discord.js chat logging constructor

Installation

npm i discordjs-chatlog

Usage
const ChatLog = require("discordjs-chatlog"); //imports the module

let log = new ChatLog(); //constructor
    log.setMessage("Logged message"); //set the message
    log.setId(12345678987654321); //set the author id
    log.setTag("some-user-tag#0069"); //set the author tag
    log.setTimestamp(Date.now()); //set the timestamp

message.channel.send(log.generateEmbed()); //generate the embed
const ChatLog = require("discordjs-chatlog); //imports the module

let log = new ChatLog();
    log.setMessage("Message");
    log.setId(12345678987654321);
    log.setTag("some-user-tag#0069");
    log.setTimestamp(Date.now());

console.log(log.getMessage()) //returns "Message"
console.log(log.getTag()) //returns "Tag"
console.log(log.getId()) //returns "Id"
console.log(log.getTimestamp()) //returns "Timestamp"
const Discord = require("discord.js");
const ChatLog = require("discordjs-chatlog"); //imports the module
const client = new Discord.Client();

client.on("message", message => {
    if (message.author.bot) return;
    let log = new ChatLog(); //constructor
    log.setMessage(message.content); //set the message
    log.setId(message.author.id); //set the author id
    log.setTag(message.author.tag); //set the author tag
    log.setTimestamp(Date.now()); //set the timestamp

message.guild.channels.cache.find(c => c.name === "log").send(log.generateEmbed()); //sends the embed in a channel called "log"
});

client.login(token);

Embed

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago