Skip to content

Commit

Permalink
fix start text not updating in RunTime (UsergeTeam#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishna-Singhal authored Jul 26, 2021
1 parent 511737f commit eb6f3f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion userge/plugins/utils/botpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async def _init():
'header': "Bot Pm handlers like Livegram Bot.",
'description': "You can use this command to enable/disable Bot Pm.\n"
"You can see all the settings of your bot after enabling "
"bot pm and hit /start in your Bot DM."
"bot pm and hit /start in your Bot DM.\n"
"Note: You have to us Bot mode or Dual mode if you want to enable Bot Pm.",
'usage': "{tr}botpm"})
async def bot_pm(msg: Message):
Expand Down Expand Up @@ -158,13 +158,15 @@ async def start(_, msg: PyroMessage):

@bot.on_message(filters.user(userge_id) & filters.private & filters.command("settext"))
async def set_text(_, msg: PyroMessage):
global START_TEXT # pylint: disable=global-statement
text = msg.text.split(' ', maxsplit=1)[1] if ' ' in msg.text else ''
replied = msg.reply_to_message
if replied:
text = replied.text or replied.caption
if not text:
await msg.reply("Text not found!")
else:
START_TEXT = text
await SAVED_SETTINGS.update_one(
{"_id": "BOT_START_TEXT"}, {"$set": {"data": text}}, upsert=True
)
Expand Down

0 comments on commit eb6f3f7

Please sign in to comment.