File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
22import vk_api
33from vk_api .keyboard import VkKeyboard , VkKeyboardColor
4+ from vk_api .utils import get_random_id
45
56
67def main ():
@@ -22,8 +23,9 @@ def main():
2223
2324 vk .messages .send (
2425 peer_id = 123456 ,
25- message = 'Пример клавиатуры' ,
26- keyboard = keyboard .get_keyboard ()
26+ random_id = get_random_id (),
27+ keyboard = keyboard .get_keyboard (),
28+ message = 'Пример клавиатуры'
2729 )
2830
2931
Original file line number Diff line number Diff line change 55import vk_api
66from vk_api import VkUpload
77from vk_api .longpoll import VkLongPoll , VkEventType
8+ from vk_api .utils import get_random_id
89
910
1011def main ():
@@ -51,6 +52,7 @@ def main():
5152 if not text :
5253 vk .messages .send (
5354 user_id = event .user_id ,
55+ random_id = get_random_id (),
5456 message = 'No results'
5557 )
5658 print ('no results' )
@@ -69,6 +71,7 @@ def main():
6971 vk .messages .send (
7072 user_id = event .user_id ,
7173 attachment = ',' .join (attachments ),
74+ random_id = get_random_id (),
7275 message = text
7376 )
7477 print ('ok' )
Original file line number Diff line number Diff line change 99from __future__ import print_function
1010
1111import six
12+ import time
1213
1314try :
1415 import simplejson as json
@@ -35,6 +36,10 @@ def clear_string(s):
3536 return s .strip ().replace (' ' , '' )
3637
3738
39+ def get_random_id ():
40+ return int (time .time () * 10000000 )
41+
42+
3843def code_from_number (prefix , postfix , number ):
3944 prefix_len = len (prefix )
4045 postfix_len = len (postfix )
You can’t perform that action at this time.
0 commit comments