This project is a Discord bot that supports multiple shards using Discord.js. The bot can send messages in channels, send messages in threads, and edit messages.
- Supports Discord.js ShardingManager to handle large bots efficiently. (Optional)
- Commands to send messages in channels and threads.
- Ability to edit messages sent by the bot.
- Automatically determines the number of shards needed.
-
Clone the repository:
git clone https://github.com/just-rich/sendeditmsg.git cd sendeditmsg
-
Install dependencies:
npm install
-
Create a
.env
file or rename.env.example
to it in the root directory and add your bot token:TOKEN=discord_bot_token_here
To start the bot without sharding, use:
node index.js
To start the bot with sharding, use:
node shard.js
/
├── index.js # Main bot code
├── shard.js # Sharding manager
├── .env # Environment variables
├── package.json # Node dependencies
└── README.md # Documentation
!sendmsg <#channel> "message"
- Sends a message in the specified channel.!sendthreadmsg <#thread> "message"
- Sends a message in a specific thread.!editmsg <messageID> "new message"
- Edits a previously sent message by the bot.
- Ensure the bot has permissions to send and edit messages in the channels/threads.
- Run
node shard.js
instead ofnode bot.js
to enable sharding. - If you encounter any issues, check your bot's token and permissions.
This project is open-source and available under the MIT License.
slapped together by rich for NVSTly's Discord bot temporarily.