Skip to content

Commit ee98ee9

Browse files
committed
Force the insert of the new user at welcome
1 parent f0b6810 commit ee98ee9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tg_bot/modules/welcome.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from telegram.ext import MessageHandler, Filters, CommandHandler, run_async
1010
from telegram.utils.helpers import mention_markdown, mention_html, escape_markdown
1111

12+
import tg_bot.modules.sql.users_sql as user_sql
1213
import tg_bot.modules.sql.welcome_sql as sql
1314
from tg_bot import BAN_STICKER
1415
from tg_bot import dispatcher, OWNER_ID, LOGGER
@@ -154,6 +155,11 @@ def new_member(bot: Bot, update: Update):
154155
continue
155156

156157
else:
158+
# Adding the new user to the database
159+
user_sql.update_user(new_mem.id,
160+
new_mem.username,
161+
chat.id,
162+
chat.title)
157163
# Muting new users
158164
bot.restrict_chat_member(
159165
chat.id, new_mem.id, can_send_messages=False

0 commit comments

Comments
 (0)