Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Kanye Quote Bot

A **super minimal bot** for hack.chat that automatically sends Kanye West quotes to users when they join the chat.

Features

  • 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.

How It Works

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.

Flow Overview:

  1. Bot connects to hack.chat WebSocket server.
  2. Bot joins a specific channel using a chosen nickname.
  3. Bot listens for "onlineAdd" events, which signal a new user joining.
  4. When a new user joins, the bot calls the Kanye Rest API (https://api.kanye.rest/) to get a random quote.
  5. The bot sends a chat message to the new user with the quote.

Setup

  1. Clone the repository:
    git clone https://github.com/RandomUsernames1/ye-bot.git
    cd ye-bot
  2. Install dependencies:
    npm install ws
  3. Run the bot:
    node ye.js 

Customization

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).

Customizing the API

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:
  • https.get('https://api.kanye.rest/', res => { ... });
  • Make sure the new API returns a JSON object with a quote property.

Usage

  • 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.

ETH: 0x5fe575b6d6b70867949d4564869c00a03bd18bb3 Bitcoin: bc1qqxsknanxnhk67wp3lgkzr5v7kk3dmcvxeycw9h

License

MIT License

About

a fresh minimal ye bot - 19 lines of code

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages