Skip to content

magmajs/magma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

const { Client, DiscordIntents } = require("Magma.js");

const client = new Client({
    intents: [DiscordIntents.Guilds, DiscordIntents.GuildMessages, DiscordIntents.MessageContent],
});

//If you do not listen to this event, any errors may kill your process
client.on("error", (error) => {
    console.error(error);
})

client.on("ready", () => {
    console.log("Ready!");
});

client.on("messageCreate", (message) => {
    const content = message.content;
    const args = content.split("!")[1].split(" ");
    const command = args.shift()
    
    if (command === "ping") {
        message.reply("Pong!");
    }
});

client.connect({
    token: "Your bot token"
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors