Commit f83b2b2e authored by LONGMAN's avatar LONGMAN

Updated structure.sql

parent 9ccfccd4
......@@ -14,7 +14,7 @@ A Telegram Bot based on the official [Telegram Bot API](https://core.telegram.or
## introduction
This is a pure php Telegram Bot, fully extensible via plugins. Telegram recently announced official support for a [Bot API](https://telegram.org/blog/bot-revolution) allowing integrators of all sorts to bring automated interactions to the mobile platform. This Bot aims to provide a platform where one could simply write a plugin and have interactions in a matter of minutes.
This is a pure php Telegram Bot, fully extensible via plugins. Telegram recently announced official support for a [Bot API](https://telegram.org/blog/bot-revolution) allowing integrators of all sorts to bring automated interactions to the mobile platform. This Bot aims to provide a platform where one could simply write a plugin and have interactions in a matter of minutes.
The Bot support Reply Markup and handle commands in the group chat.
......@@ -143,7 +143,7 @@ try {
}
```
If you want insert in database messages for further usage in commands, create database and import structure.sql and enable mysql support after object creation and BEFORE handle method
If you want insert in database messages/users for further usage in commands, create database and import structure.sql and enable mysql support after object creation and BEFORE handle method
```php
<?php
......
......@@ -30,7 +30,7 @@ class Telegram
*
* @var string
*/
protected $version = '0.0.10';
protected $version = '0.0.11';
/**
* Telegram API key
......
CREATE TABLE `messages` (
`update_id` bigint UNSIGNED COMMENT 'The update\'s unique identifier.',
`message_id` bigint COMMENT 'Unique message identifier',
`from` CHAR(255) COMMENT 'User object',
`user_id` bigint COMMENT 'User identifier',
`date` int(11) UNSIGNED COMMENT 'Date the message was sent in Unix time',
`chat` CHAR(255) COMMENT 'User or GroupChat object. Conversation the message belongs to — user in case of a private message, GroupChat in case of a group',
`forward_from` CHAR(255) DEFAULT '' COMMENT 'User object. For forwarded messages, sender of the original message',
......@@ -22,5 +22,15 @@ CREATE TABLE `messages` (
`delete_chat_photo` tinyint(1) DEFAULT 0 COMMENT 'Informs that the group photo was deleted',
`group_chat_created` tinyint(1) DEFAULT 0 COMMENT 'Informs that the group has been created',
PRIMARY KEY (`update_id`),
KEY `message_id` (`message_id`)
KEY `message_id` (`message_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
CREATE TABLE `users` (
`id` bigint UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Unique user identifier',
`username` CHAR(255) NOT NULL DEFAULT '' COMMENT 'User username',
`first_name` CHAR(255) NOT NULL DEFAULT '' COMMENT 'User first name',
`last_name` CHAR(255) NOT NULL DEFAULT '' COMMENT 'User last name',
PRIMARY KEY (`id`),
KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment