Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
Update ForceSubscribe.py
Browse files Browse the repository at this point in the history
  • Loading branch information
InukaAsith authored Mar 27, 2021
1 parent abcb8e7 commit 7ed33fd
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions DaisyX/modules/ForceSubscribe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (C) 2020-2021 by @InukaAsith
# This programme is a part of DaisyX TG bot project
# This programme is a part of Liza TG bot project
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -56,13 +56,13 @@ def _onUnMuteRequest(client, cb):
except UserNotParticipant:
client.answer_callback_query(
cb.id,
text=f"❗ අපේ @{channel} channel එකට Join වෙලා 'UnMute Me' button එක ආපහු ඔබන්න.",
text=f"❗ Join our @{channel} channel and press 'UnMute Me' button.",
show_alert=True,
)
else:
client.answer_callback_query(
cb.id,
text="❗ ඔයාව වෙන හේතුවක් නිසා Admin ල mute කරලයි ඉන්නෙ.",
text="❗ You have been muted by admins due to some other reason.",
show_alert=True,
)
else:
Expand All @@ -78,7 +78,7 @@ def _onUnMuteRequest(client, cb):
else:
client.answer_callback_query(
cb.id,
text="❗ අවවාදයයි: ඔයාට කතාකරන්න පුලුවන්කම තියෙද්දි button එක click කරන්න එපා.",
text="❗ Warning! Don't press the button when you cn talk.",
show_alert=True,
)

Expand All @@ -100,17 +100,23 @@ def _check_member(client, message):
except UserNotParticipant:
try:
sent_message = message.reply_text(
"ආයුබෝවන් {} 🙏 \n \n **ඔයා අපේ @{} Channel එකට තාම Join වෙලා නෑ** 😭 \n කරුණාකරල ඒකට Join වෙලා පහල තියන **UNMUTE ME** Button එක touch කරන්න. \n \n **[👉 OUR CHANNEL 👈](https://t.me/{})**".format(
"Welcome {} 🙏 \n **You havent joined our @{} Channel yet** 😭 \n \nPlease Join [Our Channel](https://t.me/{}) and hit the **UNMUTE ME** Button. \n \n ".format(
message.from_user.mention, channel, channel
),
disable_web_page_preview=True,
reply_markup=InlineKeyboardMarkup(
[
[
InlineKeyboardButton(
"Join Channel",
url="https://t.me/{}".format(channel),
)
],
[
InlineKeyboardButton(
"UnMute Me", callback_data="onUnMuteRequest"
)
]
],
]
),
)
Expand All @@ -119,13 +125,13 @@ def _check_member(client, message):
)
except ChatAdminRequired:
sent_message.edit(
"❗ **මම මේකෙ Admin නෙමෙයි..**\n__මට Ban Permissions එක්ක Admin දීල ආපහු උත්සාහ කරන්න.. \n#Ending FSub...__"
"❗ **Daisy is not admin here..**\n__Give me ban permissions and retry.. \n#Ending FSub...__"
)

except ChatAdminRequired:
client.send_message(
chat_id,
text=f"❗ **මම @{channel} එකේ Admin නෙමෙයි.**\n__මට ඒකෙ Admin දීල ආපහු Add කරන්න.\n#Leaving this chat...__",
text=f"❗ **I not an admin of @{channel} channel.**\n__Give me admin of that channel and retry.\n#Ending FSub...__",
)


Expand Down Expand Up @@ -190,9 +196,8 @@ def config(client, message):
__help__ = """
*ForceSubscribe:*
*Channel Manageer Inbuilt*
✪ ඔයාගෙ ගෲප් එකේ මෙම්බර්ස්ල Channel එකක් හෝ කිහිපයක් Subscribe කරනකන් Message දාන එක නවත්තන්න මට පුලූවන්.
✪ සාමාජිකයන් ඔබේ Channel එකට සම්බන්ධ නොවූයේ නම් මම ඔවුන්ව නිශ්ශබ්ද කර channel එකට සම්බන්ධ වන ලෙස පවසන්න සහ බොත්තමක් එබීමෙන් ඔවුන්ව නිශ්ශබ්ද කරන්න මට පුලුවන්.
✪ Daisy can mute members who are not subscribed your channel until they subscribe
✪ When enabled I will mute unsubscribed members and show them a unmute button. When they pressed the button I will unmute them
*Setup*
1) First of all add me in the group as admin with ban users permission and in the channel as admin.
Expand All @@ -206,7 +211,6 @@ def config(client, message):
Note: /FSub is an alias of /ForceSubscribe
💭 Only on Sinhala 🇱🇰 yet
"""
__mod_name__ = "📢 Force Subscribe 💭"

0 comments on commit 7ed33fd

Please sign in to comment.