yatbcpp  0.0.1
Yet another Telegram Bot CPP Library
chat_type.cc
Go to the documentation of this file.
1 // From JSON Specialication //
4 #include <string>
5 #include "types/telegram_type.h"
7 #include "types/chat_type.h"
8 
9 using namespace std;
10 
11 namespace yatbcpp {
17  template<> chat_type fromString(string Data) {
18  if(Data.compare("private")==0){
19  return chat_type::Private;
20  }
21  else if(Data.compare("group")==0){
22  return chat_type::Group;
23  }
24  else if(Data.compare("supergroup")==0){
25  return chat_type::Supergroup;
26  }
27  else if(Data.compare("channel")==0){
28  return chat_type::Channel;
29  }
30  else{
31  throw essential_key_missing("chat_type parsable key is not known how to be parsed to");
32  }
33  }
34 
35 }
chat_type fromString(string Data)
Definition: chat_type.cc:17
chat_type
Definition: chat_type.h:6
Definition: Bot.h:27