68 lines
2.1 KiB
MQL5
68 lines
2.1 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Def.mqh |
|
|
//| Copyright 2025, Niquel Mendoza. |
|
|
//| https://www.mql5.com/es/users/nique_372 |
|
|
//+------------------------------------------------------------------+
|
|
#property copyright "Copyright 2025, Niquel Mendoza."
|
|
#property link "https://www.mql5.com/es/users/nique_372"
|
|
#property strict
|
|
|
|
#ifndef AIFULLTAB_SRC_TLG_DEF_MQH
|
|
#define AIFULLTAB_SRC_TLG_DEF_MQH
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
|
//--- Parametros de telegram
|
|
#define CHATELGRAM_E_ON_CHANGE_PARAM (250)
|
|
// lparam = id del parametro
|
|
// sparam = valor
|
|
// dparam = key
|
|
|
|
//--- Tipo de parametro que se modifica
|
|
#define TLGM_RECIBER_PARAM_TOKEN (0)
|
|
#define TLGM_RECIBER_PARAM_CHATID (1)
|
|
#define TLGM_RECIBER_PARAM_APIKEY (2)
|
|
#define TLGM_RECIBER_PARAM_MODELNAME (3)
|
|
#define TLGM_RECIBER_PARAM_MAXTOKENS (4)
|
|
#define TLGM_RECIBER_PARAM_CONFIG (5)
|
|
#define TLGM_RECIBER_PARAM_STATE (6)
|
|
|
|
|
|
//---
|
|
// Extra
|
|
#define TLGM_RECIBER_PARAM_SAVE_MEMORY (7)
|
|
#define TLGM_RECIBER_PARAM_LOAD_MEMORY (8)
|
|
|
|
//
|
|
#define TLG_RECIBER_BASE_MAX_LPARAM (TLGM_RECIBER_PARAM_LOAD_MEMORY)
|
|
|
|
//---
|
|
#define TLGM_RECIBIR_PARAM_CONFIG_IDX_FILEFLAGS (0)
|
|
#define TLGM_RECIBIR_PARAM_CONFIG_IDX_FILENAME (1)
|
|
|
|
//---
|
|
#define TlgLlmProtocolEmpaquetar(id, val) ((id)+"\""+(val))
|
|
bool TlgLlmProtocolDesempaquetar(const string& content, string& id, string& val)
|
|
{
|
|
const int start_c = content.Find("\"");
|
|
if(start_c == -1)
|
|
{
|
|
id = "";
|
|
val = "";
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
id = StringSubstr(content, 0, start_c);
|
|
val = StringSubstr(content, start_c + 1);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
#endif // AIFULLTAB_SRC_TLG_DEF_MQH
|
|
//+------------------------------------------------------------------+
|