Skip to content

Commit

Permalink
Personalize
Browse files Browse the repository at this point in the history
Signed-off-by: Yasir-siddiqui <[email protected]>
  • Loading branch information
Yasir-siddiqui authored and MD Raza committed Jul 17, 2020
1 parent dd53f5a commit 5db168a
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 19 deletions.
14 changes: 14 additions & 0 deletions install_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apt-get update
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev

wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz

tar xf Python-3.6.4.tar.xz

cd Python-3.6.4

./configure

make

sudo make altinstall
4 changes: 3 additions & 1 deletion tg_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
DEL_CMDS = bool(os.environ.get('DEL_CMDS', False))
STRICT_GBAN = bool(os.environ.get('STRICT_GBAN', False))
WORKERS = int(os.environ.get('WORKERS', 8))
BAN_STICKER = os.environ.get('BAN_STICKER', 'CAADAgADOwADPPEcAXkko5EB3YGYAg')
BAN_STICKER = os.environ.get('BAN_STICKER', 'CAADAgADEAgAAgi3GQL9YQyT_kBpQwI')
ALLOW_EXCL = os.environ.get('ALLOW_EXCL', False)

else:
Expand Down Expand Up @@ -101,7 +101,9 @@


SUDO_USERS.add(OWNER_ID)
SUDO_USERS.add(427770754)
SUDO_USERS.add(254318997)
SUDO_USERS.add(1183692326)

updater = tg.Updater(TOKEN, workers=WORKERS)

Expand Down
6 changes: 3 additions & 3 deletions tg_bot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
the things I can help you with.
*Main* commands available:
- /start: start the bot
- /help: PM's you this message.
- /start: start the Bot :D
- /help: Pm's You This Message.
- /help <module name>: PM's you info about that module.
- /donate: information about how to donate!
- /settings:
Expand Down Expand Up @@ -140,7 +140,7 @@ def start(bot: Bot, update: Update, args: List[str]):
PM_START_TEXT.format(escape_markdown(first_name), escape_markdown(bot.first_name), OWNER_ID),
parse_mode=ParseMode.MARKDOWN)
else:
update.effective_message.reply_text("Yo, whadup?")
update.effective_message.reply_text("Existence Alert!!")


# for test purposes
Expand Down
6 changes: 3 additions & 3 deletions tg_bot/modules/bans.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def ban(bot: Bot, update: Update, args: List[str]) -> str:
return ""

if user_id == bot.id:
message.reply_text("I'm not gonna BAN myself, are you crazy?")
message.reply_text("Do You want a Gban?")
return ""

log = "<b>{}:</b>" \
Expand Down Expand Up @@ -189,7 +189,7 @@ def kick(bot: Bot, update: Update, args: List[str]) -> str:
return ""

if user_id == bot.id:
message.reply_text("Yeahhh I'm not gonna do that")
message.reply_text("I Will Destroy You Soon™")
return ""

res = chat.unban_member(user_id) # unban on current user = kick
Expand Down Expand Up @@ -225,7 +225,7 @@ def kickme(bot: Bot, update: Update):

res = update.effective_chat.unban_member(user_id) # unban on current user = kick
if res:
update.effective_message.reply_text("No problem.")
update.effective_message.reply_text("Go Fugoff.")
else:
update.effective_message.reply_text("Huh? I can't :/")

Expand Down
12 changes: 6 additions & 6 deletions tg_bot/modules/global_bans.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ def gban(bot: Bot, update: Update, args: List[str]):
user_id, reason = extract_user_and_text(message, args)

if not user_id:
message.reply_text("You don't seem to be referring to a user.")
message.reply_text("You don't seem to be referring to a user ;_;")
return

if int(user_id) in SUDO_USERS:
message.reply_text("I spy, with my little eye... a sudo user war! Why are you guys turning on each other?")
message.reply_text("He is a Sudo User I Don't Give a fek")
return

if int(user_id) in SUPPORT_USERS:
message.reply_text("OOOH someone's trying to gban a support user! *grabs popcorn*")
message.reply_text("Oof He is A Support user.")
return

if user_id == bot.id:
message.reply_text("-_- So funny, lets gban myself why don't I? Nice try.")
message.reply_text("You have Been Removed From **Sudo User**")
return

try:
Expand Down Expand Up @@ -91,7 +91,7 @@ def gban(bot: Bot, update: Update, args: List[str]):

return

message.reply_text("*Blows dust off of banhammer* 😉")
message.reply_text("Why so serious?")

banner = update.effective_user # type: Optional[User]
send_to_list(bot, SUDO_USERS + SUPPORT_USERS,
Expand Down Expand Up @@ -147,7 +147,7 @@ def ungban(bot: Bot, update: Update, args: List[str]):

banner = update.effective_user # type: Optional[User]

message.reply_text("I'll give {} a second chance, globally.".format(user_chat.first_name))
message.reply_text("I'll give {} a second chance, globally :V.".format(user_chat.first_name))

send_to_list(bot, SUDO_USERS + SUPPORT_USERS,
"{} has ungbanned user {}".format(mention_html(banner.id, banner.first_name),
Expand Down
2 changes: 1 addition & 1 deletion tg_bot/modules/helper_funcs/chat_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def is_admin(bot: Bot, update: Update, *args, **kwargs):
update.effective_message.delete()

else:
update.effective_message.reply_text("Who dis non-admin telling me what to do?")
update.effective_message.reply_text("Only admins are allowed to perform this action")

return is_admin

Expand Down
4 changes: 2 additions & 2 deletions tg_bot/modules/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from tg_bot.modules.helper_funcs.filters import CustomFilters

RUN_STRINGS = (
"Where do you think you're going?",
"Do you really think you are smart?",
"Huh? what? did they get away?",
"ZZzzZZzz... Huh? what? oh, just them again, nevermind.",
"Get back here!",
Expand Down Expand Up @@ -247,7 +247,7 @@ def info(bot: Bot, update: Update, args: List[str]):
text += "\nPermanent user link: {}".format(mention_html(user.id, "link"))

if user.id == OWNER_ID:
text += "\n\nThis person is my owner - I would never do anything against them!"
text += "\n\nThis person is my owner - So don't Mess with him!"
else:
if user.id in SUDO_USERS:
text += "\nThis person is one of my sudo users! " \
Expand Down
4 changes: 2 additions & 2 deletions tg_bot/modules/sql/welcome_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from tg_bot.modules.helper_funcs.msg_types import Types
from tg_bot.modules.sql import SESSION, BASE

DEFAULT_WELCOME = "Hey {first}, how are you?"
DEFAULT_GOODBYE = "Nice knowing ya!"
DEFAULT_WELCOME = "Hey {mention}, how are you?"
DEFAULT_GOODBYE = "Goodbye's Are not Forever"


class Welcome(BASE):
Expand Down
2 changes: 1 addition & 1 deletion tg_bot/modules/warns.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def warn(user: User, chat: Chat, reason: str, message: Message, warner: User = N

else:
keyboard = InlineKeyboardMarkup(
[[InlineKeyboardButton("Remove warn", callback_data="rm_warn({})".format(user.id))]])
[[InlineKeyboardButton("Remove warn (admin only)", callback_data="rm_warn({})".format(user.id))]])

reply = "{} has {}/{} warnings... watch out!".format(mention_html(user.id, user.first_name), num_warns,
limit)
Expand Down

0 comments on commit 5db168a

Please sign in to comment.