added telegram api support to send message on ip update

This commit is contained in:
max mustermann 2019-05-08 19:19:42 +02:00
parent 3b7e78193a
commit 846a32ee7e
7 changed files with 162 additions and 65 deletions

View File

@ -15,8 +15,13 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="59c80f39-2468-4db0-9afd-14b8acdbffed" name="Default Changelist" comment=""> <list default="true" id="59c80f39-2468-4db0-9afd-14b8acdbffed" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/api/TelegramAPI.cpp" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/api/TelegramAPI.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/API.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/API.cpp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/CMakeLists.txt" beforeDir="false" afterPath="$PROJECT_DIR$/CMakeLists.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/API.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/api/API.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/API.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/api/API.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main.cpp" afterDir="false" />
</list> </list>
<ignored path="$PROJECT_DIR$/cmake-build-debug/" /> <ignored path="$PROJECT_DIR$/cmake-build-debug/" />
<ignored path="$PROJECT_DIR$/CMakeFiles/" /> <ignored path="$PROJECT_DIR$/CMakeFiles/" />
@ -32,28 +37,19 @@
<component name="ExecutionTargetManager" SELECTED_TARGET="CMakeBuildProfile:Debug" /> <component name="ExecutionTargetManager" SELECTED_TARGET="CMakeBuildProfile:Debug" />
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/CMakeLists.txt"> <entry file="file://$PROJECT_DIR$/CMakeLists.txt">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180"> <state relative-caret-position="330">
<caret line="12" selection-start-line="12" selection-end-line="12" /> <caret line="22" column="8" selection-start-line="22" selection-start-column="8" selection-end-line="22" selection-end-column="8" />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/API.h"> <entry file="file://$PROJECT_DIR$/src/api/API.cpp">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210"> <state relative-caret-position="243">
<caret line="14" column="36" selection-start-line="14" selection-start-column="36" selection-end-line="14" selection-end-column="36" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/API.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="18" selection-start-line="18" selection-end-line="18" /> <caret line="18" selection-start-line="18" selection-end-line="18" />
<folding> <folding>
<element signature="e#40#56#0" expanded="true" /> <element signature="e#40#56#0" expanded="true" />
@ -62,6 +58,27 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/api/TelegramAPI.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="26" selection-start-line="8" selection-start-column="26" selection-end-line="8" selection-end-column="26" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/api/TelegramAPI.h">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="2" lean-forward="true" selection-start-column="2" selection-end-column="2" />
<folding>
<element signature="e#110#127#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Hashmap.h"> <entry file="file://$PROJECT_DIR$/src/Hashmap.h">
<provider selected="true" editor-type-id="text-editor" /> <provider selected="true" editor-type-id="text-editor" />
@ -70,8 +87,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main.cpp"> <entry file="file://$PROJECT_DIR$/src/main.cpp">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330"> <state relative-caret-position="528">
<caret line="22" selection-start-line="22" selection-end-line="22" /> <caret line="58" column="27" lean-forward="true" selection-start-line="58" selection-start-column="27" selection-end-line="58" selection-end-column="27" />
<folding> <folding>
<element signature="e#0#19#0" expanded="true" /> <element signature="e#0#19#0" expanded="true" />
</folding> </folding>
@ -127,18 +144,21 @@
<option value="$PROJECT_DIR$/API.cpp" /> <option value="$PROJECT_DIR$/API.cpp" />
<option value="$PROJECT_DIR$/.gitignore" /> <option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/src/Logger.h" /> <option value="$PROJECT_DIR$/src/Logger.h" />
<option value="$PROJECT_DIR$/CMakeLists.txt" />
<option value="$PROJECT_DIR$/src/Logger.cpp" /> <option value="$PROJECT_DIR$/src/Logger.cpp" />
<option value="$PROJECT_DIR$/src/main.cpp" />
<option value="$PROJECT_DIR$/src/API.cpp" /> <option value="$PROJECT_DIR$/src/API.cpp" />
<option value="$PROJECT_DIR$/src/api/API.cpp" />
<option value="$PROJECT_DIR$/src/api/TelegramAPI.h" />
<option value="$PROJECT_DIR$/src/api/TelegramAPI.cpp" />
<option value="$PROJECT_DIR$/src/main.cpp" />
<option value="$PROJECT_DIR$/CMakeLists.txt" />
</list> </list>
</option> </option>
</component> </component>
<component name="ProjectFrameBounds" extendedState="6"> <component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="1020" /> <option name="x" value="-1" />
<option name="y" value="236" /> <option name="y" value="25" />
<option name="width" value="1914" /> <option name="width" value="1922" />
<option name="height" value="1051" /> <option name="height" value="1056" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" /> <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView"> <component name="ProjectView">
@ -146,7 +166,6 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
@ -161,17 +180,19 @@
</path> </path>
<path> <path>
<item name="iprefresher" type="b2602c69:ProjectViewProjectNode" /> <item name="iprefresher" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" /> <item name="DynuIPRefresher" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="api" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path> <path>
<item name="iprefresher" type="b2602c69:ProjectViewProjectNode" /> <item name="iprefresher" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" /> <item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
<item name="Header Search Paths" type="70bed36:NamedLibraryElementNode" />
</path> </path>
</expand> </expand>
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -184,12 +205,13 @@
<property name="settings.editor.selected.configurable" value="CLionExternalConfigurable" /> <property name="settings.editor.selected.configurable" value="CLionExternalConfigurable" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/src" />
</key>
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$" /> <recent name="$PROJECT_DIR$" />
</key> </key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/src/api" />
<recent name="$PROJECT_DIR$/src" />
</key>
</component> </component>
<component name="RunDashboard"> <component name="RunDashboard">
<option name="ruleStates"> <option name="ruleStates">
@ -226,6 +248,7 @@
<workItem from="1557047487321" duration="761000" /> <workItem from="1557047487321" duration="761000" />
<workItem from="1557061811880" duration="10758000" /> <workItem from="1557061811880" duration="10758000" />
<workItem from="1557135515205" duration="1933000" /> <workItem from="1557135515205" duration="1933000" />
<workItem from="1557335004023" duration="837000" />
</task> </task>
<task id="LOCAL-00001" summary="edited api class and made it to work"> <task id="LOCAL-00001" summary="edited api class and made it to work">
<created>1557063528491</created> <created>1557063528491</created>
@ -276,11 +299,18 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1557161378116</updated> <updated>1557161378116</updated>
</task> </task>
<option name="localTasksCounter" value="8" /> <task id="LOCAL-00008" summary="some structure updates">
<created>1557171797551</created>
<option name="number" value="00008" />
<option name="presentableId" value="LOCAL-00008" />
<option name="project" value="LOCAL" />
<updated>1557171797551</updated>
</task>
<option name="localTasksCounter" value="9" />
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="32403000" /> <option name="totallyTimeSpent" value="33265000" />
</component> </component>
<component name="TodoView"> <component name="TodoView">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
@ -292,26 +322,26 @@
</todo-panel> </todo-panel>
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="1919" y="0" width="1922" height="1081" extended-state="6" /> <frame x="-1" y="25" width="1922" height="1056" extended-state="6" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26307365" /> <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26627535" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" /> <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" /> <window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Inspection Results" weight="0.32916668" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" /> <window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" weight="0.31770834" /> <window_info anchor="bottom" id="Run" order="2" weight="0.31764707" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" /> <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" /> <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" /> <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32916668" /> <window_info anchor="bottom" id="TODO" order="6" weight="0.32916668" />
<window_info anchor="bottom" id="Database Changes" order="7" /> <window_info anchor="bottom" id="Database Changes" order="7" />
<window_info anchor="bottom" id="Messages" order="8" visible="true" weight="0.32604167" /> <window_info active="true" anchor="bottom" id="Messages" order="8" visible="true" weight="0.32513368" />
<window_info anchor="bottom" id="Terminal" order="9" weight="0.32916668" /> <window_info anchor="bottom" id="Terminal" order="9" weight="0.32916668" />
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" /> <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
<window_info anchor="bottom" id="Version Control" order="11" weight="0.32916668" /> <window_info anchor="bottom" id="Version Control" order="11" weight="0.32916668" />
<window_info anchor="bottom" id="CMake" order="12" weight="0.328125" /> <window_info anchor="bottom" id="CMake" order="12" weight="0.328125" />
<window_info anchor="bottom" id="Inspection Results" order="13" weight="0.32916668" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" /> <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" /> <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" /> <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@ -328,16 +358,14 @@
<MESSAGE value="log on error" /> <MESSAGE value="log on error" />
<MESSAGE value="syntax update and sperate variable for dynu domain id" /> <MESSAGE value="syntax update and sperate variable for dynu domain id" />
<MESSAGE value="reformated output of main" /> <MESSAGE value="reformated output of main" />
<option name="LAST_COMMIT_MESSAGE" value="reformated output of main" /> <MESSAGE value="some structure updates" />
<option name="LAST_COMMIT_MESSAGE" value="some structure updates" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/test.cpp" /> <entry file="file://$PROJECT_DIR$/test.cpp" />
<entry file="file://$PROJECT_DIR$/test.h" /> <entry file="file://$PROJECT_DIR$/test.h" />
<entry file="file://$PROJECT_DIR$/cmake_install.cmake" /> <entry file="file://$PROJECT_DIR$/cmake_install.cmake" />
<entry file="file://$PROJECT_DIR$/iprefresher.cbp" /> <entry file="file://$PROJECT_DIR$/iprefresher.cbp" />
<entry file="file://$PROJECT_DIR$/src/Hashmap.h">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore"> <entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="424"> <state relative-caret-position="424">
@ -346,13 +374,17 @@
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/cmake-build-debug/out.myfile" /> <entry file="file://$PROJECT_DIR$/cmake-build-debug/out.myfile" />
<entry file="file://$PROJECT_DIR$/src/Logger.h"> <entry file="file://$PROJECT_DIR$/cmake-build-debug/CMakeCache.txt" />
<entry file="file://$PROJECT_DIR$/src/api/API.h">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120"> <state relative-caret-position="210">
<caret line="8" column="14" selection-start-line="8" selection-start-column="14" selection-end-line="8" selection-end-column="14" /> <caret line="14" column="36" selection-start-line="14" selection-start-column="36" selection-end-line="14" selection-end-column="36" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/Hashmap.h">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/cmake-build-debug/dynurefresher.log"> <entry file="file://$PROJECT_DIR$/cmake-build-debug/dynurefresher.log">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195"> <state relative-caret-position="195">
@ -363,14 +395,33 @@
<entry file="file://$PROJECT_DIR$/cmake-build-debug/ip.txt"> <entry file="file://$PROJECT_DIR$/cmake-build-debug/ip.txt">
<provider selected="true" editor-type-id="text-editor" /> <provider selected="true" editor-type-id="text-editor" />
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/API.h"> <entry file="file://$PROJECT_DIR$/src/Logger.h">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210"> <state relative-caret-position="120">
<caret line="14" column="36" selection-start-line="14" selection-start-column="36" selection-end-line="14" selection-end-column="36" /> <caret line="8" column="14" selection-start-line="8" selection-start-column="14" selection-end-line="8" selection-end-column="14" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/api/TelegramAPI.h">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="2" lean-forward="true" selection-start-column="2" selection-end-column="2" />
<folding>
<element signature="e#110#127#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/api/API.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="243">
<caret line="18" selection-start-line="18" selection-end-line="18" />
<folding>
<element signature="e#40#56#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/cmake-build-debug/CMakeCache.txt" />
<entry file="file://$PROJECT_DIR$/src/Logger.cpp"> <entry file="file://$PROJECT_DIR$/src/Logger.cpp">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="555"> <state relative-caret-position="555">
@ -381,10 +432,17 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/api/TelegramAPI.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="26" selection-start-line="8" selection-start-column="26" selection-end-line="8" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main.cpp"> <entry file="file://$PROJECT_DIR$/src/main.cpp">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330"> <state relative-caret-position="528">
<caret line="22" selection-start-line="22" selection-end-line="22" /> <caret line="58" column="27" lean-forward="true" selection-start-line="58" selection-start-column="27" selection-end-line="58" selection-end-column="27" />
<folding> <folding>
<element signature="e#0#19#0" expanded="true" /> <element signature="e#0#19#0" expanded="true" />
</folding> </folding>
@ -393,18 +451,8 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/CMakeLists.txt"> <entry file="file://$PROJECT_DIR$/CMakeLists.txt">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180"> <state relative-caret-position="330">
<caret line="12" selection-start-line="12" selection-end-line="12" /> <caret line="22" column="8" selection-start-line="22" selection-start-column="8" selection-end-line="22" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/API.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="18" selection-start-line="18" selection-end-line="18" />
<folding>
<element signature="e#40#56#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>

