Skip to content

Commit

Permalink
0.32.4
Browse files Browse the repository at this point in the history
optimization for hidden forward
  • Loading branch information
LyoSU committed Jan 14, 2022
1 parent 7681d03 commit fcea5b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions handlers/quote.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,23 +203,15 @@ module.exports = async (ctx, next) => {

if (quoteMessage.forward_sender_name) {
if (flag.hidden) {
let sarchForwardName

sarchForwardName = await ctx.db.User.find({
const sarchForwardName = await ctx.db.User.find({
full_name: quoteMessage.forward_sender_name
})

// if (sarchForwardName.length === 0) {
// sarchForwardName = await ctx.db.User.find({
// $expr: { $eq: [quoteMessage.forward_sender_name, { $concat: ['$first_name', ' ', '$last_name'] }] }
// })
// }

if (sarchForwardName.length === 0) {
sarchForwardName = await ctx.db.User.find({
first_name: quoteMessage.forward_sender_name
})
}
// }\

if (sarchForwardName.length === 1) {
messageFrom = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quote-bot",
"version": "0.32.3",
"version": "0.32.4",
"description": "Telegram quote bot",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit fcea5b9

Please sign in to comment.