Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.
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
2 changes: 1 addition & 1 deletion Stella/database/connection_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def allow_collection(chat_id, chat_title, allow_collection):
'chat_id': chat_id
}
)
if chat_data == None:
if chat_data is None:
ChatsNums = chats.count_documents({})
ChatsIDs = ChatsNums + 1

Expand Down
8 changes: 4 additions & 4 deletions Stella/database/federation_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def new_fed_db(new_fed, fed_id, created_time, owner_id):
}
)

if GetFed == None:
if GetFed is None:
FedNums = federation.count_documents({})
FedIDs = FedNums + 1
federation.insert_one(
Expand All @@ -41,7 +41,7 @@ def new_fed_db(new_fed, fed_id, created_time, owner_id):
)

def is_fed_exist(fed_id=None, owner_id=None) -> bool:
if fed_id == None:
if fed_id is None:
GetFed = federation.find_one(
{
'owner_id': owner_id
Expand Down Expand Up @@ -174,7 +174,7 @@ def get_fed_from_ownerid(owner_id):
'owner_id': owner_id
}
)
if not fedData == None:
if not fedData is None:
fed_id = fedData['fed_id']
return fed_id
else:
Expand Down Expand Up @@ -209,7 +209,7 @@ def get_connected_chats(fed_id) -> list:
return None

def get_fed_name(fed_id=None, owner_id=None):
if fed_id == None:
if fed_id is None:
GetFed = federation.find_one(
{
'owner_id': owner_id
Expand Down
8 changes: 4 additions & 4 deletions Stella/database/notes_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def SaveNote(chat_id, note_name, content, text, data_type):
totalNote = notes.count_documents({})
NotesIDs = totalNote + 1

if GetNotes == None:
if GetNotes is None:
NoteData = {
'_id': NotesIDs,
'chat_id': chat_id,
Expand Down Expand Up @@ -121,7 +121,7 @@ def GetNote(chat_id, note_name):
}
)

if not GetNoteData == None:
if not GetNoteData is None:
Getnotes = GetNoteData['notes']
for note in Getnotes:
GetNote = note['note_name']
Expand Down Expand Up @@ -165,7 +165,7 @@ def NoteList(chat_id) -> list:
'chat_id': chat_id
}
)
if not GetNoteData == None:
if not GetNoteData is None:
if 'notes' in GetNoteData:
Getnotes = GetNoteData['notes']
for note in Getnotes:
Expand Down Expand Up @@ -214,7 +214,7 @@ def is_pnote_on(chat_id) -> bool:
'chat_id': chat_id
}
)
if not GetNoteData == None:
if not GetNoteData is None:
if 'private_note' in GetNoteData:
private_note = GetNoteData['private_note']
return private_note
Expand Down
4 changes: 2 additions & 2 deletions Stella/database/users_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def add_user(user_id, username=None, chat_id=None, chat_title=None, Forwared=Fal
}
)

if UserData == None:
if UserData is None:
UsersNums = users.count_documents({})
UsersIDs = UsersNums + 1

Expand Down Expand Up @@ -95,7 +95,7 @@ def add_chat(chat_id, chat_title):
}
)

if ChatData == None:
if ChatData is None:
ChatsNums = chats.count_documents({})
ChatsIDs = ChatsNums + 1

Expand Down
42 changes: 21 additions & 21 deletions Stella/database/welcome_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def SetWelcome(chat_id, Content, Text, DataType):
WelcomeDataCount = welcome.count_documents({})
WelcomeIDs = WelcomeDataCount + 1

if WelcomeData == None:
if WelcomeData is None:
WelcomeSetData = {
'_id': WelcomeIDs,
'welcome': True,
Expand Down Expand Up @@ -54,7 +54,7 @@ def UnSetWelcome(chat_id):
'chat_id': chat_id
}
)
if not WelcomeData == None:
if not WelcomeData is None:
if 'text' in WelcomeData['welcome_message']:
welcome.update_one(
{
Expand All @@ -78,7 +78,7 @@ def GetWelcome(chat_id):
)

if not (
GetWelcomeData == None
GetWelcomeData is None
):
if 'text' in GetWelcomeData['welcome_message']:
Content = GetWelcomeData['welcome_message']['content']
Expand Down Expand Up @@ -111,7 +111,7 @@ def GetWelcomemessageOnOff(chat_id) -> bool:
}
)

