Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/phlak/inner-circle-bot

The Inner Circle chat bot.
https://github.com/phlak/inner-circle-bot

bot botman chatbot telegram telegram-bot

Last synced: 24 days ago
JSON representation

The Inner Circle chat bot.

Awesome Lists containing this project

README

        


The Inner Circle Bot


License
Build Status
StyleCI
Author

---

Requirements
------------

- [PHP](https://secure.php.net/) >= 7.4
- PHP [Internationalization Extension](https://www.php.net/manual/en/intro.intl.php)

#### For development

- [Composer](https://getcomposer.org/)
- [Docker](https://www.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)

Setting up a Local Development Environment
------------------------------------------

### Create a Telegram Bot

In order to test the application locally you will first need to create your own
Telegram bot to interact with. See the [Telegram docs](https://core.telegram.org/bots#creating-a-new-bot)
for instructions on creating and configuring your own bot.

### Configure the Hostname

Add the following entry to `/etc/hosts`:

127.0.0.1 inner-circle-bot.local

### Set Environment Variables

To set up your local environment variables copy `.env.example` to `.env` then
set the variables in the `.env` file.

cp .env.example .env

### Start the Docker Environment

To build and start the containers on your system for the first time run the
following from the project's root directory:

docker-compose up -d

### Install PHP dependencies

composer install

or from within the Docker container:

docker run -it --rm --env-file ${PWD}/.env --user $(id -u):$(id -g) --volume ${PWD}:/app composer:1.9 \
&& composer install --working-dir /app --ignore-platform-reqs --no-cache --no-interaction --no-scripts

### Create application tunnel via ngrok

ngrok http -host-header=rewrite http://inner-circle-bot.local:80

### Set the Telegram bot webhook URL

curl --request POST --header 'content-type: application/json' \
--url https://api.telegram.org/bot{{ TELEGRAM_TOKEN }}/setWebhook \
--data '{"url": "{{ NGROK_URL }}/{{ TELEGRAM_TOKEN }}"'

For more info, see

List of Commands
----------------

btc - Get the market price (in USD) for bitcoin (`/btc [YYYY-MM-DD]`)
busy - Generate a random "busy" message
coinflip - Flip a coin
dilbert - Get a Dilbert comic (`/dilbert [YYYY-MM-DD | random]`)
eightball - Consult the Magic Eightball (`/eightball [question]`)
explosm - Fetch a Cyanide & Happiness comic (`/explosm [id]`)
foxtrot - Fetch the latest FoxTrot comic
monkeyuser - Fetch the latest MonkeyUser comic
ping - Verify bot connectivity
roll - Roll some dice (`/roll [ 2d6 | 1d10 | etc ]`)
slap - Slap somone around a bit (`/slap `)
smbc - Fetch the latest smbc comic
xkcd - Retrieve an XKCD comic (`/xkcd [id]`)

> #### ℹ️ Parameters
>
> - Parameters in angled brackets (`<...>`) are REQUIRED.
> - Parameters in square braces (`[...]`) are OPTIONAL.

Troubleshooting
---------------

Please report bugs to the [GitHub Issue Tracker](https://github.com/PHLAK/inner-circle-bot/issues).

Copyright
---------

This project is licensed under the [MIT License](https://github.com/PHLAK/inner-circle-bot/blob/master/LICENSE).