Comparing version 1.1.5 to 1.1.6
{ | ||
"name": "puregram", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"main": "src/index.js", | ||
@@ -29,4 +29,5 @@ "repository": { | ||
"files": [ | ||
"src" | ||
"src", | ||
"typings" | ||
] | ||
} |
@@ -119,5 +119,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -124,0 +124,0 @@ /** |
@@ -185,6 +185,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.message.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -196,4 +196,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.message.id, | ||
@@ -200,0 +200,0 @@ ...params, |
@@ -118,5 +118,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -123,0 +123,0 @@ /** |
@@ -176,6 +176,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -187,4 +187,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -191,0 +191,0 @@ ...params, |
@@ -47,3 +47,3 @@ import Params from "../../typings/params"; | ||
public mediaGroupId?: string; | ||
public mediaId?: string; | ||
@@ -256,5 +256,5 @@ public authorSignature?: string; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -261,0 +261,0 @@ /** |
@@ -122,3 +122,3 @@ let { inspect } = require('util'); | ||
get mediaGroupId() { | ||
get mediaId() { | ||
return this.update.media_group_id || null; | ||
@@ -488,6 +488,6 @@ } | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -499,4 +499,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -728,3 +728,3 @@ ...params, | ||
editDate: this.editDate, | ||
mediaGroupId: this.mediaGroupId, | ||
mediaId: this.mediaId, | ||
authorSignature: this.authorSignature, | ||
@@ -731,0 +731,0 @@ text: this.text, |
@@ -115,5 +115,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -120,0 +120,0 @@ /** |
@@ -117,5 +117,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -122,0 +122,0 @@ /** |
@@ -174,6 +174,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -185,4 +185,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -189,0 +189,0 @@ ...params, |
@@ -41,3 +41,3 @@ import Params from "../../typings/params"; | ||
public mediaGroupId?: string; | ||
public mediaId?: string; | ||
@@ -250,5 +250,5 @@ public authorSignature?: string; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -255,0 +255,0 @@ /** |
@@ -122,3 +122,3 @@ let { inspect } = require('util'); | ||
get mediaGroupId() { | ||
get mediaId() { | ||
return this.update.media_group_id || null; | ||
@@ -488,6 +488,6 @@ } | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -499,4 +499,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -728,3 +728,3 @@ ...params, | ||
editDate: this.editDate, | ||
mediaGroupId: this.mediaGroupId, | ||
mediaId: this.mediaId, | ||
authorSignature: this.authorSignature, | ||
@@ -731,0 +731,0 @@ text: this.text, |
@@ -41,3 +41,3 @@ import Params from "../../typings/params"; | ||
public mediaGroupId?: string; | ||
public mediaId?: string; | ||
@@ -250,5 +250,5 @@ public authorSignature?: string; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -255,0 +255,0 @@ /** |
@@ -122,3 +122,3 @@ let { inspect } = require('util'); | ||
get mediaGroupId() { | ||
get mediaId() { | ||
return this.update.media_group_id || null; | ||
@@ -488,6 +488,6 @@ } | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -499,4 +499,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -728,3 +728,3 @@ ...params, | ||
editDate: this.editDate, | ||
mediaGroupId: this.mediaGroupId, | ||
mediaId: this.mediaId, | ||
authorSignature: this.authorSignature, | ||
@@ -731,0 +731,0 @@ text: this.text, |
@@ -117,5 +117,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -122,0 +122,0 @@ /** |
@@ -174,6 +174,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -185,4 +185,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -189,0 +189,0 @@ ...params, |
@@ -118,5 +118,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -123,0 +123,0 @@ /** |
@@ -117,5 +117,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -122,0 +122,0 @@ /** |
@@ -174,6 +174,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -185,4 +185,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -189,0 +189,0 @@ ...params, |
@@ -118,3 +118,3 @@ import Params from '../../typings/params'; | ||
*/ | ||
public mediaGroupId?: string; | ||
public mediaId?: string; | ||
@@ -485,5 +485,5 @@ /** | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -490,0 +490,0 @@ /** |
@@ -123,3 +123,3 @@ let { inspect } = require('util'); | ||
get mediaGroupId() { | ||
get mediaId() { | ||
return this.update.media_group_id || null; | ||
@@ -501,6 +501,6 @@ } | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -512,4 +512,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -745,3 +745,3 @@ ...params, | ||
editDate: this.editDate, | ||
mediaGroupId: this.mediaGroupId, | ||
mediaId: this.mediaId, | ||
authorSignature: this.authorSignature, | ||
@@ -748,0 +748,0 @@ text: this.text, |
@@ -117,5 +117,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -122,0 +122,0 @@ /** |
@@ -117,5 +117,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -122,0 +122,0 @@ /** |
@@ -117,5 +117,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -122,0 +122,0 @@ /** |
@@ -176,6 +176,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -187,4 +187,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -191,0 +191,0 @@ ...params, |
@@ -117,5 +117,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -122,0 +122,0 @@ /** |
@@ -180,6 +180,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -191,4 +191,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -195,0 +195,0 @@ ...params, |
@@ -117,5 +117,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -122,0 +122,0 @@ /** |
@@ -174,6 +174,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -185,4 +185,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -189,0 +189,0 @@ ...params, |
@@ -117,5 +117,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -122,0 +122,0 @@ /** |
@@ -178,6 +178,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -189,4 +189,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -193,0 +193,0 @@ ...params, |
@@ -26,4 +26,12 @@ import Params from "../../typings/params"; | ||
public correctOptionId?: number; | ||
public explanation?: string; | ||
public explanationEntities?: Array<Interfaces.IMessageEntity>; | ||
public openPeriod?: number; | ||
public closePeriod?: number; | ||
} | ||
export = Poll; |
let { inspect } = require('util'); | ||
let Context = require('./context'); | ||
let MessageEntity = require('../structures/message-entity'); | ||
@@ -48,2 +49,24 @@ class Poll extends Context { | ||
get explanation() { | ||
return this.update.explanation || null; | ||
} | ||
get explanationEntities() { | ||
let { explanation_entities } = this.update; | ||
if (!explanation_entities) return null; | ||
return explanation_entities.map( | ||
e => new MessageEntity(e), | ||
); | ||
} | ||
get openPeriod() { | ||
return this.update.open_period || null; | ||
} | ||
get closePeriod() { | ||
return this.update.close_period || null; | ||
} | ||
[inspect.custom](depth, options) { | ||
@@ -61,3 +84,7 @@ let { name } = this.constructor; | ||
allowsMultipleAnswers: this.allowsMultipleAnswers, | ||
correctOptionId: this.correctOptionId | ||
correctOptionId: this.correctOptionId, | ||
explanation: this.explanation, | ||
explanationEntities: this.explanationEntities, | ||
openPeriod: this.openPeriod, | ||
closePeriod: this.closePeriod | ||
}; | ||
@@ -64,0 +91,0 @@ |
@@ -48,3 +48,3 @@ import Params from "../../typings/params"; | ||
public mediaGroupId?: string; | ||
public mediaId?: string; | ||
@@ -257,5 +257,5 @@ public authorSignature?: string; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -262,0 +262,0 @@ /** |
@@ -87,3 +87,3 @@ let { inspect } = require('util'); | ||
get mediaGroupId() { | ||
get mediaId() { | ||
return this.context.media_group_id || null; | ||
@@ -262,3 +262,3 @@ } | ||
editDate: this.editDate, | ||
mediaGroupId: this.mediaGroupId, | ||
mediaId: this.mediaId, | ||
authorSignature: this.authorSignature, | ||
@@ -265,0 +265,0 @@ text: this.text, |
@@ -119,5 +119,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -124,0 +124,0 @@ /** |
@@ -175,6 +175,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -186,4 +186,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -190,0 +190,0 @@ ...params, |
@@ -119,5 +119,5 @@ import Params from "../../typings/params"; | ||
*/ | ||
public sendMediaGroup(mediaGroup: Interfaces.IInputFile | string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public sendMediaGroup(media: Array<Interfaces.IInputMediaPhoto | Interfaces.IInputMediaVideo>, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(mediaGroup: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
public replyWithMediaGroup(media: string, params: Params.ISendMediaGroupParams): Promise<MessageContext>; | ||
@@ -124,0 +124,0 @@ /** |
@@ -174,6 +174,6 @@ let { inspect } = require('util'); | ||
async sendMediaGroup(mediaGroup, params = {}) { | ||
async sendMediaGroup(media, params = {}) { | ||
let response = await this.telegram.api.sendMediaGroup({ | ||
chat_id: this.chatId, | ||
media_group: mediaGroup, | ||
media, | ||
...params, | ||
@@ -185,4 +185,4 @@ }); | ||
replyWithMediaGroup(mediaGroup, params = {}) { | ||
return this.sendMediaGroup(mediaGroup, { | ||
replyWithMediaGroup(media, params = {}) { | ||
return this.sendMediaGroup(media, { | ||
reply_to_message_id: this.id, | ||
@@ -189,0 +189,0 @@ ...params, |
@@ -8,2 +8,6 @@ let { inspect } = require('util'); | ||
get emoji() { | ||
return this.payload.emoji; | ||
} | ||
get value() { | ||
@@ -13,2 +17,10 @@ return this.payload.value; | ||
get isDice() { | ||
return this.emoji === '🎲'; | ||
} | ||
get isDarts() { | ||
return this.emoji === '🎯'; | ||
} | ||
[inspect.custom](depth, options) { | ||
@@ -19,2 +31,5 @@ let { name } = this.constructor; | ||
value: this.value, | ||
emoji: this.emoji, | ||
isDice: this.isDice, | ||
isDarts: this.isDarts | ||
}; | ||
@@ -21,0 +36,0 @@ |
let { inspect } = require('util'); | ||
let PollOption = require('./poll-option') | ||
let MessageEntity = require('./message-entity'); | ||
class PollAttachment { | ||
@@ -21,3 +24,5 @@ constructor(payload) { | ||
get options() { | ||
return this.payload.options; | ||
return this.payload.options.map( | ||
option => new PollOption(option) | ||
); | ||
} | ||
@@ -30,3 +35,3 @@ | ||
get isClosed() { | ||
return this.payload.isClosed; | ||
return this.payload.is_closed; | ||
} | ||
@@ -38,3 +43,3 @@ | ||
get type() { | ||
get pollType() { | ||
return this.payload.type; | ||
@@ -48,5 +53,27 @@ } | ||
get correctOptionId() { | ||
return this.payload.correct_iption_id || null; | ||
return this.payload.correct_option_id || null; | ||
} | ||
get explanation() { | ||
return this.payload.explanation || null; | ||
} | ||
get explanationEntities() { | ||
let { explanation_entities } = this.payload; | ||
if (!explanation_entities) return null; | ||
return explanation_entities.map( | ||
e => new MessageEntity(e), | ||
); | ||
} | ||
get openPeriod() { | ||
return this.payload.open_period || null; | ||
} | ||
get closePeriod() { | ||
return this.payload.close_period || null; | ||
} | ||
toString() { | ||
@@ -60,6 +87,15 @@ return this.id; | ||
let payloadToInspect = { | ||
iq: this.iq, | ||
id: this.id, | ||
question: this.question, | ||
options: this.options, | ||
totalVoterCount: this.totalVoterCount, | ||
isClosed: this.isClosed, | ||
isAnonymous: this.isAnonymous, | ||
type: this.type, | ||
allowsMultipleAnswers: this.allowsMultipleAnswers, | ||
correctOptionId: this.correctOptionId, | ||
explanation: this.explanation, | ||
explanationEntities: this.explanationEntities, | ||
openPeriod: this.openPeriod, | ||
closePeriod: this.closePeriod | ||
}; | ||
@@ -69,3 +105,3 @@ | ||
return `${options.stylize(name, 'special')} <${options.stylize(this.toString(), 'string')}> ${payload}`; | ||
return `${options.stylize(name, 'special')} ${payload}`; | ||
} | ||
@@ -72,0 +108,0 @@ } |
@@ -104,3 +104,3 @@ let middlewareIo = require('middleware-io'); | ||
} | ||
use(...middlewares) { | ||
@@ -107,0 +107,0 @@ middlewares.forEach((middleware) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
718007
110
21613