if not GetWelcomeData == None:
if not GetWelcomeData is None:
if 'welcome' in GetWelcomeData:
return GetWelcomeData['welcome']
else:
Expand All @@ -126,7 +126,7 @@ def isWelcome(chat_id) -> bool:
}
)
if (
GetWelcomeData == None
GetWelcomeData is None
or not (
'welcome_message' in GetWelcomeData
and 'text' in GetWelcomeData['welcome_message']
Expand All @@ -147,7 +147,7 @@ def SetGoodBye(chat_id, Content, Text, DataType):
WelcomeDataCount = welcome.count_documents({})
WelcomeIDs = WelcomeDataCount + 1

if WelcomeData == None:
if WelcomeData is None:
WelcomeSetData = {
'_id': WelcomeIDs,
'welcome': True,
Expand Down Expand Up @@ -184,7 +184,7 @@ def UnSetGoodbye(chat_id):
'chat_id': chat_id
}
)
if not WelcomeData == None:
if not WelcomeData is None:
if 'text' in WelcomeData['goodbye_message']:
welcome.update_one(
{
Expand All @@ -208,7 +208,7 @@ def GetGoobye(chat_id):
)

if not (
GetWelcomeData == None
GetWelcomeData is None
):
if 'text' in GetWelcomeData['goodbye_message']:
Content = GetWelcomeData['goodbye_message']['content']
Expand Down Expand Up @@ -241,7 +241,7 @@ def GetGoodbyemessageOnOff(chat_id) -> bool:
}
)

if not GetWelcomeData == None:
if not GetWelcomeData is None:
if 'goodbye' in GetWelcomeData:
return GetWelcomeData['goodbye']
else:
Expand All @@ -257,7 +257,7 @@ def isGoodbye(chat_id) -> bool:
}
)
if (
GetWelcomeData == None
GetWelcomeData is None
or not (
'goodbye_message' in GetWelcomeData
and 'text' in GetWelcomeData['goodbye_message']
Expand All @@ -279,7 +279,7 @@ def SetCleanService(chat_id, clean_service):
WelcomeIDs = WelcomeDataCount + 1

if not (
WelcomeData == None
WelcomeData is None
):
welcome.update_one(
{
Expand Down Expand Up @@ -307,7 +307,7 @@ def GetCleanService(chat_id) -> bool:
}
)

if not GetWelcomeData == None:
if not GetWelcomeData is None:
if 'clean_service' in GetWelcomeData:
return GetWelcomeData['clean_service']
else:
Expand All @@ -325,7 +325,7 @@ def SetCleanWelcome(chat_id, clean_welcome):
}
)

if not GetWelcomeData == None:
if not GetWelcomeData is None:
welcome.update_one(
{
'chat_id': chat_id
Expand Down Expand Up @@ -353,7 +353,7 @@ def SetCleanWelcomeMessage(chat_id, message_id):
'chat_id': chat_id
}
)
if not GetWelcomeData == None:
if not GetWelcomeData is None:
if 'clean_welcome_message' in GetWelcomeData:
welcome.update_one(
{
Expand All @@ -372,7 +372,7 @@ def GetCleanWelcome(chat_id) -> bool:
'chat_id': chat_id
}
)
if not GetWelcomeData == None:
if not GetWelcomeData is None:
if 'clean_welcome' in GetWelcomeData:
return GetWelcomeData['clean_welcome']
else:
Expand All @@ -386,7 +386,7 @@ def GetCleanWelcomeMessage(chat_id):
'chat_id': chat_id
}
)
if not GetWelcomeData == None:
if not GetWelcomeData is None:
if 'clean_welcome_message' in GetWelcomeData:
clean_message = GetWelcomeData['clean_welcome_message']
return clean_message
Expand All @@ -403,7 +403,7 @@ def SetCaptcha(chat_id, captcha):
'chat_id': chat_id
}
)
if not GetCaptchaData == None:
if not GetCaptchaData is None:
welcome.update_one(
{
'chat_id': chat_id
Expand Down Expand Up @@ -446,7 +446,7 @@ def isGetCaptcha(chat_id) -> bool:
}
)

