astra-lite.js
v2.3.4
Published
✨ Facilite la création de vos bots Discord avec astra-lite.js !
Downloads
33
Maintainers
Readme
astra-lite.js
Installation
Pour installer le module, utilisez la commande suivante :
npm install astra-lite.js
Utilisation
Voici un exemple d'utilisation du module :
const { Client, Events, Commands } = require("astra-lite.js");
const client = new Client()
.setLangs("fr")
.setToken("VOTRE_SUPER_TOKEN")
client.run()
const event = new Events()
.setBot(client)
.setPaths("events")
const commands = new Commands()
.setSlashcommands({ delete: true })
.setId("iD_DU_BOT")
.setPaths("commands")
.setBot(client)
Assurez-vous de remplacer 'VOTRE_SUPER_TOKEN'
par le token réel de votre bot Discord. Remplacer 'ID_DU_BOT'
par l'id du bot réel.Ce modèle fournit des instructions claires sur l'installation du module et un exemple d'utilisation avec la création d'un client Discord. Vous pouvez adapter ce modèle en fonction de vos besoins spécifiques.
Events
Voici un exemple d'utilisation du module pour l'event :
module.exports = {
name: "ready",
once: true,
run(client) {
console.log("Le bot est connectée");
}
};
Commands
Voici un exemple d'utilisation du module pour la commande :
const { Discord } = require('../main')
module.exports = {
name: 'say',
description: 'say the text!',
dm: false,
perm: Discord.Permissions.ManageMessages,
options: [
{
name: 'text',
description: 'text of say!',
type: "String",
required: false,
}
],
async run(client, message, args) {
const reply_text = args.getString('text')
message.reply(reply_text);
},
};
Button
Voici un exemple d'utilisation du module pour le button :
const { Discord, ButtonBuilder } = require('../main')
module.exports = {
name: 'send_like',
description: 'Send a like you button',
dm: false,
perm: Discord.Permissions.ManageMessages,
async run(client, message, args) {
const assets = new ButtonBuilder()
.setLabel("Like you")
.setEmoji("🎊")
const button = assets.toBuild("test-button")
message.reply({ content: "hello", components: [button] });
},
};
Patchnote
Nouveautés
- Ajoute du system de langs !
Modifications
- Aucune fonctionnalité n'a été modifiée dans cette version.
Retraits
- Aucune fonctionnalité n'a été retirée dans cette version.