Queer European MD passionate about IT
Browse Source

Compliance with Telegram Bot API 6.5

Davte 1 year ago
parent
commit
0c3ed2070d
5 changed files with 18 additions and 19 deletions
  1. 1 1
      davtelepot/__init__.py
  2. 3 1
      davtelepot/api.py
  3. 0 10
      merge_and_push.sh
  4. 7 0
      push_to_remotes.sh
  5. 7 7
      update_package.sh

+ 1 - 1
davtelepot/__init__.py

@@ -11,7 +11,7 @@ __author__ = "Davide Testa"
 __email__ = "davide@davte.it"
 __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
 __license__ = "GNU General Public License v3.0"
-__version__ = "2.8.12"
+__version__ = "2.8.13"
 __maintainer__ = "Davide Testa"
 __contact__ = "t.me/davte"
 

+ 3 - 1
davtelepot/api.py

@@ -1091,6 +1091,7 @@ class TelegramBot:
 
     async def restrictChatMember(self, chat_id: Union[int, str], user_id: int,
                                  permissions: Dict[str, bool],
+                                 use_independent_chat_permissions: bool = None,
                                  until_date: Union[datetime.datetime, int] = None):
         """Restrict a user in a supergroup.
 
@@ -1814,7 +1815,8 @@ class TelegramBot:
     async def setChatPermissions(self,
                                  chat_id: Union[int, str] = None,
                                  permissions: Union[ChatPermissions,
-                                                    dict] = None):
+                                                    dict] = None,
+                                 use_independent_chat_permissions: bool = None):
         """Set default chat permissions for all members.
 
         Use this method to set default chat permissions for all members.

+ 0 - 10
merge_and_push.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-
-# Merge develop into master and push both branches; checkout to develop at the end.
-
-git checkout master;
-git merge develop;
-git checkout develop;
-git push origin master develop;
-git push bitbucket master develop;
-git push github master;

+ 7 - 0
push_to_remotes.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# Merge develop into master and push both branches; checkout to develop at the end.
+
+git push origin main develop;
+git push bitbucket main develop;
+git push github main;

+ 7 - 7
update_package.sh

@@ -5,20 +5,20 @@ this_script_directory=$(cd "$(dirname "$0")" && pwd)
 packenv="";
 
 # Python virtual environment directory: packenv variable in my_config.sh
-source $this_script_directory/my_config.sh;
+source "$this_script_directory"/my_config.sh;
 
 # Ensure the success of importing procedure
-if [ -z ${packenv} ];
+if [ -z "${packenv}" ];
 then
   printf "Please set in ""my_config.sh"" the path to bot python virtual environment\n\nExample:\npackenv=""path/to/virtual/env""\n";
   exit;
 fi
 
-# Merge, push, build and publish package to pypi.org
-bash merge_and_push.sh;
+# Push, build and publish package to pypi.org
+bash "$this_script_directory"/push_to_remotes.sh;
 rm -rf "$this_script_directory/build";
 rm -rf "$this_script_directory/dist";
 rm -rf "$this_script_directory/davtelepot.egg-info";
-$packenv/python setup.py sdist;
-$packenv/pip wheel --no-index --no-deps --wheel-dir dist dist/*.tar.gz;
-$packenv/twine upload --skip-existing dist/*;
+"$packenv"/python setup.py sdist;
+"$packenv"/pip wheel --no-index --no-deps --wheel-dir dist dist/*.tar.gz;
+"$packenv"/twine upload --skip-existing dist/*;