mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Remove deprecated options, aliases and defaults (#3461)
* Remove deprecated options, aliases and defaults. * Add changelog fragment. * Small fixes. * Apply suggestions from code review Co-authored-by: Ajpantuso <ajpantuso@gmail.com> * Lint. * Update plugins/modules/system/xfconf.py Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * Bump galaxy version to 4.0.0. Co-authored-by: Ajpantuso <ajpantuso@gmail.com> Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
7038812465
commit
9546bbb55e
15 changed files with 68 additions and 194 deletions
|
@ -22,8 +22,6 @@ description:
|
|||
- Also, the user may try to use any other telegram bot API method, if you specify I(api_method) argument.
|
||||
notes:
|
||||
- You will require a telegram account and create telegram bot to use this module.
|
||||
- The options I(msg), I(msg_format) and I(chat_id) have been deprecated and will be removed in community.general
|
||||
4.0.0. Use the corresponding variables in I(api_args) instead. See the examples for how that works.
|
||||
options:
|
||||
token:
|
||||
type: str
|
||||
|
@ -43,22 +41,6 @@ options:
|
|||
- Any parameters for the method.
|
||||
- For reference to default method, C(SendMessage), see U(https://core.telegram.org/bots/api#sendmessage).
|
||||
version_added: 2.0.0
|
||||
msg:
|
||||
type: str
|
||||
description:
|
||||
- (Deprecated) What message you wish to send.
|
||||
msg_format:
|
||||
type: str
|
||||
description:
|
||||
- (Deprecated) Message format. Formatting options C(markdown), C(MarkdownV2), and C(html) described in
|
||||
Telegram API docs (https://core.telegram.org/bots/api#formatting-options).
|
||||
If option C(plain) set, message will not be formatted.
|
||||
default: plain
|
||||
choices: [ "plain", "markdown", "MarkdownV2", "html" ]
|
||||
chat_id:
|
||||
type: str
|
||||
description:
|
||||
- (Deprecated) Telegram group or user chat_id.
|
||||
|
||||
'''
|
||||
|
||||
|
@ -83,12 +65,6 @@ EXAMPLES = """
|
|||
from_chat_id: 111111
|
||||
disable_notification: True
|
||||
message_id: '{{ saved_msg_id }}'
|
||||
|
||||
- name: Send a message to chat in playbook (deprecated old style)
|
||||
community.general.telegram:
|
||||
token: '9999999:XXXXXXXXXXXXXXXXXXXXXXX'
|
||||
chat_id: 000000
|
||||
msg: Ansible task finished
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
|
@ -119,11 +95,6 @@ def main():
|
|||
token=dict(type='str', required=True, no_log=True),
|
||||
api_args=dict(type='dict'),
|
||||
api_method=dict(type="str", default="SendMessage"),
|
||||
chat_id=dict(type='str', no_log=True, removed_in_version='4.0.0',
|
||||
removed_from_collection='community.general'),
|
||||
msg=dict(type='str', removed_in_version='4.0.0', removed_from_collection='community.general'),
|
||||
msg_format=dict(type='str', choices=['plain', 'markdown', 'html', 'MarkdownV2'], default='plain',
|
||||
removed_in_version='4.0.0', removed_from_collection='community.general'),
|
||||
),
|
||||
supports_check_mode=True
|
||||
)
|
||||
|
@ -132,9 +103,9 @@ def main():
|
|||
api_args = module.params.get('api_args') or {}
|
||||
api_method = module.params.get('api_method')
|
||||
# filling backward compatibility args
|
||||
api_args['chat_id'] = api_args.get('chat_id') or module.params.get('chat_id')
|
||||
api_args['parse_mode'] = api_args.get('parse_mode') or module.params.get('msg_format')
|
||||
api_args['text'] = api_args.get('text') or module.params.get('msg')
|
||||
api_args['chat_id'] = api_args.get('chat_id')
|
||||
api_args['parse_mode'] = api_args.get('parse_mode')
|
||||
api_args['text'] = api_args.get('text')
|
||||
|
||||
if api_args['parse_mode'] == 'plain':
|
||||
del api_args['parse_mode']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue