* Ultroid 2025 Co-authored-by: New-dev0 <New-dev0@users.noreply.github.com> Co-authored-by: Amit Sharma <buddhhu@users.noreply.github.com> Co-authored-by: TechiError <techierror@users.noreply.github.com> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com> Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com> Co-authored-by: sppidy <sppidy@users.noreply.github.com>
36 lines
804 B
Python
36 lines
804 B
Python
# Ultroid - UserBot
|
|
# Copyright (C) 2021-2025 TeamUltroid
|
|
#
|
|
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
|
# PLease read the GNU Affero General Public License in
|
|
# <https://github.com/TeamUltroid/pyUltroid/blob/main/LICENSE>.
|
|
|
|
|
|
from .. import udB
|
|
|
|
|
|
def get_chats():
|
|
return udB.get_key("FORCESUB") or {}
|
|
|
|
|
|
def add_forcesub(chat_id, chattojoin):
|
|
omk = get_chats()
|
|
omk.update({chat_id: chattojoin})
|
|
return udB.set_key("FORCESUB", omk)
|
|
|
|
|
|
def get_forcesetting(chat_id):
|
|
omk = get_chats()
|
|
if chat_id in omk.keys():
|
|
return omk[chat_id]
|
|
|
|
|
|
def rem_forcesub(chat_id):
|
|
omk = get_chats()
|
|
if chat_id in omk.keys():
|
|
try:
|
|
del omk[chat_id]
|
|
return udB.set_key("FORCESUB", omk)
|
|
except KeyError:
|
|
return False
|