@castery/caster-telegram
Advanced tools
Comparing version
@@ -43,4 +43,2 @@ "use strict"; | ||
}; | ||
console.log('Chat:', context.chat); | ||
console.log('Context:', context); | ||
const { | ||
@@ -108,3 +106,3 @@ type | ||
if (!Array.isArray(options.attachments)) { | ||
options.attachments = [options.attachments]; | ||
message.attachments = [options.attachments]; | ||
} else { | ||
@@ -111,0 +109,0 @@ message.attachments = options.attachments; |
@@ -14,2 +14,4 @@ "use strict"; | ||
var _fs = require("fs"); | ||
var _message = _interopRequireDefault(require("./contexts/message")); | ||
@@ -200,15 +202,29 @@ | ||
return this.telegram.sendPhoto(chatId, source); | ||
return this.telegram.sendPhoto(chatId, { | ||
source | ||
}); | ||
} | ||
if (type === 'voice') { | ||
return this.telegram.sendVoice(chatId, { | ||
source | ||
}); | ||
} | ||
if (type === 'video') { | ||
return this.telegram.sendVideo(chatId, source); | ||
return this.telegram.sendVideo(chatId, { | ||
source | ||
}); | ||
} | ||
if (type === 'audio') { | ||
return this.telegram.sendAudio(chatId, source); | ||
return this.telegram.sendAudio(chatId, { | ||
source | ||
}); | ||
} | ||
if (type === 'document') { | ||
return this.telegram.sendDocument(chatId, source); | ||
return this.telegram.sendDocument(chatId, { | ||
source | ||
}); | ||
} | ||
@@ -243,3 +259,3 @@ })); | ||
if ($text !== null) { | ||
if ($text) { | ||
$text = $text.replace(`@${this.options.username}`, ''); | ||
@@ -246,0 +262,0 @@ |
@@ -42,2 +42,3 @@ "use strict"; | ||
image: true, | ||
voice: true, | ||
video: true, | ||
@@ -44,0 +45,0 @@ document: true |
{ | ||
"name": "@castery/caster-telegram", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "🤖⛓️ The Telegram platform for caster", | ||
@@ -41,3 +41,3 @@ "main": "index.js", | ||
"chai": "^4.1.2", | ||
"eslint": "^4.11.0", | ||
"eslint": "^4.12.0", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
@@ -48,7 +48,7 @@ "eslint-plugin-import": "^2.8.0", | ||
"dependencies": { | ||
"@castery/caster": "^0.0.15", | ||
"@castery/caster": "^0.0.16", | ||
"debug": "^3.1.0", | ||
"joi": "^13.0.2", | ||
"telegraf": "^3.15.3" | ||
"telegraf": "^3.16.4" | ||
} | ||
} |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
15807
1.36%431
3.11%3
50%+ Added
- Removed
Updated
Updated