Skip to content

🤖 (DEPRECATED) A general use bot for hack.chat

License

Notifications You must be signed in to change notification settings

neelkamath/hack.chat-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hack.chat bot

NOTE: This project has been deprecated because hack.chat is no longer actively maintained and hardly anyone uses the site (including me).

This is a bot for hack.chat instances.

hack.chat is a messaging site where you have the ability to run bots. You can enter a chat by following the URL with ?<NAME>, where <NAME> is the name of the chat (e.g., https://hack.chat/?math). Anyone can enter this channel if they go to that URL.

This bot was made because the existing bots on hack.chat either lacked useful features or poorly implemented them.

DuckDuckGo Logo The search feature of this bot uses DuckDuckGo's API.

This application was written using Python and MongoDB.

Commands

Installation

  1. A Heroku account
  2. Install the Heroku CLI
  3. Log in: heroku login
  4. Clone the repository:
    • HTTPS: git clone https://github.com/neelkamath/hack.chat-bot.git
    • SSH: git clone git@github.com:neelkamath/hack.chat-bot.git
  5. Change the directory: cd hack.chat-bot
  6. Create a Heroku app: heroku create <NAME>, where <NAME> is an optional parameter to specify your app's name (a random name will be generated if you don't specify one)
  7. Push the code: git push heroku master
  8. Install dependencies:
    • Librato: heroku addons:create librato:development
    • mLab: heroku addons:create mongolab:sandbox
    • Papertrail: herou addons:create papertrail:choklad
  9. Configure the app using the table below. The command to add a configuration variable is heroku config:set <KEY>="<VALUE>" (e.g., heroku config:set CHANNELS="bottest, gaming, pokemon"). Also create a file named .env in the hack.chat-bot directory with these key-value pairs (each pair on its own line) with the syntax <KEY>="<VALUE>". <KEY> is the variable's name, and <VALUE> is its value.
Variable Explanation Required Example
CHANNELS A list of channels to connect to. The bot won't be allowed to leave these channels. Each channel should be separated with a comma followed by a space. Yes botDev, math, pokemon
TRIGGER The trigger for the bot (e.g., setting the trigger to ! would make the bot respond to !joke). Yes .
MONGODB_URI The URI of the mLab database. Get its value with heroku config:get MONGODB_URI
URL The hack.chat instance to connect to. Use wss://hack.chat/chat-ws for the original hack.chat. Yes wss://hack.chat/chat-ws
NICK The bot's nickname. Nickname must consist of up to 24 letters, numbers, and underscores. If the nickname has already been taken on a channel, the bot will be unable to connect to that channel. Yes john_doe
CODE_URL The link to the project's source code. No https://gitlab.com/neelkamath/hack.chat-bot
EXCHANGE_RATE_API_KEY Your ExchangeRate-API API key. No
OXFORD_APP_ID Your Oxford Dictionaries App ID. No
OXFORD_APP_KEY Your Oxford Dictionaries App Key. No
PASSWORD A trip code is a randomly generated code based on a password. Entering the same password gives the same trip code each time. This allows people in anonymous chatting sites to verify if a user is who they claim to be regardless of their nickname. No hot$auce

Usage

  1. Change the directory: cd hack.chat-bot
  2. Run:
    • On the server:
      • Start: heroku ps:scale bot=1
      • View logs: heroku logs --tail
    • Locally:
      • Install virtualenv:
        • Windows: pip install virtualenv
        • Other: sudo pip3 install virtualenv
      • Create a virtual environment: virtualenv venv
      • Activate the virtual environment:
        • Windows: venv\Scripts\activate.bat
        • Other: source venv/bin/activate
      • Install the dependencies:
        • Windows: pip install -r requirements.txt
        • Other: pip3 install -r requirements.txt
      • Start: heroku local

License

This project is under the MIT License.

About

🤖 (DEPRECATED) A general use bot for hack.chat

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages