Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
/ Senpai-Bot Public archive

A hack.chat bot using api websockets, websocket-client and requests if your wondering the %joke command uses jokeapi

License

Notifications You must be signed in to change notification settings

FFUV/Senpai-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Now Defunct

A hack.chat bot is a bot made for hack.chat that goes to different servers the commands on this bot will be shown when you do %help (special thanks to MrZhang365 for teaching me how to make bots) This project just uses a few simple websocket-client protocols using a html library using requests ! ( btw if your wondering yes we did use jokeapi stay mad >:) ) CodeFactor oh and yes this can be used as a template as long as you give me credits

Installation

Use the package manager pip and this oh and also last one here to download

pip install requests
pip install websocket-client
pip install websocket

Usage

from importlib.metadata import requires
import websocket
import ssl
import requests
from json import loads,dumps
nick = 'SenpaiBot'   #change this!!!
ws = websocket.create_connection("wss:https://hack.chat/chat-ws",sslopt={"cert_reqs": ssl.CERT_NONE}) #1: connect
ws.send(dumps({'cmd':'join','channel':'bot','nick':nick,'pass':'<your password>'}))#2: join
print('The bot is now running...')

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

A hack.chat bot using api websockets, websocket-client and requests if your wondering the %joke command uses jokeapi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages