Hey, I wouldn't judge your intentions on using this, but here is a small code I've made. And I also assume you have all the required stuff such as Mineflayer. Please make sure to read the note I've left below in this post.
// Importing
const mineflayer = require('mineflayer')
// Your server name
const name = 'server-name';
// Minecraft account credentials
const email = 'someone@example.com';
const password = 'secure-password';
// Create your bot, with connection information.
const bot = mineflayer.createBot({
host: `${name}.minehut.gg`,
port: 25565,
username: email,
password: password,
version: '1.16.5'
})
// Bot login event (fired as soon as the bot joins the server)
bot.on('login', () => {
// Send a message in chat after the bot joins
bot.chat("Beep boop, I'm a bot :3")
// Console message
console.log("Bot has connected to the server")
})
Important Note: This risks your Minehut account and/or your server if you intend to use this for boosting your server's player count. Using bots to boost your server is a punishable offense (https://minehut.com/rules/). Use this at your own risk, you've been warned.