deltabot-cli 7.0.0__tar.gz → 7.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltabot-cli
3
- Version: 7.0.0
3
+ Version: 7.2.0
4
4
  Summary: Library to speedup Delta Chat bot development
5
5
  Author-email: adbenitez <adb@merlinux.eu>
6
6
  Project-URL: Homepage, https://github.com/deltachat-bot/deltabot-cli-py
@@ -12,7 +12,7 @@ Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: deltachat2[full]>=0.5.0
15
+ Requires-Dist: deltachat2[full]>=0.8.0
16
16
  Requires-Dist: appdirs>=1.4.4
17
17
  Requires-Dist: rich>=12.6.0
18
18
  Provides-Extra: dev
@@ -172,6 +172,17 @@ class BotCli:
172
172
  return rpc.get_config(accid, "configured_addr")
173
173
  return rpc.get_config(accid, "addr")
174
174
 
175
+ def is_admin(self, rpc: Rpc, accid: int, contactid: int) -> bool:
176
+ """Return True if the contact is an administrator.
177
+ Administrators are the members of the Administration group.
178
+ """
179
+ chatid = self.get_admin_chat(rpc, accid)
180
+ contacts = rpc.get_chat_contacts(accid, chatid)
181
+ for contact in contacts:
182
+ if contactid == contact:
183
+ return True
184
+ return False
185
+
175
186
  def get_admin_chat(self, rpc: Rpc, accid: int) -> int:
176
187
  """Return the bot administration group.
177
188
  If the account is not configured, zero is returned.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltabot-cli
3
- Version: 7.0.0
3
+ Version: 7.2.0
4
4
  Summary: Library to speedup Delta Chat bot development
5
5
  Author-email: adbenitez <adb@merlinux.eu>
6
6
  Project-URL: Homepage, https://github.com/deltachat-bot/deltabot-cli-py
@@ -12,7 +12,7 @@ Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: deltachat2[full]>=0.5.0
15
+ Requires-Dist: deltachat2[full]>=0.8.0
16
16
  Requires-Dist: appdirs>=1.4.4
17
17
  Requires-Dist: rich>=12.6.0
18
18
  Provides-Extra: dev
@@ -1,4 +1,4 @@
1
- deltachat2[full]>=0.5.0
1
+ deltachat2[full]>=0.8.0
2
2
  appdirs>=1.4.4
3
3
  rich>=12.6.0
4
4
 
@@ -19,7 +19,7 @@ classifiers = [
19
19
  "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
20
20
  ]
21
21
  dependencies = [
22
- "deltachat2[full]>=0.5.0",
22
+ "deltachat2[full]>=0.8.0",
23
23
  "appdirs>=1.4.4",
24
24
  "rich>=12.6.0",
25
25
  ]
File without changes
File without changes
File without changes
File without changes
File without changes