mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Capture user settings update exception
This commit is contained in:
@@ -42,13 +42,17 @@ export async function createApprovedBot(token: string, state: BotState): Promise
|
|||||||
bot.use(async (ctx: Context, next) => {
|
bot.use(async (ctx: Context, next) => {
|
||||||
if (ctx.from) {
|
if (ctx.from) {
|
||||||
const user = ctx.from;
|
const user = ctx.from;
|
||||||
|
|
||||||
createOrUpdateUserSettings({
|
createOrUpdateUserSettings({
|
||||||
user_id: user.id,
|
user_id: user.id,
|
||||||
last_name: user.last_name || '',
|
last_name: user.last_name || '',
|
||||||
first_name: user.first_name,
|
first_name: user.first_name,
|
||||||
username: user.username || '',
|
username: user.username || '',
|
||||||
source: me.username,
|
source: me.username,
|
||||||
|
}).catch((e) => {
|
||||||
|
Sentry.captureException(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
UsersCounter.take(user.id, me.username);
|
UsersCounter.take(user.id, me.username);
|
||||||
}
|
}
|
||||||
await next();
|
await next();
|
||||||
|
|||||||
Reference in New Issue
Block a user