Browse Source

Directory is now sorted

main
Unbewohnte 3 years ago
parent
commit
1502d1b4dd
  1. 4
      vkImageSender/VkImageSender.py

4
vkImageSender/VkImageSender.py

@ -17,6 +17,8 @@ def sendImages(img_dir = ".", ID = 0, IS_GROUP_CHAT = False, TOKEN = ""):
vk = vk_api.VkApi(token = TOKEN).get_api() vk = vk_api.VkApi(token = TOKEN).get_api()
files = os.listdir(img_dir) files = os.listdir(img_dir)
files.sort()
counter = 1 counter = 1
for filename in files: for filename in files:
@ -32,7 +34,7 @@ def sendImages(img_dir = ".", ID = 0, IS_GROUP_CHAT = False, TOKEN = ""):
upload_img = upload.photo_messages(photos = path_to_image)[0] upload_img = upload.photo_messages(photos = path_to_image)[0]
# each message will contain "Counter : {number_of_}" # each message will contain "Counter : {number_of_}"
MESSAGE = "Counter :{}┃ The next appr. at ~ ┃{}".format(counter, MESSAGE = "Counter ┃{}┃ The next appr. at ~ ┃{}".format(counter,
datetime.datetime.now() + datetime.timedelta(seconds=4)) datetime.datetime.now() + datetime.timedelta(seconds=4))
# sending # sending
print("{}: Sending {}...".format(counter,filename)) print("{}: Sending {}...".format(counter,filename))

Loading…
Cancel
Save