Skip to content

mathislajs/discord-bot-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Bot JavaScript

You can use as a template for your bots, you are free to modify it in your own way. The discord.js module and the Sheweny framework was used to create this small project.

Create

Prerequisites

Run

  • Clone this repository
  • Install the dependencies: npm install
  • Change the name of the .env.example file to .env
    • Fill in the required information inside (this will be explained in the notes of the file)
  • Start the bot: npm start

Now everything should run smoothly! 🎉

Automatic deployment on a platform

Deploy on Railway

Structures

Command

const { Command } = require("sheweny");

module.exports = class ExampleCommand extends Command {
  constructor(client) {
    super(client, {
      name: "example",
      type: "SLASH_COMMAND",
      description: "Example command",
    });
  }
  execute(interaction) {
    interaction.reply({ content: "This is an example of a Slash command. Learn more about building a command with Sheweny: https://sheweny.js.org/doc/structures/Command.html", ephemeral: true });
  }
};

Event

const { Event } = require("sheweny");

module.exports = class Ready extends Event {
  constructor(client) {
    super(client, "ready", {
      description: "Log in the console when the bot is successfully connected",
      once: true,
    });
  }

  execute(client) {
    console.log("Connected as " + client.user.tag + "");
  }
};

References

About

open source discord bot written in javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published