add (NOFWD) (NOQQ) support

This commit is contained in:
2021-12-18 00:01:33 +08:00
parent 7432592842
commit c9e42f720f
2 changed files with 9 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ def add_path_ext(path: str) -> str:
def check_needed_prog():
if system(f'ldd --help > {devnull}'):
if system(f'ldd-rust --help > {devnull}'):
return False
if system(f'7z --help > {devnull}'):
return False
@@ -48,7 +48,7 @@ def check_needed_prog():
def check_prog(prog: str) -> List[str]:
r = Popen(f'ldd {prog}', stdout=PIPE, stderr=PIPE)
r = Popen(f'ldd-rust {prog}', stdout=PIPE, stderr=PIPE)
out: bytes = r.communicate()[0]
r.wait()
out += r.communicate()[0]

View File

@@ -376,15 +376,18 @@ async def main(lib: TdLib, robot: TdLib):
e = e.result()
if e is None:
print('Can not edit message.')
if mes['content']['text']['text'] == '-hello':
text: str = mes['content']['text']['text']
text = text.lstrip("(NOFWD)")
text = text.lstrip("(NOQQ)")
if text == '-hello':
re = lib.editMessageText(mes['chat_id'], mes['id'],
'Hello World!')
asyncio.create_task(re).add_done_callback(err)
elif mes['content']['text']['text'] in ['-msginfo', '-messageinfo']: # noqa: E501
elif text in ['-msginfo', '-messageinfo']: # noqa: E501
re = handle_message_info(lib, mes)
asyncio.create_task(re)
elif mes['content']['text']['text'].startswith('-'):
argv = commandLineToArgv(mes['content']['text']['text'])
elif text.startswith('-'):
argv = commandLineToArgv(text)
if argv[0] in ['-createnewstickerset', '-cnss']:
re = handle_create_new_sticker_set(lib, robot, mes, argv)
asyncio.create_task(re)