if not GetCaptchaData == None:
if not GetCaptchaData is None:
if 'captcha' in GetCaptchaData:
return GetCaptchaData['captcha']['_captcha']
return False
Expand All @@ -462,7 +462,7 @@ def GetCaptchaSettings(chat_id):

captcha_text_de = "Click here to prove you're human"

if not GetCaptchaData == None:
if not GetCaptchaData is None:
if 'captcha' in GetCaptchaData:
captcha_mode = GetCaptchaData['captcha']['captcha_mode']
captcha_text = GetCaptchaData['captcha']['captcha_text']
Expand Down Expand Up @@ -501,7 +501,7 @@ def SetCaptchaText(chat_id, captcha_text):
'chat_id': chat_id
}
)
if not GetCaptchaData == None:
if not GetCaptchaData is None:
if 'captcha' in GetCaptchaData:
welcome.update_one(
{
Expand Down Expand Up @@ -559,7 +559,7 @@ def SetCaptchaMode(chat_id, captcha_mode):
}
)

if not GetCaptchaData == None:
if not GetCaptchaData is None:
if 'captcha' in GetCaptchaData:
welcome.update_one(
{
Expand Down
4 changes: 2 additions & 2 deletions Stella/helper/chat_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async def isBotCan(message: Message, chat_id: int = None, permissions: str = 'ca
if GetData[permissions]:
return True
else:
if silent == False:
if silent is False:
await message.reply(
BOT_PERMISSIONS_STRINGS[permissions]
)
Expand Down Expand Up @@ -264,7 +264,7 @@ async def isUserCan(message, user_id: int = None, chat_id: int = None, permissio
):
return True
else:
if silent == False:
if silent is False:
await message.reply(
USERS_PERMISSIONS_STRINGS[permissions]
)
Expand Down
4 changes: 2 additions & 2 deletions Stella/helper/note_helper/note_fillings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@


def NoteFillings(message, message_text):
if not message == None:
if not message is None:
user_id = message.from_user.id
first_name = message.from_user.first_name
last_name = message.from_user.last_name
if last_name == None:
if last_name is None:
last_name = ''
full_name = f'{first_name} {last_name}'
username = message.from_user.username
Expand Down
4 changes: 2 additions & 2 deletions Stella/helper/welcome_helper/welcome_fillings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
import html

def Welcomefillings(message, message_text, NewUserJson):
if not NewUserJson == None:
if not NewUserJson is None:
user_id = NewUserJson.id
first_name = NewUserJson.first_name
last_name = NewUserJson.last_name
if last_name == None:
if last_name is None:
last_name = ''
full_name = f'{first_name} {last_name}'
username = NewUserJson.username
Expand Down
2 changes: 1 addition & 1 deletion Stella/plugins/connection/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def Connect(client, message):
return

chat_title = await GetChat(int(chat_id))
if chat_title == None:
if chat_title is None:
await message.reply(
"failed to connect to chat!\nError: `chat not found`",
quote=True
Expand Down
2 changes: 1 addition & 1 deletion Stella/plugins/federation/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def fed_checker(client, message):
user_id = message.from_user.id
fed_id = get_fed_from_chat(chat_id)

if not fed_id == None:
if not fed_id is None:
if is_user_fban(fed_id, user_id):
fed_reason = get_fed_reason(fed_id, user_id)
text = (
Expand Down
2 changes: 1 addition & 1 deletion Stella/plugins/federation/federation_owner/fedpromote.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def FedPromote(client, message):
return

if (
fed_id == None
fed_id is None
):
await message.reply(
"Only federation creators can promote people, and you don't even seem to have a federation to promote to!"
Expand Down
2 changes: 1 addition & 1 deletion Stella/plugins/federation/federation_owner/rename_fed.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def Rename_fed(client, message):
return

fed_id = get_fed_from_ownerid(owner_id)
if fed_id == None:
if fed_id is None:
await message.reply(
"It doesn't look like you have a federation yet!"
)
Expand Down
2 changes: 1 addition & 1 deletion Stella/plugins/greeting/captcha/captcha_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def CaptchaMode(client, message):
else:
captcha_mode, captcha_text, captcha_kick_time = GetCaptchaSettings(chat_id)

if captcha_mode == None:
if captcha_mode is None:
captcha_mode = 'button'

await message.reply(
Expand Down
Loading