rubjs 3.1.2 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,6 @@ declare class InlineMessage implements InlineMessageType {
11
11
  store: Record<string, any>;
12
12
  bot: Bot;
13
13
  constructor(bot: Bot, update: InlineMessageType);
14
- reply(text: string, chat_keypad?: Keypad, inline_keypad?: InlineKeypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<void>;
14
+ reply(text: string, chat_keypad?: Keypad, inline_keypad?: InlineKeypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<import("../types/models").SendMessage>;
15
15
  }
16
16
  export default InlineMessage;
@@ -21,7 +21,7 @@ class InlineMessage {
21
21
  this.message_id = update.message_id;
22
22
  }
23
23
  async reply(text, chat_keypad, inline_keypad, disable_notification = false, reply_to_message_id, chat_keypad_type) {
24
- await this.bot.sendMessage(this.chat_id, text, chat_keypad, inline_keypad, disable_notification, reply_to_message_id, chat_keypad_type);
24
+ return await this.bot.sendMessage(this.chat_id, text, chat_keypad, inline_keypad, disable_notification, reply_to_message_id, chat_keypad_type);
25
25
  }
26
26
  }
27
27
  exports.default = InlineMessage;
@@ -10,8 +10,8 @@ declare class Message implements Update {
10
10
  store: Record<string, any>;
11
11
  bot: Bot;
12
12
  constructor(bot: Bot, update: Update);
13
- reply(text: string, chat_keypad?: Keypad, inline_keypad?: InlineKeypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<void>;
14
- forward(to_chat_id: string, disable_notification?: boolean): Promise<void>;
15
- delete(): Promise<void>;
13
+ reply(text: string, chat_keypad?: Keypad, inline_keypad?: InlineKeypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<import("../types/models").SendMessage>;
14
+ forward(to_chat_id: string, disable_notification?: boolean): Promise<import("../types/models").SendMessage | undefined>;
15
+ delete(): Promise<import("../types/models").SendMessage | undefined>;
16
16
  }
17
17
  export default Message;
@@ -21,19 +21,19 @@ class Message {
21
21
  this.removed_message_id = update.removed_message_id;
22
22
  }
23
23
  async reply(text, chat_keypad, inline_keypad, disable_notification = false, reply_to_message_id, chat_keypad_type) {
24
- await this.bot.sendMessage(this.chat_id, text, chat_keypad, inline_keypad, disable_notification, reply_to_message_id, chat_keypad_type);
24
+ return await this.bot.sendMessage(this.chat_id, text, chat_keypad, inline_keypad, disable_notification, reply_to_message_id, chat_keypad_type);
25
25
  }
26
26
  async forward(to_chat_id, disable_notification = false) {
27
27
  const message_id = this.new_message?.message_id || this.updated_message?.message_id;
28
28
  if (!message_id)
29
29
  return;
30
- await this.bot.forwardMessage(this.chat_id, message_id, to_chat_id, disable_notification);
30
+ return await this.bot.forwardMessage(this.chat_id, message_id, to_chat_id, disable_notification);
31
31
  }
32
32
  async delete() {
33
33
  const message_id = this.new_message?.message_id || this.updated_message?.message_id;
34
34
  if (!message_id)
35
35
  return;
36
- await this.bot.deleteMessage(this.chat_id, message_id);
36
+ return await this.bot.deleteMessage(this.chat_id, message_id);
37
37
  }
38
38
  }
39
39
  exports.default = Message;
@@ -1,4 +1,4 @@
1
1
  import Bot from '../../bot';
2
2
  import { ChatKeypadTypeEnum, Keypad } from '../../types/models';
3
- declare function sendContact(this: Bot, chat_id: string, first_name: string, last_name: string, phone_number: string, chat_keypad: Keypad, inline_keypad: Keypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<any>;
3
+ declare function sendContact(this: Bot, chat_id: string, first_name: string, last_name: string, phone_number: string, chat_keypad?: Keypad, inline_keypad?: Keypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<any>;
4
4
  export default sendContact;
@@ -1,4 +1,4 @@
1
1
  import Bot from '../../bot';
2
2
  import { ChatKeypadTypeEnum, Keypad } from '../../types/models';
3
- declare function sendLocation(this: Bot, chat_id: string, latitude: string, longitude: string, chat_keypad: Keypad, inline_keypad: Keypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<any>;
3
+ declare function sendLocation(this: Bot, chat_id: string, latitude: string, longitude: string, chat_keypad?: Keypad, inline_keypad?: Keypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<any>;
4
4
  export default sendLocation;
@@ -28,7 +28,6 @@ class Network {
28
28
  if (res.statusCode === 200) {
29
29
  const responseData = await res.body.text();
30
30
  const data = JSONbig.parse(responseData);
31
- console.log(data);
32
31
  return JSON.parse(JSON.stringify(data));
33
32
  }
34
33
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rubjs",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "keywords": [