-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
201 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
DROP TABLE IF EXISTS settings; | ||
DROP TABLE IF EXISTS messages; | ||
DROP TABLE IF EXISTS initDataCheck; | ||
DROP TABLE IF EXISTS users; | ||
DROP TABLE IF EXISTS tokens; | ||
DROP TABLE IF EXISTS calendars; | ||
DROP TABLE IF EXISTS users; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const sendGreeting = async (chatId, replyToMessageId, telegram) => { | ||
return await telegram.sendMessage(chatId, "Hello\\!\n\n Access [the calendar](https://t.me/group_meetup_bot/calendar) to set your availability and you will receive the voting link back", 'MarkdownV2', replyToMessageId); | ||
} | ||
|
||
const processMessage = async (json, app) => { | ||
const {telegram, db} = app; | ||
const chatId = json.message.chat.id; | ||
const replyToMessageId = json.message.message_id; | ||
|
||
|
||
const messageToSave = JSON.stringify(json, null, 2); | ||
|
||
if (json.message.text === '/start') { | ||
return await sendGreeting(chatId, replyToMessageId, telegram); | ||
} | ||
|
||
//await telegram.sendMessage(chatId, "```json" + messageToSave + "```", 'MarkdownV2', replyToMessageId); | ||
|
||
await db.addMessage(messageToSave, json.update_id); | ||
}; | ||
|
||
export { processMessage } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters