Skip to content

Commit

Permalink
send command for all hadith to client
Browse files Browse the repository at this point in the history
send english text
  • Loading branch information
saber13812002 committed Nov 6, 2023
1 parent 819b8df commit 449678b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/Helpers/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static function generateDetailHadithMessage($academyOfIslamDataItem): str

$botType = Config::get('config.bot.type', 'bale'); //bottype

$isLong = Str::length(strip_tags($arabic)) > 1000;
$isLong = Str::length(strip_tags($arabic)) > 100;

if ($id2) {
self::saveLongTextToDB($academyOfIslamDataItem);
Expand Down Expand Up @@ -311,8 +311,8 @@ public static function getStringHadith($book, $number, $part, $chapter, $arabic,
' . trans("hadith.result.book: ") . strip_tags($book) . '
' . trans("hadith.result.part: ") . strip_tags($part) . '
' . trans("hadith.result.chapter: ") . strip_tags($chapter) . '
' . trans("hadith.result.arabic text: ") . ($isLong ? (substr($arabic, 0, 1000) . "...") : strip_tags($arabic)) . (App::getLocale() != 'fa' ? '
' . trans("hadith.result.english text: ") . substr($english, 0, 100) . '...' : "") . '
' . trans("hadith.result.arabic text: ") . ($isLong ? (substr(strip_tags($arabic), 0, 1500) . "...") : strip_tags($arabic)) . (App::getLocale() ? '
' . trans("hadith.result.english text: ") . substr(strip_tags($english), 0, 1000) . '...' : "") . '
' . trans("hadith.result.id: ") . $id2;
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/HadithSearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function index(BotRequest $request)
$id2 = substr($bot->Text(), 5);
$hadith = BotHadithItem::query()->where("id2", $id2)->first();
if ($hadith)
BotHelper::sendMessage($bot, $this->getHadith($hadith));
BotHelper::sendLongMessage($bot, $this->getHadith($hadith));
else
BotHelper::sendMessage($bot, trans("bot.not found"));
} else {
Expand Down

0 comments on commit 449678b

Please sign in to comment.