Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cnishina/chatbot-with-yuka
https://github.com/cnishina/chatbot-with-yuka
bot chatbot hacktoberfest twitch
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/cnishina/chatbot-with-yuka
- Owner: cnishina
- License: mit
- Created: 2022-10-09T19:31:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-21T00:09:53.000Z (about 2 years ago)
- Last Synced: 2024-10-06T02:01:57.960Z (4 months ago)
- Topics: bot, chatbot, hacktoberfest, twitch
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Focus chatbot
This chatbot listens to the focus command and writes it to a `focus.csv` file.
If the file does not exist, it will be created. Rotates the `focus.csv` file on
month or year not matching up. The rotation uses UTC timestamps.> Example:
>
> chat sends:
>
> ```
> !focus Creating a chatbot for yuka.
> ```
>
> The `focus.csv` file should contain:
>
> ```
> bedtimebear_808,2022-10-09T20:58:57.965000,Creating a chatbot for yuka.
> ```# Getting started
Create a new twitch account that you'll use as the chat bot. Maybe something
called "yuka_bot" or "bot_with_yuka"? Next you will navigate to
https://dev.twitch.tv/console create an application.Next navigate to the following URL (replacing the `` with
the client id from the application).```
https://id.twitch.tv/oauth2/authorize?response_type=token&client_id=&redirect_uri=http://localhost:3000&scope=chat%3Aread+chat%3Aedit
```This will redirect to a URL that looks something like this:
```
http://localhost:3000/#access_token=&scope=chat%3Aread+chat%3Aedit&token_type=bearer
```Create a .env file at the root of this project and copy the ``
from the URL string. In addition, add in the `` where the bot should
send messages. Also, we should include the client id. The client id is used
to make a GET request to the Twitch API to check if you are live. This should
look as follows:```
ACCESS_TOKEN=
CHANNEL=
CLIENT_ID=
```## Running chatbot with poetry
```
poetry install
poetry shell
python3 main.py
```## Running chatbot with a virutal env:
```
python3 -m venv .
source bin/activate
pip install -r requirements.txt
python3 main.py
```## Running unit tests
```
python3 -m unittest focus_test.py
```## Updating the requirements.txt from Poetry
```
poetry export -f requirements.txt --output requirements.txt
```