- Added telegram_command_bot.py with slash commands (/buySOL, /sellBTC, etc) - Docker compose setup with DNS configuration - Sends trades as plain text to n8n webhook (same format as TradingView) - Improved Telegram success message formatting - Only responds to authorized chat ID (579304651) - Commands: /buySOL, /sellSOL, /buyBTC, /sellBTC, /buyETH, /sellETH
139 lines
3.4 KiB
JSON
139 lines
3.4 KiB
JSON
{
|
|
"name": "Telegram Trade Trigger (Import to Money Machine)",
|
|
"nodes": [
|
|
{
|
|
"parameters": {
|
|
"httpMethod": "POST",
|
|
"path": "manual-telegram-trade",
|
|
"options": {}
|
|
},
|
|
"id": "webhook-telegram-manual",
|
|
"name": "Telegram Command Webhook",
|
|
"type": "n8n-nodes-base.webhook",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
-840,
|
|
460
|
|
],
|
|
"webhookId": "manual-telegram-trade-webhook"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"fields": {
|
|
"values": [
|
|
{
|
|
"name": "rawMessage",
|
|
"stringValue": "={{ $json.body.message || $json.body.text || $json.body }}"
|
|
},
|
|
{
|
|
"name": "symbol",
|
|
"stringValue": "={{ ($json.body.message || $json.body.text || $json.body).toString().match(/\\b(SOL|BTC|ETH)\\b/i) ? ($json.body.message || $json.body.text || $json.body).toString().match(/\\b(SOL|BTC|ETH)\\b/i)[0].toUpperCase() + '-PERP' : 'SOL-PERP' }}"
|
|
},
|
|
{
|
|
"name": "direction",
|
|
"stringValue": "={{ ($json.body.message || $json.body.text || $json.body).toString().match(/\\b(sell|short)\\b/i) ? 'short' : 'long' }}"
|
|
},
|
|
{
|
|
"name": "timeframe",
|
|
"stringValue": "5"
|
|
}
|
|
]
|
|
},
|
|
"options": {}
|
|
},
|
|
"id": "parse-telegram-manual",
|
|
"name": "Parse Manual Command",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 3.2,
|
|
"position": [
|
|
-660,
|
|
460
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"chatId": "579304651",
|
|
"text": "🤖 Manual trade command:\n\n📊 {{ $json.symbol }}\n📈 {{ $json.direction.toUpperCase() }}\n⏰ {{ $now.toFormat('HH:mm') }}\n\n⏳ Processing...",
|
|
"additionalFields": {
|
|
"appendAttribution": false
|
|
}
|
|
},
|
|
"id": "ack-manual-command",
|
|
"name": "Send Acknowledgment",
|
|
"type": "n8n-nodes-base.telegram",
|
|
"typeVersion": 1.1,
|
|
"position": [
|
|
-480,
|
|
460
|
|
],
|
|
"credentials": {
|
|
"telegramApi": {
|
|
"id": "Csk5cg4HtaSqP5jJ",
|
|
"name": "Telegram account"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"parameters": {
|
|
"mode": "raw",
|
|
"jsonOutput": "={{ $json }}",
|
|
"options": {}
|
|
},
|
|
"id": "ready-for-check-risk",
|
|
"name": "➡️ Connect to Check Risk",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 3.3,
|
|
"position": [
|
|
-300,
|
|
460
|
|
],
|
|
"notes": "Connect this output to the 'Check Risk' node in Money Machine"
|
|
}
|
|
],
|
|
"pinData": {},
|
|
"connections": {
|
|
"Telegram Command Webhook": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Parse Manual Command",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Parse Manual Command": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Send Acknowledgment",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Send Acknowledgment": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "➡️ Connect to Check Risk",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
}
|
|
},
|
|
"active": false,
|
|
"settings": {
|
|
"executionOrder": "v1"
|
|
},
|
|
"versionId": "telegram-webhook-v1",
|
|
"meta": {
|
|
"instanceId": "e766d4f0b5def8ee8cb8561cd9d2b9ba7733e1907990b6987bca40175f82c379"
|
|
},
|
|
"tags": []
|
|
}
|