trgwii / Telegram-bot-C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telegram bot in C

Requires libcurl-dev and libsqlite3-dev to build.

Zig is recommended, but not required.

Quick Start

For gcc, edit build.h line 10 to #define CC "gcc"

./build.c all
# or:
# zig run -lc build.c -- all
# or (with gcc):
# gcc build.c -o build/build && ./build/build all

./build/main <token>

Organization

  • src/ contains all the source files.
  • build.h / build.c make up all the build scripts to build the project.
  • libcurl and libsqlite3 are required on the system in order to build the project, as well as curl on the command line.
  • Building the project will generate the following folders:
    • o contains intermediate object files.
    • test contains executables used for testing functions in the codebase.
    • build contains the output binary (final program).
  • Additionally, the bot will create the following at runtime:
    • bot.db is the sqlite3 database used to store rep points.
    • commands/ is a folder used to store saved custom commands.

TODO

  • Cleanup JSON handling in main
    • Explore more functions from json.h
  • Add people to DB immediately if they try to issue a command and can't be found
  • Investigate building libcurl + libsqlite3 statically from source

About


Languages

Language:C 100.0%