Skip to content

Instantly share code, notes, and snippets.

@Yardanico
Created March 28, 2017 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yardanico/28f0183257825e97222cd1dccf4fc9fb to your computer and use it in GitHub Desktop.
Save Yardanico/28f0183257825e97222cd1dccf4fc9fb to your computer and use it in GitHub Desktop.
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