Repository: python-telegram-bot/python-telegram-bot

Issue:
[BUG] Typo in def of enocde_conversations_to_json
Hi,
i was using helpers.py yesterday and i found a typo in enocde_conversation_to_json [function definition](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/utils/helpers.py#L303)

If it wasn't wanted I would suggest to change it:

From:
`def enocde_conversations_to_json(conversations)`

To:
`def encode_conversations_to_json(conversations)`

### Traceback to the issue
[Github results](https://github.com/python-telegram-bot/python-telegram-bot/search?q=enocde_conversations_to_json&unscoped_q=enocde_conversations_to_json)



Discussion:
Uh yes, that's a typo for sure. Thanks for bringing this to our attention!
Would you maybe like to make a PR for this?
Yeah, i will have a look into it.

Thanks!

Resolving patch:
diff --git a/telegram/ext/dictpersistence.py b/telegram/ext/dictpersistence.py
--- a/telegram/ext/dictpersistence.py
+++ b/telegram/ext/dictpersistence.py
@@ -20,7 +20,7 @@
 from copy import deepcopy
 
 from telegram.utils.helpers import decode_user_chat_data_from_json,\
-    decode_conversations_from_json, enocde_conversations_to_json
+    decode_conversations_from_json, encode_conversations_to_json
 
 try:
     import ujson as json
@@ -119,7 +119,7 @@ def conversations_json(self):
         if self._conversations_json:
             return self._conversations_json
         else:
-            return enocde_conversations_to_json(self.conversations)
+            return encode_conversations_to_json(self.conversations)
 
     def get_user_data(self):
         """Returns the user_data created from the ``user_data_json`` or an empty defaultdict.
diff --git a/telegram/utils/helpers.py b/telegram/utils/helpers.py
--- a/telegram/utils/helpers.py
+++ b/telegram/utils/helpers.py
@@ -300,7 +300,7 @@ def create_deep_linked_url(bot_username, payload=None, group=False):
     )
 
 
-def enocde_conversations_to_json(conversations):
+def encode_conversations_to_json(conversations):
     """Helper method to encode a conversations dict (that uses tuples as keys) to a
     JSON-serializable way. Use :attr:`_decode_conversations_from_json` to decode.
 


Test patch:
diff --git a/tests/test_persistence.py b/tests/test_persistence.py
--- a/tests/test_persistence.py
+++ b/tests/test_persistence.py
@@ -18,7 +18,7 @@
 # along with this program.  If not, see [http://www.gnu.org/licenses/].
 import signal
 
-from telegram.utils.helpers import enocde_conversations_to_json
+from telegram.utils.helpers import encode_conversations_to_json
 
 try:
     import ujson as json
@@ -774,7 +774,7 @@ def test_json_changes(self, user_data, user_data_json, chat_data, chat_data_json
         dict_persistence.update_conversation('name3', (1, 2), 3)
         assert dict_persistence.conversations == conversations_two
         assert dict_persistence.conversations_json != conversations_json
-        assert dict_persistence.conversations_json == enocde_conversations_to_json(
+        assert dict_persistence.conversations_json == encode_conversations_to_json(
             conversations_two)
 
     def test_with_handler(self, bot, update):