Files
trading_bot_v4/telegram-webhook-FINAL.json
mindesbunister 3e2cf2eec2 feat: add Telegram bot for manual trade commands
- 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
2025-10-27 00:23:09 +01:00

129 lines
3.5 KiB
JSON

{
"name": "Telegram Manual Trade - ADD TO MONEY MACHINE",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "telegram-trade",
"responseMode": "responseNode",
"options": {}
},
"id": "webhook",
"name": "Webhook Receiver",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1.1,
"position": [200, 300],
"webhookId": "telegram-trade-webhook"
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.body.message || $json.body.text || '' }}",
"operation": "regex",
"value2": "(buy|sell|long|short).*(sol|btc|eth)"
}
]
}
},
"id": "filter-trades",
"name": "Is Trade Command?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [400, 300]
},
{
"parameters": {
"values": {
"string": [
{
"name": "symbol",
"value": "={{ ($json.body.message || $json.body.text).toString().match(/\\b(SOL|BTC|ETH)\\b/i)[0].toUpperCase() }}-PERP"
},
{
"name": "direction",
"value": "={{ ($json.body.message || $json.body.text).toString().match(/\\b(sell|short)\\b/i) ? 'short' : 'long' }}"
},
{
"name": "timeframe",
"value": "5"
}
]
}
},
"id": "parse-command",
"name": "Parse Trade",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [600, 300]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ { \"status\": \"received\", \"symbol\": $json.symbol, \"direction\": $json.direction } }}"
},
"id": "webhook-response",
"name": "Webhook Response",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [800, 450]
},
{
"parameters": {
"chatId": "579304651",
"text": "🤖 Manual Trade\\n\\n📊 {{ $json.symbol }}\\n{{ $json.direction === 'long' ? '📈' : '📉' }} {{ $json.direction.toUpperCase() }}\\n⏰ {{ $now.format('HH:mm:ss') }}\\n\\n✅ Executing...",
"additionalFields": {
"appendAttribution": false
}
},
"id": "confirm",
"name": "Send Telegram Confirm",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.1,
"position": [800, 300],
"credentials": {
"telegramApi": {
"id": "Csk5cg4HtaSqP5jJ",
"name": "Telegram account"
}
}
},
{
"parameters": {},
"id": "output",
"name": "➡️ Connect to Check Risk",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1000, 300],
"notes": "Connect this output to your Money Machine's Check Risk node"
}
],
"connections": {
"Webhook Receiver": {
"main": [[
{"node": "Is Trade Command?", "type": "main", "index": 0}
]]
},
"Is Trade Command?": {
"main": [[
{"node": "Parse Trade", "type": "main", "index": 0}
]]
},
"Parse Trade": {
"main": [[
{"node": "Webhook Response", "type": "main", "index": 0},
{"node": "Send Telegram Confirm", "type": "main", "index": 0}
]]
},
"Send Telegram Confirm": {
"main": [[
{"node": "➡️ Connect to Check Risk", "type": "main", "index": 0}
]]
}
},
"active": false,
"settings": {},
"versionId": "telegram-webhook-final"
}