File tree Expand file tree Collapse file tree 4 files changed +17
-0
lines changed
Expand file tree Collapse file tree 4 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -111,13 +111,26 @@ async def dump(
111111 message_id = initial_message .message_id ,
112112 )
113113
114+ initial_msg = await context .bot .send_message (
115+ chat_id = chat .id ,
116+ reply_to_message_id = None if use_privdump else message .message_id ,
117+ text = f"{ dump_args .url .unicode_string ()} dump started" ,
118+ )
119+
120+ dump_args .initial_message_id = initial_msg .message_id
121+
114122 console .print ("[blue]Calling Jenkins to start build...[/blue]" )
115123 response_text = await utils .call_jenkins (dump_args )
116124 console .print (f"[green]Jenkins response: { response_text } [/green]" )
117125
118126 except ValidationError :
119127 console .print (f"[red]Invalid URL provided: { url } [/red]" )
120128 response_text = "Invalid URL"
129+ await context .bot .send_message (
130+ chat_id = chat .id ,
131+ reply_to_message_id = None if use_privdump else message .message_id ,
132+ text = response_text ,
133+ )
121134 except Exception :
122135 console .print ("[red]Unexpected error occurred:[/red]" )
123136 console .print_exception ()
Original file line number Diff line number Diff line change @@ -14,3 +14,4 @@ class DumpArguments(BaseModel):
1414 use_alt_dumper : bool
1515 add_blacklist : bool
1616 use_privdump : bool
17+ initial_message_id : Optional [int ] = None
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ async def call_jenkins(args: schemas.DumpArguments) -> str:
110110 "URL" : args .url .unicode_string (),
111111 "USE_ALT_DUMPER" : args .use_alt_dumper ,
112112 "ADD_BLACKLIST" : args .add_blacklist ,
113+ "INITIAL_MESSAGE_ID" : args .initial_message_id ,
113114 },
114115 auth = (settings .JENKINS_USER_NAME , settings .JENKINS_USER_TOKEN ),
115116 )
Original file line number Diff line number Diff line change 77
88CHAT_ID=" -1001412293127"
99
10+ [[ -z ${INITIAL_MESSAGE_ID} ]] && START_MESSAGE_ID=" " || START_MESSAGE_ID=" ${INITIAL_MESSAGE_ID} "
11+
1012# usage: normal - sendTg normal "message to send"
1113# reply - sendTg reply message_id "reply to send"
1214# edit - sendTg edit message_id "new message" ( new message must be different )
You can’t perform that action at this time.
0 commit comments