Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the conditions to be more pythonic (python 3 syntax). #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pytdbot/methods/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ async def sendAnimation(
else:
caption = {"@type": "formattedText", "text": caption, "entities": []}

if load_replied_message == None and not self.use_message_database:
if load_replied_message is None and not self.use_message_database:
load_replied_message = True

if (
Expand Down Expand Up @@ -450,7 +450,7 @@ async def sendAudio(
else:
caption = {"@type": "formattedText", "text": caption, "entities": []}

if load_replied_message == None and not self.use_message_database:
if load_replied_message is None and not self.use_message_database:
load_replied_message = True

if (
Expand Down Expand Up @@ -609,7 +609,7 @@ async def sendDocument(
else:
caption = {"@type": "formattedText", "text": caption, "entities": []}

if load_replied_message == None and not self.use_message_database:
if load_replied_message is None and not self.use_message_database:
load_replied_message = True

if (
Expand Down Expand Up @@ -780,7 +780,7 @@ async def sendPhoto(
else:
caption = {"@type": "formattedText", "text": caption, "entities": []}

if load_replied_message == None and not self.use_message_database:
if load_replied_message is None and not self.use_message_database:
load_replied_message = True

if (
Expand Down Expand Up @@ -963,7 +963,7 @@ async def sendVideo(
else:
caption = {"@type": "formattedText", "text": caption, "entities": []}

if load_replied_message == None and not self.use_message_database:
if load_replied_message is None and not self.use_message_database:
load_replied_message = True

if (
Expand Down Expand Up @@ -1101,7 +1101,7 @@ async def sendVideoNote(

"""

if load_replied_message == None and not self.use_message_database:
if load_replied_message is None and not self.use_message_database:
load_replied_message = True

if (
Expand Down Expand Up @@ -1256,7 +1256,7 @@ async def sendVoice(
else:
caption = {"@type": "formattedText", "text": caption, "entities": []}

if load_replied_message == None and not self.use_message_database:
if load_replied_message is None and not self.use_message_database:
load_replied_message = True

if (
Expand Down Expand Up @@ -1391,7 +1391,7 @@ async def sendSticker(
:class:`~pytdbot.types.Result`
"""

if load_replied_message == None and not self.use_message_database:
if load_replied_message is None and not self.use_message_database:
load_replied_message = True

if (
Expand Down Expand Up @@ -1551,7 +1551,7 @@ async def sendCopy(
"entities": [],
}

if load_replied_message == None and not self.use_message_database:
if load_replied_message is None and not self.use_message_database:
load_replied_message = True

if (
Expand Down
3 changes: 2 additions & 1 deletion pytdbot/types/result/result.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from asyncio import Event
from json import dumps
import binascii, os
import binascii
import os

RETRY_AFTER_PREFEX = "Too Many Requests: retry after "

Expand Down