View File

@ -7,7 +7,20 @@ find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIR}) include_directories(${CURL_INCLUDE_DIR})
set(SOURCE src/main.cpp src/API.h src/API.cpp src/Hashmap.h src/Logger.cpp src/Logger.h) set(SOURCE
src/main.cpp
src/api/API.h
src/api/API.cpp
src/Hashmap.h
src/Logger.cpp
src/Logger.h
src/api/TelegramAPI.cpp
src/api/TelegramAPI.h
)
add_executable(iprefresher ${SOURCE}) add_executable(iprefresher ${SOURCE})

View File

@ -3,7 +3,7 @@
// //
#include "API.h" #include "API.h"
#include "Hashmap.h" #include "../Hashmap.h"
#include <string> #include <string>
#include <iostream> #include <iostream>

View File

@ -7,7 +7,7 @@
#include <string> #include <string>
#include "Hashmap.h" #include "../Hashmap.h"
class API { class API {
public: public:

10
src/api/TelegramAPI.cpp Normal file
View File

@ -0,0 +1,10 @@
//
// Created by lukas on 08.05.19.
//
#include "TelegramAPI.h"
void TelegramAPI::sendMessage(std::string text) {
std::string reply = request("https://api.telegram.org/bot"+ apikey + "/sendmessage?chat_id="+chatid+"&text="+text);
std::cout << "[DEBUG] " <<reply << std::endl;
}

22
src/api/TelegramAPI.h Normal file
View File

@ -0,0 +1,22 @@
//
// Created by lukas on 08.05.19.
//
#ifndef IPREFRESHER_TELEGRAMAPI_H
#define IPREFRESHER_TELEGRAMAPI_H
#include <string>
#include "API.h"
class TelegramAPI : API{
public:
void sendMessage(std::string text);
private:
std::string apikey = "717213769:AAHan1nSXhUsxLJAN1Dv8Oc0z8wqwDdYPn4";
std::string chatid = "618154204";
};
#endif //IPREFRESHER_TELEGRAMAPI_H

View File

@ -1,8 +1,9 @@
#include <iostream> #include <iostream>
#include <ctime> #include <ctime>
#include "API.h" #include "api/API.h"
#include "Logger.h" #include "Logger.h"
#include "api/TelegramAPI.h"
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
@ -57,6 +58,9 @@ int main(int argc, char *argv[]) {
if (dynurepl != "{\"statusCode\":200}") { if (dynurepl != "{\"statusCode\":200}") {
logger.logToLogfile(" [ERROR] failed to write ip to dynu api!"); logger.logToLogfile(" [ERROR] failed to write ip to dynu api!");
} else{
TelegramAPI tele;
tele.sendMessage(oldip + " moved to " + ip);
} }
logger.safeip(ip); logger.safeip(ip);