Created
March 28, 2017 09:47
-
-
Save Yardanico/28f0183257825e97222cd1dccf4fc9fb to your computer and use it in GitHub Desktop.
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
import json, httpclient, queues | |
# We export all types and fileds from there to other modules | |
type | |
LongPollData* = object | |
key*: string | |
server*: string | |
ts*: int | |
Flags* {.pure.} = enum | |
Unread, Outbox, Replied, | |
Important, Chat, Friends, | |
Spam, Deleted, Fixed, Media | |
Command* = object | |
command*: string | |
arguments*: seq[string] | |
Message* = object | |
msgId*: int | |
peerId*: int | |
timestamp*: int | |
subject*: string | |
cmd*: Command | |
attachments*: JsonNode | |
ApiRequest* = object | |
api: VkApi, | |
methodName: string, | |
params: KeyVal , | |
token: string, | |
flood: bool | |
VkApi* = object | |
token*: string | |
http*: HttpClient | |
queu: Queue[ApiRequest] | |
VkBot* = object | |
api*: VkApi | |
lpData*: LongPollData | |
lpURL*: string | |
running*: bool | |
KeyVal* = openarray[tuple[key: string, val: string]] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment