cmsend 0.0.1__tar.gz → 0.3.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.
- {cmsend-0.0.1 → cmsend-0.3.0}/PKG-INFO +1 -1
- {cmsend-0.0.1 → cmsend-0.3.0}/cmsend.egg-info/PKG-INFO +1 -1
- {cmsend-0.0.1 → cmsend-0.3.0}/cmsend.py +8 -4
- {cmsend-0.0.1 → cmsend-0.3.0}/LICENSE +0 -0
- {cmsend-0.0.1 → cmsend-0.3.0}/README.md +0 -0
- {cmsend-0.0.1 → cmsend-0.3.0}/cmsend.egg-info/SOURCES.txt +0 -0
- {cmsend-0.0.1 → cmsend-0.3.0}/cmsend.egg-info/dependency_links.txt +0 -0
- {cmsend-0.0.1 → cmsend-0.3.0}/cmsend.egg-info/entry_points.txt +0 -0
- {cmsend-0.0.1 → cmsend-0.3.0}/cmsend.egg-info/requires.txt +0 -0
- {cmsend-0.0.1 → cmsend-0.3.0}/cmsend.egg-info/top_level.txt +0 -0
- {cmsend-0.0.1 → cmsend-0.3.0}/pyproject.toml +0 -0
- {cmsend-0.0.1 → cmsend-0.3.0}/setup.cfg +0 -0
|
@@ -25,14 +25,18 @@ def main():
|
|
|
25
25
|
help="setup a chat using the specified invite link",
|
|
26
26
|
)
|
|
27
27
|
parser.add_argument(
|
|
28
|
-
"
|
|
28
|
+
"-m",
|
|
29
29
|
type=str,
|
|
30
|
+
dest="msg",
|
|
30
31
|
default=None,
|
|
31
32
|
help="the text message to send (defaults to reading from stdin)",
|
|
32
33
|
)
|
|
33
34
|
parser.add_argument(
|
|
34
35
|
"-v", dest="verbose", action="count", default=0, help="increase verbosity"
|
|
35
36
|
)
|
|
37
|
+
parser.add_argument(
|
|
38
|
+
"-a", dest="filename", type=str, default=None, help="add file attachment"
|
|
39
|
+
)
|
|
36
40
|
args = parser.parse_args()
|
|
37
41
|
|
|
38
42
|
try:
|
|
@@ -54,7 +58,7 @@ def perform_main(args):
|
|
|
54
58
|
else:
|
|
55
59
|
if args.msg is None:
|
|
56
60
|
args.msg = sys.stdin.read()
|
|
57
|
-
profile.perform_send(args.msg)
|
|
61
|
+
profile.perform_send(args.msg, filename=args.filename)
|
|
58
62
|
|
|
59
63
|
|
|
60
64
|
class Profile:
|
|
@@ -110,12 +114,12 @@ class Profile:
|
|
|
110
114
|
print(f"joining completed with contact_id == {ev.contact_id}")
|
|
111
115
|
return 0
|
|
112
116
|
|
|
113
|
-
def perform_send(self, text):
|
|
117
|
+
def perform_send(self, text, filename=None):
|
|
114
118
|
self._account.start_io()
|
|
115
119
|
for chat in self._account.get_chatlist():
|
|
116
120
|
snap = chat.get_full_snapshot()
|
|
117
121
|
if snap.is_encrypted and snap.can_send:
|
|
118
|
-
msg = chat.
|
|
122
|
+
msg = chat.send_message(text=text, file=filename)
|
|
119
123
|
print(f"message {msg.id} was queued, waiting for delivery")
|
|
120
124
|
msg.wait_until_delivered()
|
|
121
125
|
return 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|