Queer European MD passionate about IT
소스 검색

Compliance with Telegram Bot API 6.5

Davte 3 년 전
부모
커밋
0c3ed2070d
5개의 변경된 파일18개의 추가작업 그리고 19개의 파일을 삭제
  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"
 __email__ = "davide@davte.it"
 __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
 __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
 __license__ = "GNU General Public License v3.0"
 __license__ = "GNU General Public License v3.0"
-__version__ = "2.8.12"
+__version__ = "2.8.13"
 __maintainer__ = "Davide Testa"
 __maintainer__ = "Davide Testa"
 __contact__ = "t.me/davte"
 __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,
     async def restrictChatMember(self, chat_id: Union[int, str], user_id: int,
                                  permissions: Dict[str, bool],
                                  permissions: Dict[str, bool],
+                                 use_independent_chat_permissions: bool = None,
                                  until_date: Union[datetime.datetime, int] = None):
                                  until_date: Union[datetime.datetime, int] = None):
         """Restrict a user in a supergroup.
         """Restrict a user in a supergroup.
 
 
@@ -1814,7 +1815,8 @@ class TelegramBot:
     async def setChatPermissions(self,
     async def setChatPermissions(self,
                                  chat_id: Union[int, str] = None,
                                  chat_id: Union[int, str] = None,
                                  permissions: Union[ChatPermissions,
                                  permissions: Union[ChatPermissions,
-                                                    dict] = None):
+                                                    dict] = None,
+                                 use_independent_chat_permissions: bool = None):
         """Set default chat permissions for all members.
         """Set default chat permissions for all members.
 
 
         Use this method to 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="";
 packenv="";
 
 
 # Python virtual environment directory: packenv variable in my_config.sh
 # 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
 # Ensure the success of importing procedure
-if [ -z ${packenv} ];
+if [ -z "${packenv}" ];
 then
 then
   printf "Please set in ""my_config.sh"" the path to bot python virtual environment\n\nExample:\npackenv=""path/to/virtual/env""\n";
   printf "Please set in ""my_config.sh"" the path to bot python virtual environment\n\nExample:\npackenv=""path/to/virtual/env""\n";
   exit;
   exit;
 fi
 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/build";
 rm -rf "$this_script_directory/dist";
 rm -rf "$this_script_directory/dist";
 rm -rf "$this_script_directory/davtelepot.egg-info";
 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/*;