We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[FEATURE] User.send_poll shortcut
We have `Chat.send_poll` as shortcut, but `User` was neglected in #1418

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `telegram/user.py`
Content:
```
1 #!/usr/bin/env python
2 # pylint: disable=C0103,W0622
3 #
4 # A library that provides a Python interface to the Telegram Bot API
5 # Copyright (C) 2015-2020
6 # Leandro Toledo de Souza <devs@python-telegram-bot.org>
7 #
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU Lesser Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU Lesser Public License for more details.
17 #
18 # You should have received a copy of the GNU Lesser Public License
19 # along with this program.  If not, see [http://www.gnu.org/licenses/].
20 """This module contains an object that represents a Telegram User."""
21 
22 from telegram import TelegramObject
23 from telegram.utils.helpers import mention_html as util_mention_html
24 from telegram.utils.helpers import mention_markdown as util_mention_markdown
25 
26 
27 class User(TelegramObject):
28     """This object represents a Telegram user or bot.
29 
30     Attributes:
31         id (:obj:`int`): Unique identifier for this user or bot.
32         is_bot (:obj:`bool`): True, if this user is a bot
33         first_name (:obj:`str`): User's or bot's first name.
34         last_name (:obj:`str`): Optional. User's or bot's last name.
35         username (:obj:`str`): Optional. User's or bot's username.
36         language_code (:obj:`str`): Optional. IETF language tag of the user's language.
37         can_join_groups (:obj:`str`): Optional. True, if the bot can be invited to groups.
38             Returned only in :attr:`telegram.Bot.get_me` requests.
39         can_read_all_group_messages (:obj:`str`): Optional. True, if privacy mode is disabled
40             for the bot. Returned only in :attr:`telegram.Bot.get_me` requests.
41         supports_inline_queries (:obj:`str`): Optional. True, if the bot supports inline queries.
42             Returned only in :attr:`telegram.Bot.get_me` requests.
43         bot (:class:`telegram.Bot`): Optional. The Bot to use for instance methods.
44 
45     Args:
46         id (:obj:`int`): Unique identifier for this user or bot.
47         is_bot (:obj:`bool`): True, if this user is a bot
48         first_name (:obj:`str`): User's or bot's first name.
49         last_name (:obj:`str`, optional): User's or bot's last name.
50         username (:obj:`str`, optional): User's or bot's username.
51         language_code (:obj:`str`, optional): IETF language tag of the user's language.
52         can_join_groups (:obj:`str`, optional): True, if the bot can be invited to groups.
53             Returned only in :attr:`telegram.Bot.get_me` requests.
54         can_read_all_group_messages (:obj:`str`, optional): True, if privacy mode is disabled
55             for the bot. Returned only in :attr:`telegram.Bot.get_me` requests.
56         supports_inline_queries (:obj:`str`, optional): True, if the bot supports inline queries.
57             Returned only in :attr:`telegram.Bot.get_me` requests.
58         bot (:class:`telegram.Bot`, optional): The Bot to use for instance methods.
59 
60     """
61 
62     def __init__(self,
63                  id,
64                  first_name,
65                  is_bot,
66                  last_name=None,
67                  username=None,
68                  language_code=None,
69                  can_join_groups=None,
70                  can_read_all_group_messages=None,
71                  supports_inline_queries=None,
72                  bot=None,
73                  **kwargs):
74         # Required
75         self.id = int(id)
76         self.first_name = first_name
77         self.is_bot = is_bot
78         # Optionals
79         self.last_name = last_name
80         self.username = username
81         self.language_code = language_code
82         self.can_join_groups = can_join_groups
83         self.can_read_all_group_messages = can_read_all_group_messages
84         self.supports_inline_queries = supports_inline_queries
85         self.bot = bot
86 
87         self._id_attrs = (self.id,)
88 
89     @property
90     def name(self):
91         """:obj:`str`: Convenience property. If available, returns the user's :attr:`username`
92         prefixed with "@". If :attr:`username` is not available, returns :attr:`full_name`."""
93         if self.username:
94             return '@{}'.format(self.username)
95         return self.full_name
96 
97     @property
98     def full_name(self):
99         """:obj:`str`: Convenience property. The user's :attr:`first_name`, followed by (if
100         available) :attr:`last_name`."""
101 
102         if self.last_name:
103             return u'{} {}'.format(self.first_name, self.last_name)
104         return self.first_name
105 
106     @property
107     def link(self):
108         """:obj:`str`: Convenience property. If :attr:`username` is available, returns a t.me link
109         of the user."""
110 
111         if self.username:
112             return "https://t.me/{}".format(self.username)
113         return None
114 
115     @classmethod
116     def de_json(cls, data, bot):
117         if not data:
118             return None
119         data = super(User, cls).de_json(data, bot)
120 
121         return cls(bot=bot, **data)
122 
123     def get_profile_photos(self, *args, **kwargs):
124         """
125         Shortcut for::
126 
127                 bot.get_user_profile_photos(update.message.from_user.id, *args, **kwargs)
128 
129         """
130 
131         return self.bot.get_user_profile_photos(self.id, *args, **kwargs)
132 
133     @classmethod
134     def de_list(cls, data, bot):
135         if not data:
136             return []
137 
138         users = list()
139         for user in data:
140             users.append(cls.de_json(user, bot))
141 
142         return users
143 
144     def mention_markdown(self, name=None):
145         """
146         Args:
147             name (:obj:`str`): The name used as a link for the user. Defaults to :attr:`full_name`.
148 
149         Returns:
150             :obj:`str`: The inline mention for the user as markdown (version 1).
151 
152         """
153         if name:
154             return util_mention_markdown(self.id, name)
155         return util_mention_markdown(self.id, self.full_name)
156 
157     def mention_markdown_v2(self, name=None):
158         """
159         Args:
160             name (:obj:`str`): The name used as a link for the user. Defaults to :attr:`full_name`.
161 
162         Returns:
163             :obj:`str`: The inline mention for the user as markdown (version 2).
164 
165         """
166         if name:
167             return util_mention_markdown(self.id, name, version=2)
168         return util_mention_markdown(self.id, self.full_name, version=2)
169 
170     def mention_html(self, name=None):
171         """
172         Args:
173             name (:obj:`str`): The name used as a link for the user. Defaults to :attr:`full_name`.
174 
175         Returns:
176             :obj:`str`: The inline mention for the user as HTML.
177 
178         """
179         if name:
180             return util_mention_html(self.id, name)
181         return util_mention_html(self.id, self.full_name)
182 
183     def send_message(self, *args, **kwargs):
184         """Shortcut for::
185 
186             bot.send_message(User.id, *args, **kwargs)
187 
188         Where User is the current instance.
189 
190         Returns:
191             :class:`telegram.Message`: On success, instance representing the message posted.
192 
193         """
194         return self.bot.send_message(self.id, *args, **kwargs)
195 
196     def send_photo(self, *args, **kwargs):
197         """Shortcut for::
198 
199             bot.send_photo(User.id, *args, **kwargs)
200 
201         Where User is the current instance.
202 
203         Returns:
204             :class:`telegram.Message`: On success, instance representing the message posted.
205 
206         """
207         return self.bot.send_photo(self.id, *args, **kwargs)
208 
209     def send_audio(self, *args, **kwargs):
210         """Shortcut for::
211 
212             bot.send_audio(User.id, *args, **kwargs)
213 
214         Where User is the current instance.
215 
216         Returns:
217             :class:`telegram.Message`: On success, instance representing the message posted.
218 
219         """
220         return self.bot.send_audio(self.id, *args, **kwargs)
221 
222     def send_document(self, *args, **kwargs):
223         """Shortcut for::
224 
225             bot.send_document(User.id, *args, **kwargs)
226 
227         Where User is the current instance.
228 
229         Returns:
230             :class:`telegram.Message`: On success, instance representing the message posted.
231 
232         """
233         return self.bot.send_document(self.id, *args, **kwargs)
234 
235     def send_animation(self, *args, **kwargs):
236         """Shortcut for::
237 
238             bot.send_animation(User.id, *args, **kwargs)
239 
240         Where User is the current instance.
241 
242         Returns:
243             :class:`telegram.Message`: On success, instance representing the message posted.
244 
245         """
246         return self.bot.send_animation(self.id, *args, **kwargs)
247 
248     def send_sticker(self, *args, **kwargs):
249         """Shortcut for::
250 
251             bot.send_sticker(User.id, *args, **kwargs)
252 
253         Where User is the current instance.
254 
255         Returns:
256             :class:`telegram.Message`: On success, instance representing the message posted.
257 
258         """
259         return self.bot.send_sticker(self.id, *args, **kwargs)
260 
261     def send_video(self, *args, **kwargs):
262         """Shortcut for::
263 
264             bot.send_video(User.id, *args, **kwargs)
265 
266         Where User is the current instance.
267 
268         Returns:
269             :class:`telegram.Message`: On success, instance representing the message posted.
270 
271         """
272         return self.bot.send_video(self.id, *args, **kwargs)
273 
274     def send_video_note(self, *args, **kwargs):
275         """Shortcut for::
276 
277             bot.send_video_note(User.id, *args, **kwargs)
278 
279         Where User is the current instance.
280 
281         Returns:
282             :class:`telegram.Message`: On success, instance representing the message posted.
283 
284         """
285         return self.bot.send_video_note(self.id, *args, **kwargs)
286 
287     def send_voice(self, *args, **kwargs):
288         """Shortcut for::
289 
290             bot.send_voice(User.id, *args, **kwargs)
291 
292         Where User is the current instance.
293 
294         Returns:
295             :class:`telegram.Message`: On success, instance representing the message posted.
296 
297         """
298         return self.bot.send_voice(self.id, *args, **kwargs)
299
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/telegram/user.py b/telegram/user.py
--- a/telegram/user.py
+++ b/telegram/user.py
@@ -296,3 +296,16 @@
 
         """
         return self.bot.send_voice(self.id, *args, **kwargs)
+
+    def send_poll(self, *args, **kwargs):
+        """Shortcut for::
+
+            bot.send_poll(User.id, *args, **kwargs)
+
+        Where User is the current instance.
+
+        Returns:
+            :class:`telegram.Message`: On success, instance representing the message posted.
+
+        """
+        return self.bot.send_poll(self.id, *args, **kwargs)

{"golden_diff": "diff --git a/telegram/user.py b/telegram/user.py\n--- a/telegram/user.py\n+++ b/telegram/user.py\n@@ -296,3 +296,16 @@\n \n         \"\"\"\n         return self.bot.send_voice(self.id, *args, **kwargs)\n+\n+    def send_poll(self, *args, **kwargs):\n+        \"\"\"Shortcut for::\n+\n+            bot.send_poll(User.id, *args, **kwargs)\n+\n+        Where User is the current instance.\n+\n+        Returns:\n+            :class:`telegram.Message`: On success, instance representing the message posted.\n+\n+        \"\"\"\n+        return self.bot.send_poll(self.id, *args, **kwargs)\n", "issue": "[FEATURE] User.send_poll shortcut\nWe have `Chat.send_poll` as shortcut, but `User` was neglected in #1418\n", "before_files": [{"content": "#!/usr/bin/env python\n# pylint: disable=C0103,W0622\n#\n# A library that provides a Python interface to the Telegram Bot API\n# Copyright (C) 2015-2020\n# Leandro Toledo de Souza <devs@python-telegram-bot.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Lesser Public License for more details.\n#\n# You should have received a copy of the GNU Lesser Public License\n# along with this program.  If not, see [http://www.gnu.org/licenses/].\n\"\"\"This module contains an object that represents a Telegram User.\"\"\"\n\nfrom telegram import TelegramObject\nfrom telegram.utils.helpers import mention_html as util_mention_html\nfrom telegram.utils.helpers import mention_markdown as util_mention_markdown\n\n\nclass User(TelegramObject):\n    \"\"\"This object represents a Telegram user or bot.\n\n    Attributes:\n        id (:obj:`int`): Unique identifier for this user or bot.\n        is_bot (:obj:`bool`): True, if this user is a bot\n        first_name (:obj:`str`): User's or bot's first name.\n        last_name (:obj:`str`): Optional. User's or bot's last name.\n        username (:obj:`str`): Optional. User's or bot's username.\n        language_code (:obj:`str`): Optional. IETF language tag of the user's language.\n        can_join_groups (:obj:`str`): Optional. True, if the bot can be invited to groups.\n            Returned only in :attr:`telegram.Bot.get_me` requests.\n        can_read_all_group_messages (:obj:`str`): Optional. True, if privacy mode is disabled\n            for the bot. Returned only in :attr:`telegram.Bot.get_me` requests.\n        supports_inline_queries (:obj:`str`): Optional. True, if the bot supports inline queries.\n            Returned only in :attr:`telegram.Bot.get_me` requests.\n        bot (:class:`telegram.Bot`): Optional. The Bot to use for instance methods.\n\n    Args:\n        id (:obj:`int`): Unique identifier for this user or bot.\n        is_bot (:obj:`bool`): True, if this user is a bot\n        first_name (:obj:`str`): User's or bot's first name.\n        last_name (:obj:`str`, optional): User's or bot's last name.\n        username (:obj:`str`, optional): User's or bot's username.\n        language_code (:obj:`str`, optional): IETF language tag of the user's language.\n        can_join_groups (:obj:`str`, optional): True, if the bot can be invited to groups.\n            Returned only in :attr:`telegram.Bot.get_me` requests.\n        can_read_all_group_messages (:obj:`str`, optional): True, if privacy mode is disabled\n            for the bot. Returned only in :attr:`telegram.Bot.get_me` requests.\n        supports_inline_queries (:obj:`str`, optional): True, if the bot supports inline queries.\n            Returned only in :attr:`telegram.Bot.get_me` requests.\n        bot (:class:`telegram.Bot`, optional): The Bot to use for instance methods.\n\n    \"\"\"\n\n    def __init__(self,\n                 id,\n                 first_name,\n                 is_bot,\n                 last_name=None,\n                 username=None,\n                 language_code=None,\n                 can_join_groups=None,\n                 can_read_all_group_messages=None,\n                 supports_inline_queries=None,\n                 bot=None,\n                 **kwargs):\n        # Required\n        self.id = int(id)\n        self.first_name = first_name\n        self.is_bot = is_bot\n        # Optionals\n        self.last_name = last_name\n        self.username = username\n        self.language_code = language_code\n        self.can_join_groups = can_join_groups\n        self.can_read_all_group_messages = can_read_all_group_messages\n        self.supports_inline_queries = supports_inline_queries\n        self.bot = bot\n\n        self._id_attrs = (self.id,)\n\n    @property\n    def name(self):\n        \"\"\":obj:`str`: Convenience property. If available, returns the user's :attr:`username`\n        prefixed with \"@\". If :attr:`username` is not available, returns :attr:`full_name`.\"\"\"\n        if self.username:\n            return '@{}'.format(self.username)\n        return self.full_name\n\n    @property\n    def full_name(self):\n        \"\"\":obj:`str`: Convenience property. The user's :attr:`first_name`, followed by (if\n        available) :attr:`last_name`.\"\"\"\n\n        if self.last_name:\n            return u'{} {}'.format(self.first_name, self.last_name)\n        return self.first_name\n\n    @property\n    def link(self):\n        \"\"\":obj:`str`: Convenience property. If :attr:`username` is available, returns a t.me link\n        of the user.\"\"\"\n\n        if self.username:\n            return \"https://t.me/{}\".format(self.username)\n        return None\n\n    @classmethod\n    def de_json(cls, data, bot):\n        if not data:\n            return None\n        data = super(User, cls).de_json(data, bot)\n\n        return cls(bot=bot, **data)\n\n    def get_profile_photos(self, *args, **kwargs):\n        \"\"\"\n        Shortcut for::\n\n                bot.get_user_profile_photos(update.message.from_user.id, *args, **kwargs)\n\n        \"\"\"\n\n        return self.bot.get_user_profile_photos(self.id, *args, **kwargs)\n\n    @classmethod\n    def de_list(cls, data, bot):\n        if not data:\n            return []\n\n        users = list()\n        for user in data:\n            users.append(cls.de_json(user, bot))\n\n        return users\n\n    def mention_markdown(self, name=None):\n        \"\"\"\n        Args:\n            name (:obj:`str`): The name used as a link for the user. Defaults to :attr:`full_name`.\n\n        Returns:\n            :obj:`str`: The inline mention for the user as markdown (version 1).\n\n        \"\"\"\n        if name:\n            return util_mention_markdown(self.id, name)\n        return util_mention_markdown(self.id, self.full_name)\n\n    def mention_markdown_v2(self, name=None):\n        \"\"\"\n        Args:\n            name (:obj:`str`): The name used as a link for the user. Defaults to :attr:`full_name`.\n\n        Returns:\n            :obj:`str`: The inline mention for the user as markdown (version 2).\n\n        \"\"\"\n        if name:\n            return util_mention_markdown(self.id, name, version=2)\n        return util_mention_markdown(self.id, self.full_name, version=2)\n\n    def mention_html(self, name=None):\n        \"\"\"\n        Args:\n            name (:obj:`str`): The name used as a link for the user. Defaults to :attr:`full_name`.\n\n        Returns:\n            :obj:`str`: The inline mention for the user as HTML.\n\n        \"\"\"\n        if name:\n            return util_mention_html(self.id, name)\n        return util_mention_html(self.id, self.full_name)\n\n    def send_message(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_message(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_message(self.id, *args, **kwargs)\n\n    def send_photo(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_photo(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_photo(self.id, *args, **kwargs)\n\n    def send_audio(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_audio(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_audio(self.id, *args, **kwargs)\n\n    def send_document(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_document(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_document(self.id, *args, **kwargs)\n\n    def send_animation(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_animation(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_animation(self.id, *args, **kwargs)\n\n    def send_sticker(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_sticker(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_sticker(self.id, *args, **kwargs)\n\n    def send_video(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_video(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_video(self.id, *args, **kwargs)\n\n    def send_video_note(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_video_note(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_video_note(self.id, *args, **kwargs)\n\n    def send_voice(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_voice(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_voice(self.id, *args, **kwargs)\n", "path": "telegram/user.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# pylint: disable=C0103,W0622\n#\n# A library that provides a Python interface to the Telegram Bot API\n# Copyright (C) 2015-2020\n# Leandro Toledo de Souza <devs@python-telegram-bot.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Lesser Public License for more details.\n#\n# You should have received a copy of the GNU Lesser Public License\n# along with this program.  If not, see [http://www.gnu.org/licenses/].\n\"\"\"This module contains an object that represents a Telegram User.\"\"\"\n\nfrom telegram import TelegramObject\nfrom telegram.utils.helpers import mention_html as util_mention_html\nfrom telegram.utils.helpers import mention_markdown as util_mention_markdown\n\n\nclass User(TelegramObject):\n    \"\"\"This object represents a Telegram user or bot.\n\n    Attributes:\n        id (:obj:`int`): Unique identifier for this user or bot.\n        is_bot (:obj:`bool`): True, if this user is a bot\n        first_name (:obj:`str`): User's or bot's first name.\n        last_name (:obj:`str`): Optional. User's or bot's last name.\n        username (:obj:`str`): Optional. User's or bot's username.\n        language_code (:obj:`str`): Optional. IETF language tag of the user's language.\n        can_join_groups (:obj:`str`): Optional. True, if the bot can be invited to groups.\n            Returned only in :attr:`telegram.Bot.get_me` requests.\n        can_read_all_group_messages (:obj:`str`): Optional. True, if privacy mode is disabled\n            for the bot. Returned only in :attr:`telegram.Bot.get_me` requests.\n        supports_inline_queries (:obj:`str`): Optional. True, if the bot supports inline queries.\n            Returned only in :attr:`telegram.Bot.get_me` requests.\n        bot (:class:`telegram.Bot`): Optional. The Bot to use for instance methods.\n\n    Args:\n        id (:obj:`int`): Unique identifier for this user or bot.\n        is_bot (:obj:`bool`): True, if this user is a bot\n        first_name (:obj:`str`): User's or bot's first name.\n        last_name (:obj:`str`, optional): User's or bot's last name.\n        username (:obj:`str`, optional): User's or bot's username.\n        language_code (:obj:`str`, optional): IETF language tag of the user's language.\n        can_join_groups (:obj:`str`, optional): True, if the bot can be invited to groups.\n            Returned only in :attr:`telegram.Bot.get_me` requests.\n        can_read_all_group_messages (:obj:`str`, optional): True, if privacy mode is disabled\n            for the bot. Returned only in :attr:`telegram.Bot.get_me` requests.\n        supports_inline_queries (:obj:`str`, optional): True, if the bot supports inline queries.\n            Returned only in :attr:`telegram.Bot.get_me` requests.\n        bot (:class:`telegram.Bot`, optional): The Bot to use for instance methods.\n\n    \"\"\"\n\n    def __init__(self,\n                 id,\n                 first_name,\n                 is_bot,\n                 last_name=None,\n                 username=None,\n                 language_code=None,\n                 can_join_groups=None,\n                 can_read_all_group_messages=None,\n                 supports_inline_queries=None,\n                 bot=None,\n                 **kwargs):\n        # Required\n        self.id = int(id)\n        self.first_name = first_name\n        self.is_bot = is_bot\n        # Optionals\n        self.last_name = last_name\n        self.username = username\n        self.language_code = language_code\n        self.can_join_groups = can_join_groups\n        self.can_read_all_group_messages = can_read_all_group_messages\n        self.supports_inline_queries = supports_inline_queries\n        self.bot = bot\n\n        self._id_attrs = (self.id,)\n\n    @property\n    def name(self):\n        \"\"\":obj:`str`: Convenience property. If available, returns the user's :attr:`username`\n        prefixed with \"@\". If :attr:`username` is not available, returns :attr:`full_name`.\"\"\"\n        if self.username:\n            return '@{}'.format(self.username)\n        return self.full_name\n\n    @property\n    def full_name(self):\n        \"\"\":obj:`str`: Convenience property. The user's :attr:`first_name`, followed by (if\n        available) :attr:`last_name`.\"\"\"\n\n        if self.last_name:\n            return u'{} {}'.format(self.first_name, self.last_name)\n        return self.first_name\n\n    @property\n    def link(self):\n        \"\"\":obj:`str`: Convenience property. If :attr:`username` is available, returns a t.me link\n        of the user.\"\"\"\n\n        if self.username:\n            return \"https://t.me/{}\".format(self.username)\n        return None\n\n    @classmethod\n    def de_json(cls, data, bot):\n        if not data:\n            return None\n        data = super(User, cls).de_json(data, bot)\n\n        return cls(bot=bot, **data)\n\n    def get_profile_photos(self, *args, **kwargs):\n        \"\"\"\n        Shortcut for::\n\n                bot.get_user_profile_photos(update.message.from_user.id, *args, **kwargs)\n\n        \"\"\"\n\n        return self.bot.get_user_profile_photos(self.id, *args, **kwargs)\n\n    @classmethod\n    def de_list(cls, data, bot):\n        if not data:\n            return []\n\n        users = list()\n        for user in data:\n            users.append(cls.de_json(user, bot))\n\n        return users\n\n    def mention_markdown(self, name=None):\n        \"\"\"\n        Args:\n            name (:obj:`str`): The name used as a link for the user. Defaults to :attr:`full_name`.\n\n        Returns:\n            :obj:`str`: The inline mention for the user as markdown (version 1).\n\n        \"\"\"\n        if name:\n            return util_mention_markdown(self.id, name)\n        return util_mention_markdown(self.id, self.full_name)\n\n    def mention_markdown_v2(self, name=None):\n        \"\"\"\n        Args:\n            name (:obj:`str`): The name used as a link for the user. Defaults to :attr:`full_name`.\n\n        Returns:\n            :obj:`str`: The inline mention for the user as markdown (version 2).\n\n        \"\"\"\n        if name:\n            return util_mention_markdown(self.id, name, version=2)\n        return util_mention_markdown(self.id, self.full_name, version=2)\n\n    def mention_html(self, name=None):\n        \"\"\"\n        Args:\n            name (:obj:`str`): The name used as a link for the user. Defaults to :attr:`full_name`.\n\n        Returns:\n            :obj:`str`: The inline mention for the user as HTML.\n\n        \"\"\"\n        if name:\n            return util_mention_html(self.id, name)\n        return util_mention_html(self.id, self.full_name)\n\n    def send_message(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_message(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_message(self.id, *args, **kwargs)\n\n    def send_photo(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_photo(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_photo(self.id, *args, **kwargs)\n\n    def send_audio(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_audio(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_audio(self.id, *args, **kwargs)\n\n    def send_document(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_document(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_document(self.id, *args, **kwargs)\n\n    def send_animation(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_animation(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_animation(self.id, *args, **kwargs)\n\n    def send_sticker(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_sticker(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_sticker(self.id, *args, **kwargs)\n\n    def send_video(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_video(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_video(self.id, *args, **kwargs)\n\n    def send_video_note(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_video_note(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_video_note(self.id, *args, **kwargs)\n\n    def send_voice(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_voice(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_voice(self.id, *args, **kwargs)\n\n    def send_poll(self, *args, **kwargs):\n        \"\"\"Shortcut for::\n\n            bot.send_poll(User.id, *args, **kwargs)\n\n        Where User is the current instance.\n\n        Returns:\n            :class:`telegram.Message`: On success, instance representing the message posted.\n\n        \"\"\"\n        return self.bot.send_poll(self.id, *args, **kwargs)\n", "path": "telegram/user.py"}]}