A **super minimal bot** for hack.chat that automatically sends Kanye West quotes to users when they join the chat.
- Sends a Kanye quote automatically to new users.
- Minimal and lightweight code (~19 lines).
- No unnecessary commands or clutter.
- Easy to customize channel, bot name, and behavior.
The bot connects to hack.chat via WebSocket, joins a specific channel, and listens for new users joining the chat. When a new user joins, the bot fetches a random Kanye quote from the Kanye Rest API and sends it to that user.
- Bot connects to hack.chat WebSocket server.
- Bot joins a specific channel using a chosen nickname.
- Bot listens for "onlineAdd" events, which signal a new user joining.
- When a new user joins, the bot calls the Kanye Rest API (
https://api.kanye.rest/) to get a random quote. - The bot sends a chat message to the new user with the quote.
- Clone the repository:
git clone https://github.com/RandomUsernames1/ye-bot.git cd ye-bot - Install dependencies:
npm install ws - Run the bot:
node ye.js
You can easily customize the bot by editing the connection settings in index.js:
ws.send(JSON.stringify({ cmd: 'join', channel: 'lounge', nick: 'Kanye' }));- channel: The chat channel to join (e.g.,
lounge). - nick: The bot's display name (e.g.,
Kanye).
The bot currently uses the Kanye Rest API to fetch random quotes. If you want to use a different source:
- Replace the API URL in the bot code:
- Make sure the new API returns a JSON object with a
quoteproperty.
https.get('https://api.kanye.rest/', res => { ... });- Start the bot with
node index.js. - When a new user joins the chat, the bot automatically sends them a Kanye quote.
- No extra commands are needed—the bot works automatically on user join.
MIT License