PHPackages                             jose13/larave-linebot-lottery - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jose13/larave-linebot-lottery

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jose13/larave-linebot-lottery
=============================

line-bot lotteryCrawler

v1.0.0(4y ago)0101MITPHPPHP ^7.4

Since Dec 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Moferor/laravel-linebot-lottery)[ Packagist](https://packagist.org/packages/jose13/larave-linebot-lottery)[ RSS](/packages/jose13-larave-linebot-lottery/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (16)Versions (2)Used By (0)

laravel-linebot-lottery
=======================

[](#laravel-linebot-lottery)

[![packagist](https://camo.githubusercontent.com/3c8f616d1563a1f4a6ab350b201fb68b75db9140d2f98f43b1b5921af9817f63/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f736531332f6c61726176652d6c696e65626f742d6c6f74746572793f636f6c6f723d6f72616e676526696e636c7564655f70726572656c6561736573)](https://packagist.org/packages/jose13/larave-linebot-lottery)[![WSL](https://camo.githubusercontent.com/dcd77b4cae6ff3cf709f0cd90529bd45a1a4626001bd3cdfd56a087ff1c566cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d77696e646f77732532302537432532306c696e75782d626c7565)](https://packagist.org/packages/jose13/larave-linebot-lottery)[![laravel](https://camo.githubusercontent.com/ddb698157732a6f822c24dd1a81b6db68c9fd3624d27bca9355be951df6a857a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d253545382e302d677265656e)](https://packagist.org/packages/jose13/larave-linebot-lottery)[![php Version](https://camo.githubusercontent.com/0c7d073fd98be2ebdda30a23c45e0dca56b519ab9209b67bd7b4c2782c6df275/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a6f736531332f6c61726176652d6c696e65626f742d6c6f7474657279)](https://packagist.org/packages/jose13/larave-linebot-lottery)[![Total Downloads](https://camo.githubusercontent.com/ece2f34a915e92ad6952cce33d8fbcea7365543cf85aca2848e0e2274a57e23c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f736531332f6c61726176652d6c696e65626f742d6c6f74746572793f636f6c6f723d626c7565)](https://packagist.org/packages/jose13/larave-linebot-lottery)[![License](https://camo.githubusercontent.com/2220255cdd3ba229ea222079c421121de6f5d6df8e2eda6846c070b3978f4c9a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6f736531332f6c61726176652d6c696e65626f742d6c6f7474657279)](https://packagist.org/packages/jose13/larave-linebot-lottery)

說明

藉由 Line bot 及爬蟲應用，可於 Line 中獲取樂透號碼(最新球號或指定日期球號)，以及基本可自定義的對話回應功能。

準備
--

[](#準備)

### 一個 HTTPS 網址

[](#一個-https-網址)

本人是使用 [ngrok](https://ngrok.com/) 作為臨時的測試網址使用。

### 註冊及設定一個 Messaging API 頻道

[](#註冊及設定一個-messaging-api-頻道)

前往 [Line Developers](https://developers.line.biz/console/) 建立一個新的 Messaging API 頻道，可以參考 [官方教學](https://developers.line.biz/zh-hant/docs/messaging-api/getting-started/) 。

> 創建完成後進入頻道頁面

[![創建頻道](https://user-images.githubusercontent.com/16284391/135816978-0e7d351f-df9a-4874-b136-8c27b8a2456a.png)](https://user-images.githubusercontent.com/16284391/135816978-0e7d351f-df9a-4874-b136-8c27b8a2456a.png)

記下頻道頁面中 `Basic setting` 選項裡，`Channel secret` 產生的數值。

記下頻道頁面中 `Messaging API` 選項裡，`Channel access token` 產生的數值。

頻道頁面中 `Messaging API` 選項裡，設定 Webhook :

[![設定webhook網址](https://user-images.githubusercontent.com/16284391/135817170-e5c9fe14-c806-4208-850f-cbfb0498022b.png)](https://user-images.githubusercontent.com/16284391/135817170-e5c9fe14-c806-4208-850f-cbfb0498022b.png)

將 Line 回應設定成下圖 :

[![設定Line回應](https://user-images.githubusercontent.com/16284391/135817242-436a5d10-5cb7-4279-b25e-8667707e8c07.png)](https://user-images.githubusercontent.com/16284391/135817242-436a5d10-5cb7-4279-b25e-8667707e8c07.png)

### 創建一個 Laravel 專案

[](#創建一個-laravel-專案)

開啟`.env` 設定記下的`Channel secret` 及 `Channel access token` ：

```
LINE_BOT_CHANNEL_ACCESS_TOKEN=024IcFhCPF.....
LINE_BOT_CHANNEL_SECRET=cd2a0b42a7835.....

```

> 注意：`LINE_BOT_CHANNEL_ACCESS_TOKEN` 及 `LINE_BOT_CHANNEL_SECRET` 名稱需一致不得更改

安裝
--

[](#安裝)

使用 Composer 安裝套件：

```
composer require jose13/larave-linebot-lottery
```

發布設定檔案(可選擇不發布，將以預設檔呈現功能項目)：

```
php artisan vendor:publish --provider=Jose13\\LaravelLineBotLottery\\LinebotServiceProvider
```

開始使用
----

[](#開始使用)

### 立即使用

[](#立即使用)

> 如果選擇不發布設定檔，於安裝步驟結束後即可將自己創建的 `Line bot` 加入 Line 好友開始使用。
> ( *使用過程中也可發布設定檔進行自定義修改* )

### 自定義設定檔後開始使用

[](#自定義設定檔後開始使用)

> 發布設定檔案後，至 `config/LineBotServiceConfig.php` 進行自定義調整，完成後即可將自己創建的 `Message Api Line bot` 加入好友開始使用。

自定義各聊天室裡(*User(個人)*、*Group(群組)*、*Room(群聊)*) messageType是否開啟服務。

*`true`為開啟 `false`為關閉功能*

> 注意：
>
> - 目前套件僅支援 `TEXT`文字訊息自動回應功能。其餘功能設為`true`不會有任何作用
> - 關閉`TEXT` 文字訊息服務，等同於不會開啟`QuickReplyButton`功能按鈕

```
 'MessageTypeSupportChat' =>
        [
            'UserChats' =>
                [
                    MessageType::TEXT => true,
                    MessageType::TEMPLATE => false,
                    MessageType::IMAGEMAP => false,
                    MessageType::STICKER => false,
                    MessageType::LOCATION => false,
                    MessageType::IMAGE => false,
                    MessageType::AUDIO => false,
                    MessageType::VIDEO => false,
                    MessageType::FLEX => false,
                ],
            'GroupChats' =>
                [
                    ....
                ],
            'RoomChats' =>
                [
                    ....
                ]
        ]
```

自定義各聊天室裡，訊息自動回應內容

- `'QuickReplyButtonName'` : 開啟`QuickReplyButton` 按鈕關鍵字，可自定義。
- `'Available'` : 各房間類型啟用或關閉`QuickReplyButton`按鈕功能，`false`關閉狀態下，Line 輸入 `QuickReplyButtonName`關鍵字，將不會有任何反應 。
- `'ResponseContent'` : 自定義各房間類型的文字回復。

```
    'TextResponse' =>
        [
            'QuickReplyButtonName' => '開啟服務',
            'Available' =>
                [
                    'UserChats' => true,
                    'GroupChats' => true,
                    'RoomChats' => true,
                ],
            'ResponseContent' =>
                [
                    'UserChats' =>
                        [
                            'hello' => 'hi',
                            '吃飽沒' => '吃了一公斤的鐵了!'
                        ],
                    'GroupChats' =>
                        [
                            'hello' => '你好阿',
                            '吃飽沒' => '我吃了10%的用電量了'
                        ],
                    'RoomChats' =>
                        [
                            'hello' => 'YO',
                            '吃飽沒' => '我是機器人不會餓!'
                        ],
                ]
        ],
```

選擇各聊天室開放的按鈕功能

> 目前支援的功能按鈕清單：
>
> - `最新威力彩`
> - `最新大樂透`
> - `最新539`
> - `最新三種遊戲`
> - `近3期三種遊戲`
> - `近5期威力彩`
> - `近5期大樂透`
> - `近5期539`
> - `近10期三種遊戲`
> - `指定威力彩日期`
> - `指定大樂透日期`
> - `指定539日期`

*啟用功能設為 `true` ，關閉設為為 `false`*

```
    'QuickReply' =>
        [
            'UserChats' =>
                [
                    '最新威力彩' => true,//true or false
                    '最新大樂透' => true,
                    '最新539' => true,
                    '最新三種遊戲' => true,
                    '近3期三種遊戲' => true,
                    '近5期威力彩' => true,
                    '近5期大樂透' => true,
                    '近5期539' => true,
                    '近10期三種遊戲(純球號)' => true,
                    '指定威力彩日期' => true,
                    '指定大樂透日期' => true,
                    '指定539日期' => true,
                ],
            'GroupChats' =>
                [
                     ......
                ],
            'RoomChats' =>
                [
                     ......
                ]
        ]
```

Demo
----

[](#demo)

歡迎訊息、文字回應、QuickReply按鈕功能開啟

    QuickReply.mp4    一般請求資訊服務按鈕

    default.mp4    指定日期請求服務按鈕

    default.mp4

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1621d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8fbb8f1a1641db6e99b87e45ba23c2b6e1ff9318b4de6cf37ec78c66377c8af?d=identicon)[Moferor](/maintainers/Moferor)

---

Top Contributors

[![Moferor](https://avatars.githubusercontent.com/u/16284391?v=4)](https://github.com/Moferor "Moferor (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jose13-larave-linebot-lottery/health.svg)

```
[![Health](https://phpackages.com/badges/jose13-larave-linebot-lottery/health.svg)](https://phpackages.com/packages/jose13-larave-linebot-lottery)
```

###  Alternatives

[cretueusebiu/laravel-vue-spa

A Laravel-Vue SPA starter project template.

3.0k18.8k](/packages/cretueusebiu-laravel-vue-spa)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[visuellverstehen/statamic-classify

A useful helper to add CSS classes to all HTML tags generated by the bard editor.

20116.8k](/packages/visuellverstehen-statamic-classify)[sproutcms/cms

Enterprise content management and framework

241.6k4](/packages/sproutcms-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
