Skip to content

shackspace/shackibot2026

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

shacki_bot

New Telegram bot for shackspace status updates and basic chat interactions.

The bot:

  • fetches door state from the shackspace API,
  • answers direct commands in Telegram,
  • reacts to mentions in group chats,
  • posts periodic state-change notifications.

Repository Structure

  • shacki_tbot.py - main bot application.
  • README.md - this documentation.

Requirements

  • Python 3.10+
  • Telegram bot token
  • Internet access to https://api.shackspace.de/v1/space

Python dependencies used by the code:

  • python-telegram-bot
  • requests
  • pytz

Example install:

python3 -m venv .venv
source .venv/bin/activate
pip install python-telegram-bot requests pytz

Configuration

Runtime arguments:

  • --token (required): Telegram bot token (critical info, so is not contained in this repo).
  • --developer (optional): developer contact id shown in unknown command replies.

Running

Recommended:

source .venv/bin/activate
python3 shacki_tbot.py --token "<your_token>" --developer "<developer_contact_or_id>"

Bot Commands

  • /start - welcome message.
  • /help - command list.
  • /doorState - current cached door state (with friendly hint).
  • /doorStateDetailed - current state plus previous state and timestamps.
  • /plenum - placeholder response.
  • /version - bot version string.

Unknown commands are handled with a fallback response.

Message Handling Behavior

  • Private chat: responds to plain text messages.
  • Group/supergroup: responds only when the bot username mention (@shacki_bot) is present.
  • Includes simple keyword-based replies (hello, ping, door, etc.).

Door State Update Flow

  1. The bot calls https://api.shackspace.de/v1/space.
  2. Reads doorState.open from the JSON response.
  3. Converts it to open / closed.
  4. Stores timestamps in Europe/Berlin timezone.
  5. On state change, publishes notifications to configured groups.

Error cases are stored as Unknown: ... states and logged.

Security Notes

  • Do not commit real bot tokens to git history.
  • Prefer environment variables or secret management for production deployments.

Known Limitations

  • allowed_updates=[] in polling receives all update types, which may be broader than needed.
  • Conversation logic is intentionally simple and keyword-based.
  • API/network failures are surfaced as Unknown state instead of retries with backoff.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages