Traduction
Ce module n'est que la traduction française du jeu de morpion du module reconlx de reconlx.
❔ reconlx
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.
📝 Table of contents
Installation
First install Node.js. Then:
$ npm install reconlx
🛠 Usages (Click on it for more info on how to use it)
- reconDB - simple way to store data into mongodb
- DaysAgo - check how many days ago was it using date format
- ReactionPages - simple pagination to make your "MessageEmbed" interactable.
- Confirmation - A reaction collector which returns the first emoji collected, can be used as a confirmation prompt.
- fetchTranscript - Specify an amount of messages and it will return a discord chat template with messages, acts like a transcript.
- timeout - Makes it easier to delete messages according to your needs
- chatBot - Replies to your messages in discord.
- hangman - Hangman game now playable in discord.
- tictactoe - TicTacToe game now playable in discord.
- GiveawayClient - Giveaway Client, easy way to manage your giveaways
- SnakeCord - Snakecord with some minor error fixes as the mantainer isn't reading prs.
✈ Importing
const recon = require("reconlx");
import recon from "reconlx";
🙋♂️ Support
Feel free to join the support discord server -> https://discord.gg/xCCpfth
🔧 Usages
DaysAgo
const recon = require("reconlx");
const daysAgo = recon.DaysAgo;
const discord = require("discord.js");
client.on("guildMemberAdd", async (member) => {
console.log(daysAgo(member.user.createdAt));
});
ReactionPages
Example :
const recon = require("reconlx");
const ReactionPages = recon.ReactionPages;
const { MessageEmbed } = require("discord.js");
const embed1 = new MessageEmbed().setTitle("1");
const embed2 = new MessageEmbed().setTitle("2");
const pages = [embed1, embed2];
const textPageChange = true;
const emojis = ["⏪", "⏩"];
const time = 30000;
ReactionPages(msg, pages, textPageChange, emojis, time);
Preview on a music list :
confirmation
const { confirmation } = require("reconlx");
message.channel.send("Confirmation for banning members").then(async (msg) => {
const emoji = await confirmation(msg, message.author, ["✅", "❌"], 30000);
if (emoji === "✅") {
msg.delete();
guildMember.ban();
}
if (emoji === "❌") {
msg.delete();
}
});
fetchTranscript
const { fetchTransript } = require("reconlx");
module.exports = {
name: "transcript",
run: async (client, message) => {
fetchTranscript(message, 5).then((data) => {
const file = new MessageAttachment(data, "index.html");
message.channel.send(file);
});
},
};
Preview on a general chat
timeout
const { timeout } = require("reconlx");
const messageToDelete = await message.channel.send("Hello There 👋");
timeout(message, messageToDelete, 5000);
Preview
chatBot
const { chatBot } = require("reconlx");
chatBot(message, args.join(" "));
Preview
hangman
const { hangman } = require("reconlx");
const hang = new hangman({
message: message,
word: args.slice(1).join(" "),
client: client,
channelID: message.mentions.channels.first(),
});
hang.start();
Preview
tictactoe
const { tictactoe } = require("reconlx");
var game = new tictactoe({
message: message,
player_two: message.mentions.members.first(),
});
Preview
reconDB
1. Importing the package
const { reconDB } = require("reconlx");
import { reconDB } from "reconlx";
2. Establishing and exporting reconDB
const db = new reconDB({
uri: "your mongodb connection string",
});
module.exports = db;
3. Example on using it
const db = require("./db.js");
db.set("numbers", "123");
Methods
.set
db.set("key", "value");
.get
db.get("key");
.has
db.has("key");
.delete
db.delete("key");
db.has("key");
GiveawayClient
Initialising the client
const Discord = require('discord.js')
const client = new Discord.Client();
const { GiveawayClient } = require('reconlx');
const giveaway = new GiveawayClient(client, {
mongoURI?
emoji?
defaultColor?
});
module.exports = giveaway;
Methods
start
end
reroll
getCurrentGiveaways
removeCachedGiveaways