Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@reconlx/discord.js
Advanced tools
A simple api to configure and enhance the ways on coding your discord bot. Compatible with discord.js v12 but it should also work on older versions. Variety of different usages for this api. <a href="https://nodei.co/npm/
Readme
A simple api to configure and enhance the ways on coding your discord bot. Compatible with discord.js v12 but it should also work on older versions. Variety of different usages for this api.
First install Node.js. Then:
$ npm install @reconlx/discord.js
// Using Node.js `require()`
const recon = require('@reconlx/discord.js');
// Using ES6 imports
import recon from '@reconlx/discord.js';
Feel free to join the support discord server -> https://discord.gg/xCCpfth
// Example on checking how long the member's account was created.
// Import the package
const recon = require('@reconlx/discord.js')
// Destructure the package
const daysAgo = recon.daysAgo
const discord = require('discord.js')
client.on('guildMemberAdd', async(member) => {
console.log(daysAgo(member.user.createdAt)) // return days.
})
// Example on checking how long the member's account was created.
// Import the package
const recon = require('@reconlx/discord.js')
// Destructure the package
const EmbedPages = recon.EmbedPages
// Use either MessageEmbed or RichEmbed to make pages
// Keep in mind that Embeds should't have their footers set since the pagination method sets page info there
const { MessageEmbed } = require('discord.js');
const embed1 = new MessageEmbed().setTitle('1')
const embed2 = new MessageEmbed().setTitle('2')
// Create an array of embeds.
const pages = [
embed1,
embed2
]
// Create an emojilist, first emoji being page back and second emoji being page front. Defaults are set to ['⏪', '⏩'].
const emojis = [
"⏪",
"⏩"
]
// Define a time in ms, defaults are set to 60000ms which is 60 seconds. Time on how long you want the embed to be interactable
const time = 30000
// Call the EmbedPages method, use the <message> parameter to initialize it.
EmbedPages(msg, pages, emojis, time);
//There you go, now you have embed pages.
// destructure the package
const { confirmation } = require('@reconlx/discord.js')
// Here is an example on using it in banning members.
message.channel.send('Confirmation for banning members').then(async msg => {
// parameters used(which msg to react on, who can acess it, reactions, time(optional))
const emoji = confirmation(msg, message.author, ['✅', '❌'], 30000)
if(emoji === '✅') { //if author reacts on check
//delete the confirmation message
msg.delete()
//ban the member
guildMember.ban()
}
if(emoji === '❌') { // if author reacts on cross
// delete the confirmation message
msg.delete()
}
})
// destructure the package
const { fetchTransript } = require('@reconlx/discord.js')
// here is how you use it
// template
// fetchTranscript(message: any, numberOfMessages: number, sendToAuthor: boolean)
//example
module.exports = {
name : 'transcript',
run : async(client, message) => {
fetchTranscript(message, 5, true)
}
}
// it will fetch 10 messages in {message} channel and the transcript will be sent to the author
// destructure the package
const { timeout } = require('@reconlx/discord.js')
// example
const messageToDelete = await message.channel.send('Hello There 👋')
// using the method
// template => timeout(message: who can acess, msgToDelete: which message to delete,time: time before the emoji gets deleted)
timeout(message, messageToDelete, 5000) // only message.author can areact, messageToDelete is going to deleted if collected reactions, if no reactions after 5 seconds the reaction will be removed.
const { reconDB } = require('@reconlx/discord.js')
// or
import { reconDB } from '@reconlx/discord.js'
const db = new reconDB({
uri : "your mongodb connection string"
})
module.exports = db;
const db = require('./db.js') // replace db.js with your file path to the setup of reconDB
db.set('numbers', '123')
// saves data to database
db.set('key', 'value')
// gets value from key
db.get('key') // returns => value
// returns boolean
db.has('key') // returns => true
// deletes data
db.delete('key')
// checking for data
db.has('key') // returns => false
FAQs
A simple api to configure and enhance the ways on coding your discord bot. Compatible with discord.js v12 but it should also work on older versions. Variety of different usages for this api. <a href="https://nodei.co/npm/
The npm package @reconlx/discord.js receives a total of 46 weekly downloads. As such, @reconlx/discord.js popularity was classified as not popular.
We found that @reconlx/discord.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.