https://github.com/marty1885/jami-cpp
Client (and bot) library for GNU Jami in C++
https://github.com/marty1885/jami-cpp
chatbot jami
Last synced: over 1 year ago
JSON representation
Client (and bot) library for GNU Jami in C++
- Host: GitHub
- URL: https://github.com/marty1885/jami-cpp
- Owner: marty1885
- License: mit
- Created: 2022-01-15T12:16:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-24T08:58:02.000Z (over 4 years ago)
- Last Synced: 2025-02-01T08:12:27.354Z (over 1 year ago)
- Topics: chatbot, jami
- Language: C++
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jami-cpp
A basic (enough to build a chatbot) and easy to use GNU Jami API library in C++17. The API is modeled after [reo7sp/tgbot-cpp][1]
## Dependencies
* sdbus
## Sample
```cpp
#include
using namespace jamipp;
int main()
{
jamipp::init("jampp.example.echobot");
auto account = jamipp::getAccountById("your-jami-id-here");
assert(accont != nullptr);
account->onNonCommandMessage([&account](Message::Ptr message) {
if(message->type != "text/plain")
return;
account->sendMessage(message->conversation_id, message->body);
});
account->onCommand("syn", [&account](Message::Ptr message) {
account->sendMessage(message->conversation_id, "syn/ack!");
});
jamipp::run();
}
```
## TODOs:
- [ ] Mark messages seen by the bot as read
- [ ] Get display name of remote user
- [ ] Allow refusing conversation request
[1]: https://github.com/reo7sp/tgbot-cpp