Skip to content

rishiyama/rishbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

rishbot

slackbot

rishbot is the libray for slackbot.

Installation

Now, the repository is not registered to PyPI. So, you can install it by the following command.

pip install git+https://github.com/rishiyama/rishbot

~/.bashrc

Please set the following environment variables to your ~/.bashrc. SLACK_URL is the url of incoming webhook of slack. So, You need to set it to your slack channel.

export SLACK_URL=https://hooks.slack.com/services/x/y/z

Then, please reload your ~/.bashrc.

source ~/.bashrc

Usage

Default message is "All finished !!!".

>>> import rishbot as rs
>>> rs.notify_slack()

Custom message is also available.

>>> import rishbot as rs
>>> rs.notify_slack("End of the process")

make your version

https://github.com/rishiyama/rishbot/blob/main/rishbot/notify.py

import requests
import os
import json 

# send slack message


def notify_slack(text=f'FIX HERE'):
    requests.post(os.getenv('SLACK_URL'), data=json.dumps({'text': text}))

you can change the message by changing the text variable, FIX HERE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages