├── Config
├── BotConfig.php
└── Config.php
├── Controller
├── Callback.class.php
├── Index.class.php
├── Login.class.php
├── PluginCreate.class.php
├── PluginMain.class.php
├── Plugins.class.php
├── Settings.class.php
└── Status.class.php
├── LICENSE
├── Model
├── Base.class.php
├── ErrorModel.class.php
├── OptionModel.class.php
├── PluginModel.class.php
├── SystemModel.class.php
└── TelegramModel.class.php
├── Plugins
├── Backup
│ └── Backup.class.php
├── Bing
│ └── Bing.class.php
├── Chevereto
│ └── Chevereto.class.php
├── GetFile
│ └── GetFile.class.php
├── Hitokoto
│ ├── Hitokoto.class.php
│ └── hitokoto.json
├── Notice
│ └── Notice.class.php
├── Ping
│ └── Ping.class.php
├── Plus1s
│ ├── Plus1s.class.php
│ └── s.txt
└── Whoami
│ └── Whoami.class.php
├── README.md
├── System
├── Core.php
├── FLBase.class.php
├── FLController.class.php
├── FLModel.class.php
├── FLView.class.php
├── Init.php
└── Medoo.class.php
├── Templates
├── Footer.php
├── Header1.php
├── Header2.php
├── Index.php
├── Login.php
├── PluginCreate.php
├── PluginMain.php
├── Plugins.php
├── Settings.php
├── Sidebar.php
├── Status.php
└── assets
│ ├── ace
│ ├── ace.js
│ ├── ext-beautify.js
│ ├── ext-chromevox.js
│ ├── ext-elastic_tabstops_lite.js
│ ├── ext-emmet.js
│ ├── ext-error_marker.js
│ ├── ext-keybinding_menu.js
│ ├── ext-language_tools.js
│ ├── ext-linking.js
│ ├── ext-modelist.js
│ ├── ext-old_ie.js
│ ├── ext-searchbox.js
│ ├── ext-settings_menu.js
│ ├── ext-spellcheck.js
│ ├── ext-split.js
│ ├── ext-static_highlight.js
│ ├── ext-statusbar.js
│ ├── ext-textarea.js
│ ├── ext-themelist.js
│ ├── ext-whitespace.js
│ ├── keybinding-emacs.js
│ ├── keybinding-vim.js
│ ├── mode-abap.js
│ ├── mode-abc.js
│ ├── mode-actionscript.js
│ ├── mode-ada.js
│ ├── mode-apache_conf.js
│ ├── mode-applescript.js
│ ├── mode-asciidoc.js
│ ├── mode-assembly_x86.js
│ ├── mode-autohotkey.js
│ ├── mode-batchfile.js
│ ├── mode-bro.js
│ ├── mode-c9search.js
│ ├── mode-c_cpp.js
│ ├── mode-cirru.js
│ ├── mode-clojure.js
│ ├── mode-cobol.js
│ ├── mode-coffee.js
│ ├── mode-coldfusion.js
│ ├── mode-csharp.js
│ ├── mode-css.js
│ ├── mode-curly.js
│ ├── mode-d.js
│ ├── mode-dart.js
│ ├── mode-diff.js
│ ├── mode-django.js
│ ├── mode-dockerfile.js
│ ├── mode-dot.js
│ ├── mode-drools.js
│ ├── mode-eiffel.js
│ ├── mode-ejs.js
│ ├── mode-elixir.js
│ ├── mode-elm.js
│ ├── mode-erlang.js
│ ├── mode-forth.js
│ ├── mode-fortran.js
│ ├── mode-ftl.js
│ ├── mode-gcode.js
│ ├── mode-gherkin.js
│ ├── mode-gitignore.js
│ ├── mode-glsl.js
│ ├── mode-gobstones.js
│ ├── mode-golang.js
│ ├── mode-groovy.js
│ ├── mode-haml.js
│ ├── mode-handlebars.js
│ ├── mode-haskell.js
│ ├── mode-haskell_cabal.js
│ ├── mode-haxe.js
│ ├── mode-hjson.js
│ ├── mode-html.js
│ ├── mode-html_elixir.js
│ ├── mode-html_ruby.js
│ ├── mode-ini.js
│ ├── mode-io.js
│ ├── mode-jack.js
│ ├── mode-jade.js
│ ├── mode-java.js
│ ├── mode-javascript.js
│ ├── mode-json.js
│ ├── mode-jsoniq.js
│ ├── mode-jsp.js
│ ├── mode-jsx.js
│ ├── mode-julia.js
│ ├── mode-kotlin.js
│ ├── mode-latex.js
│ ├── mode-lean.js
│ ├── mode-less.js
│ ├── mode-liquid.js
│ ├── mode-lisp.js
│ ├── mode-live_script.js
│ ├── mode-livescript.js
│ ├── mode-logiql.js
│ ├── mode-lsl.js
│ ├── mode-lua.js
│ ├── mode-luapage.js
│ ├── mode-lucene.js
│ ├── mode-makefile.js
│ ├── mode-markdown.js
│ ├── mode-mask.js
│ ├── mode-matlab.js
│ ├── mode-maze.js
│ ├── mode-mel.js
│ ├── mode-mips_assembler.js
│ ├── mode-mipsassembler.js
│ ├── mode-mushcode.js
│ ├── mode-mysql.js
│ ├── mode-nix.js
│ ├── mode-nsis.js
│ ├── mode-objectivec.js
│ ├── mode-ocaml.js
│ ├── mode-pascal.js
│ ├── mode-perl.js
│ ├── mode-pgsql.js
│ ├── mode-php.js
│ ├── mode-plain_text.js
│ ├── mode-powershell.js
│ ├── mode-praat.js
│ ├── mode-prolog.js
│ ├── mode-properties.js
│ ├── mode-protobuf.js
│ ├── mode-python.js
│ ├── mode-r.js
│ ├── mode-razor.js
│ ├── mode-rdoc.js
│ ├── mode-rhtml.js
│ ├── mode-rst.js
│ ├── mode-ruby.js
│ ├── mode-rust.js
│ ├── mode-sass.js
│ ├── mode-scad.js
│ ├── mode-scala.js
│ ├── mode-scheme.js
│ ├── mode-scss.js
│ ├── mode-sh.js
│ ├── mode-sjs.js
│ ├── mode-smarty.js
│ ├── mode-snippets.js
│ ├── mode-soy_template.js
│ ├── mode-space.js
│ ├── mode-sql.js
│ ├── mode-sqlserver.js
│ ├── mode-stylus.js
│ ├── mode-svg.js
│ ├── mode-swift.js
│ ├── mode-swig.js
│ ├── mode-tcl.js
│ ├── mode-tex.js
│ ├── mode-text.js
│ ├── mode-textile.js
│ ├── mode-toml.js
│ ├── mode-tsx.js
│ ├── mode-twig.js
│ ├── mode-typescript.js
│ ├── mode-vala.js
│ ├── mode-vbscript.js
│ ├── mode-velocity.js
│ ├── mode-verilog.js
│ ├── mode-vhdl.js
│ ├── mode-wollok.js
│ ├── mode-xml.js
│ ├── mode-xquery.js
│ ├── mode-yaml.js
│ ├── snippets
│ │ ├── abap.js
│ │ ├── abc.js
│ │ ├── actionscript.js
│ │ ├── ada.js
│ │ ├── apache_conf.js
│ │ ├── applescript.js
│ │ ├── asciidoc.js
│ │ ├── assembly_x86.js
│ │ ├── autohotkey.js
│ │ ├── batchfile.js
│ │ ├── bro.js
│ │ ├── c9search.js
│ │ ├── c_cpp.js
│ │ ├── cirru.js
│ │ ├── clojure.js
│ │ ├── cobol.js
│ │ ├── coffee.js
│ │ ├── coldfusion.js
│ │ ├── csharp.js
│ │ ├── css.js
│ │ ├── curly.js
│ │ ├── d.js
│ │ ├── dart.js
│ │ ├── diff.js
│ │ ├── django.js
│ │ ├── dockerfile.js
│ │ ├── dot.js
│ │ ├── drools.js
│ │ ├── eiffel.js
│ │ ├── ejs.js
│ │ ├── elixir.js
│ │ ├── elm.js
│ │ ├── erlang.js
│ │ ├── forth.js
│ │ ├── fortran.js
│ │ ├── ftl.js
│ │ ├── gcode.js
│ │ ├── gherkin.js
│ │ ├── gitignore.js
│ │ ├── glsl.js
│ │ ├── gobstones.js
│ │ ├── golang.js
│ │ ├── groovy.js
│ │ ├── haml.js
│ │ ├── handlebars.js
│ │ ├── haskell.js
│ │ ├── haskell_cabal.js
│ │ ├── haxe.js
│ │ ├── hjson.js
│ │ ├── html.js
│ │ ├── html_elixir.js
│ │ ├── html_ruby.js
│ │ ├── ini.js
│ │ ├── io.js
│ │ ├── jack.js
│ │ ├── jade.js
│ │ ├── java.js
│ │ ├── javascript.js
│ │ ├── json.js
│ │ ├── jsoniq.js
│ │ ├── jsp.js
│ │ ├── jsx.js
│ │ ├── julia.js
│ │ ├── kotlin.js
│ │ ├── latex.js
│ │ ├── lean.js
│ │ ├── less.js
│ │ ├── liquid.js
│ │ ├── lisp.js
│ │ ├── live_script.js
│ │ ├── livescript.js
│ │ ├── logiql.js
│ │ ├── lsl.js
│ │ ├── lua.js
│ │ ├── luapage.js
│ │ ├── lucene.js
│ │ ├── makefile.js
│ │ ├── markdown.js
│ │ ├── mask.js
│ │ ├── matlab.js
│ │ ├── maze.js
│ │ ├── mel.js
│ │ ├── mips_assembler.js
│ │ ├── mipsassembler.js
│ │ ├── mushcode.js
│ │ ├── mysql.js
│ │ ├── nix.js
│ │ ├── nsis.js
│ │ ├── objectivec.js
│ │ ├── ocaml.js
│ │ ├── pascal.js
│ │ ├── perl.js
│ │ ├── pgsql.js
│ │ ├── php.js
│ │ ├── plain_text.js
│ │ ├── powershell.js
│ │ ├── praat.js
│ │ ├── prolog.js
│ │ ├── properties.js
│ │ ├── protobuf.js
│ │ ├── python.js
│ │ ├── r.js
│ │ ├── razor.js
│ │ ├── rdoc.js
│ │ ├── rhtml.js
│ │ ├── rst.js
│ │ ├── ruby.js
│ │ ├── rust.js
│ │ ├── sass.js
│ │ ├── scad.js
│ │ ├── scala.js
│ │ ├── scheme.js
│ │ ├── scss.js
│ │ ├── sh.js
│ │ ├── sjs.js
│ │ ├── smarty.js
│ │ ├── snippets.js
│ │ ├── soy_template.js
│ │ ├── space.js
│ │ ├── sql.js
│ │ ├── sqlserver.js
│ │ ├── stylus.js
│ │ ├── svg.js
│ │ ├── swift.js
│ │ ├── swig.js
│ │ ├── tcl.js
│ │ ├── tex.js
│ │ ├── text.js
│ │ ├── textile.js
│ │ ├── toml.js
│ │ ├── tsx.js
│ │ ├── twig.js
│ │ ├── typescript.js
│ │ ├── vala.js
│ │ ├── vbscript.js
│ │ ├── velocity.js
│ │ ├── verilog.js
│ │ ├── vhdl.js
│ │ ├── wollok.js
│ │ ├── xml.js
│ │ ├── xquery.js
│ │ └── yaml.js
│ ├── theme-ambiance.js
│ ├── theme-chaos.js
│ ├── theme-chrome.js
│ ├── theme-clouds.js
│ ├── theme-clouds_midnight.js
│ ├── theme-cobalt.js
│ ├── theme-crimson_editor.js
│ ├── theme-dawn.js
│ ├── theme-dreamweaver.js
│ ├── theme-eclipse.js
│ ├── theme-github.js
│ ├── theme-idle_fingers.js
│ ├── theme-iplastic.js
│ ├── theme-katzenmilch.js
│ ├── theme-kr_theme.js
│ ├── theme-kuroir.js
│ ├── theme-merbivore.js
│ ├── theme-merbivore_soft.js
│ ├── theme-mono_industrial.js
│ ├── theme-monokai.js
│ ├── theme-pastel_on_dark.js
│ ├── theme-solarized_dark.js
│ ├── theme-solarized_light.js
│ ├── theme-sqlserver.js
│ ├── theme-terminal.js
│ ├── theme-textmate.js
│ ├── theme-tomorrow.js
│ ├── theme-tomorrow_night.js
│ ├── theme-tomorrow_night_blue.js
│ ├── theme-tomorrow_night_bright.js
│ ├── theme-tomorrow_night_eighties.js
│ ├── theme-twilight.js
│ ├── theme-vibrant_ink.js
│ ├── theme-xcode.js
│ ├── worker-coffee.js
│ ├── worker-css.js
│ ├── worker-html.js
│ ├── worker-javascript.js
│ ├── worker-json.js
│ ├── worker-lua.js
│ ├── worker-php.js
│ ├── worker-xml.js
│ └── worker-xquery.js
│ ├── css
│ └── bootstrap.min.css
│ ├── js
│ ├── Chart.min.js
│ ├── bootstrap.min.js
│ ├── jquery-3.1.1.min.js
│ ├── jquery.pjax.js
│ ├── js-cookie.js
│ └── tether.min.js
│ └── style.css
├── index.php
└── table.sql
/Config/BotConfig.php:
--------------------------------------------------------------------------------
1 | view->render ();
5 | }
6 | function init () {
7 | session_start ();
8 | if ($_SESSION['logined'] != true) {
9 | header ('Location: ' . APP_URL . '/index.php/login');
10 | exit ();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Controller/PluginCreate.class.php:
--------------------------------------------------------------------------------
1 | view->render ();
5 | }
6 | function init () {
7 | session_start ();
8 | if ($_SESSION['logined'] != true) {
9 | header ('Location: ' . APP_URL . '/index.php/login');
10 | exit ();
11 | }
12 | }
13 | function ajaxCreate () {
14 | /** 检查 */
15 | if (empty ($_POST['pcn']) || empty ($_POST['code'])) {
16 | exit (json_encode (array ('code' => -9999, 'msg' => '参数为空')));
17 | }
18 |
19 | /** 写入 */
20 | mkdir (APP_PATH . '/Plugins/' . $_POST['pcn']);
21 | file_put_contents (APP_PATH . '/Plugins/' . $_POST['pcn'] . '/' . $_POST['pcn'] . '.class.php', $_POST['code']);
22 |
23 | /** 返回 */
24 | exit (json_encode (array ('code' => 0)));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Controller/PluginMain.class.php:
--------------------------------------------------------------------------------
1 | view->render ();
15 | }
16 | function ajaxSave () {
17 | /** 检查 */
18 | if (empty ($_POST['pcn'])) {
19 | exit (json_encode (array ('code' => -9999, 'msg' => '参数为空')));
20 | }
21 |
22 | /** 写入 */
23 | file_put_contents (APP_PATH . '/Plugins/' . $_POST['pcn'] . '/' . $_POST['pcn'] . '.class.php', $_POST['code']);
24 |
25 | /** 返回 */
26 | exit (json_encode (array ('code' => 0)));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Controller/Status.class.php:
--------------------------------------------------------------------------------
1 | view->render ();
5 | }
6 | function init () {
7 | session_start ();
8 | if ($_SESSION['logined'] != true) {
9 | header ('Location: ' . APP_URL . '/index.php/login');
10 | exit ();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Model/Base.class.php:
--------------------------------------------------------------------------------
1 | telegram = new TelegramModel;
8 | $this->option = new OptionModel;
9 | parent::__construct ();
10 | }
11 | public function fetch ($url, $postdata = null, $cookie = null, $header = array (), $convert = false) {
12 | // 访问
13 | $ch = curl_init ();
14 | curl_setopt ($ch, CURLOPT_URL, $url);
15 | if (!is_null ($postdata)) {
16 | curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query ($postdata));
17 | }
18 | if (!is_null ($cookie)) {
19 | curl_setopt ($ch, CURLOPT_COOKIE, $cookie);
20 | }
21 | if (!empty ($header)) {
22 | curl_setopt ($ch, CURLOPT_HTTPHEADER, $header);
23 | }
24 | curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
25 | curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
26 | curl_setopt ($ch, CURLOPT_HEADER, false);
27 | curl_setopt ($ch, CURLOPT_TIMEOUT, 20);
28 | $re = curl_exec ($ch);
29 | curl_close ($ch);
30 | if ($convert == true) {
31 | $re = mb_convert_encoding ($re, 'UTF-8', 'GBK');
32 | }
33 |
34 | return $re;
35 | }
36 | public function debug ($expression) {
37 | $text = print_r ($expression, true);
38 | $this->telegram->sendMessage (MASTER, $text, NULL, [], '');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Model/OptionModel.class.php:
--------------------------------------------------------------------------------
1 | db->insert ('options', [
6 | 'name' => $name,
7 | 'value' => $value
8 | ]);
9 | }
10 |
11 | function update ($name, $newvalue)
12 | {
13 | $this->db->update ('options', [
14 | 'value' => $newvalue
15 | ], [
16 | 'name' => $name
17 | ]);
18 | }
19 |
20 | function iou ($name, $value)
21 | {
22 | if ($this->has ($name)) {
23 | $this->update ($name, $value);
24 | } else {
25 | $this->add ($name, $value);
26 | }
27 | }
28 |
29 | function has ($name)
30 | {
31 | return $this->db->has ('options', [
32 | 'name' => $name
33 | ]);
34 | }
35 |
36 | function delete ($name)
37 | {
38 | $this->db->delete ('options', [
39 | 'name' => $name
40 | ]);
41 | }
42 |
43 | function getvalue ($name)
44 | {
45 | return $this->db->get ('options', 'value', [
46 | 'name' => $name
47 | ]);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Model/SystemModel.class.php:
--------------------------------------------------------------------------------
1 | getvalue ('password');
8 | } else {
9 | $optionModel->update ('password', md5 (md5 (md5 ($newpassword))));
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Plugins/GetFile/GetFile.class.php:
--------------------------------------------------------------------------------
1 | data = $data;
17 | parent::__construct ();
18 | }
19 |
20 | public function document($document, $caption, $message_id, $from, $chat, $date) {
21 | // ⚠️ 下载地址内包含 Bot Token,请勿公开
22 | if($this->telegram->getMaster() == '' || $chat['id'] != $this->telegram->getMaster()) return;
23 |
24 | $mime_type = $document['mime_type'];
25 | $file_name = $document['file_name'];
26 | $file_id = $document['file_id'];
27 | $file_unique_id = $document['file_unique_id'];
28 | $file_size = $document['file_size'];
29 | if($file_size >= (20*1024*1024)) {
30 | $this->telegram->sendMessage($chat['id'], "Maximum file size to download is 20 MB", $message_id);
31 | return;
32 | }
33 |
34 | if(strstr($mime_type, 'image')) { // image/png
35 | $ret = $this->telegram->getFile($file_id);
36 | if($ret['ok']) {
37 | $url = $ret['result']['down_url'];
38 |
39 | $this->telegram->sendMessage($chat['id'], "下载地址: " . $url, $message_id);
40 | }
41 | } else {
42 | $this->telegram->sendMessage($chat['id'], "这不是一个图像文件", $message_id);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Plugins/Hitokoto/Hitokoto.class.php:
--------------------------------------------------------------------------------
1 | data = $data;
16 | parent::__construct ();
17 | }
18 | public function command ($command, $param, $message_id, $from, $chat, $date) {
19 | if ($command == '/hitokoto') {
20 | $array = json_decode (file_get_contents (__DIR__ . '/hitokoto.json'), true);
21 | $hitokoto = $array[array_rand ($array)]['hitokoto'];
22 |
23 | $button = json_encode (array (
24 | 'inline_keyboard' => array (
25 | array (array (
26 | 'text' => '再来一条',
27 | 'callback_data' => 'hitokoto'
28 | ))
29 | )
30 | ));
31 | $this->telegram->sendMessage ($chat['id'], $hitokoto, $message_id, $button);
32 | }
33 | }
34 | public function message ($message, $message_id, $from, $chat, $date) {
35 | //throw new Exception('Uncaught Exception');
36 | }
37 | public function callback_query ($callback_data, $callback_id, $callback_from, $message_id, $from, $chat, $date) {
38 | if ($callback_data == 'hitokoto') {
39 | $array = json_decode (file_get_contents (__DIR__ . '/hitokoto.json'), true);
40 | $hitokoto = $array[array_rand ($array)]['hitokoto'];
41 |
42 | $button = json_encode (array (
43 | 'inline_keyboard' => array (
44 | array (array (
45 | 'text' => '再来一条',
46 | 'callback_data' => 'hitokoto'
47 | ))
48 | )
49 | ));
50 | // $this->telegram->editMessage ($chat['id'], $message_id, $hitokoto, $button);
51 | $this->telegram->editMessageText($chat['id'], $message_id, NULL, $hitokoto);
52 | $this->telegram->editMessageReplyMarkup($chat['id'], $message_id, NULL, $button);
53 | }
54 | }
55 | public function new_member ($new_member, $message_id, $from, $chat, $date) {
56 | //throw new Exception('Uncaught Exception');
57 | }
58 | public function left_member ($left_member, $message_id, $from, $chat, $date) {
59 | //throw new Exception('Uncaught Exception');
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Plugins/Notice/Notice.class.php:
--------------------------------------------------------------------------------
1 | ω<*ฅ)';
6 | $this->telegram->sendMessage ($chat['id'], $str, $message_id, array (), '');
7 | }
8 | public function left_member ($left_member, $message_id, $from, $chat, $date) {
9 | $str = '喵喵喵? @' . $left_member['username'] . ' 被 @' . $from['username'] . ' 移出了 ' . $chat['title'];
10 | $this->telegram->sendMessage ($chat['id'], $str, $message_id, array (), '');
11 | }
12 | }
--------------------------------------------------------------------------------
/Plugins/Ping/Ping.class.php:
--------------------------------------------------------------------------------
1 | telegram->sendMessage ($chat['id'], 'Pong!', $message_id);
7 | $t2 = microtime (true);
8 |
9 | $time = round (($t2 - $t1) * 1000, 2);
10 | $this->telegram->editMessage ($chat['id'], $pong_id, 'Pong!' . "\n" . 'Time:' . $time . ' ns
');
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Plugins/Plus1s/Plus1s.class.php:
--------------------------------------------------------------------------------
1 | option->getvalue('plus1s_min');
11 | if ($s === NULL)
12 | $this->option->add ('plus1s_min', 0);
13 | $s++;
14 | $this->option->update ('plus1s_min', $s);
15 |
16 | 详细定义:/Model/OptionModel.class.php
17 | */
18 |
19 | $text = gmstrftime ('🌚迄今为止,我已经多活了 %Hhours %Mminutes %Sseconds', $s);
20 | $button = json_encode (array (
21 | 'inline_keyboard' => array (
22 | array (array (
23 | 'text' => '我真的还想再活一秒',
24 | 'callback_data' => '+1s'
25 | ))
26 | )
27 | ));
28 | $this->telegram->sendMessage ($chat['id'], $text, $message_id, $button);
29 | }
30 | }
31 | public function callback_query ($callback_data, $callback_id, $callback_from, $message_id, $from, $chat, $date) {
32 | if ($callback_data == '+1s') {
33 | $s = file_get_contents (__DIR__ . '/s.txt');
34 | $s++;
35 | file_put_contents (__DIR__ . '/s.txt', $s);
36 |
37 | $button = json_encode (array (
38 | 'inline_keyboard' => array (
39 | array (array (
40 | 'text' => '再再活一秒',
41 | 'callback_data' => '+2s'
42 | ))
43 | )
44 | ));
45 | $this->telegram->editMessage ($chat['id'], $message_id, '🐸蛤丝,你觉得连续吼不吼啊?', $button);
46 | } else if ($callback_data == '+2s') {
47 | $this->telegram->editMessage ($chat['id'], $message_id, '暴力续命不可取🌝👎👎');
48 | }
49 | }
50 | public function inline_query ($query, $offset, $inline_id, $from) {
51 | if ($query == '+1s') {
52 | $tmp = [
53 | [
54 | 'type' => 'article',
55 | 'id' => $this->telegram->getInlineId(),
56 | 'title' => '一句诗',
57 | 'input_message_content' => [
58 | 'message_text' => '苟……'
59 | ]
60 | ]
61 | ];
62 | $this->telegram->sendInlineQuery($tmp);
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/Plugins/Plus1s/s.txt:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/Plugins/Whoami/Whoami.class.php:
--------------------------------------------------------------------------------
1 | telegram->sendMessage ($chat['id'], $str, $message_id);
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Tbo
2 |
3 | 这是一个更友好、更强大、更轻巧、更多 bug 的框架
4 |
5 | PS:[真正的粉丝群](https://telegram.me/TboJiangGroup)
6 |
7 | PSS:[开发文档](https://github.com/U2FsdGVkX1/Tbo/wiki)
8 |
9 | AD:[作者自己的 channel(与 Tbo 无关)](https://t.me/u2fplus1s)
10 |
11 | ---
12 |
13 | 为了保证 Tbo 正常运行,建议安装到符合以下条件的环境
14 |
15 | 1. 滋辞 [PDO](https://php.net/manual/zh/ref.pdo-mysql.php)
16 | 2. 滋辞 [pathinfo](https://github.com/U2FsdGVkX1/Tbo/wiki/%E5%BC%80%E5%90%AF-pathinfo-%E7%9A%84%E6%BB%8B%E8%BE%9E)
17 | 3. 滋辞 https(强烈建议使用 [Let's Encrypt](https://letsencrypt.org))
18 | 4. PHP >= 5.4
19 | 5. 确保服务器能够访问到 Telegram(所以就不要使用国内的服务器了)
20 | 6. Config 目录拥有写权限
21 |
22 | [安装过程](https://github.com/U2FsdGVkX1/Tbo/wiki/%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B)
23 |
24 | ---
25 |
26 | Tbo 使用了以下开源项目,感谢它们的贡献:
27 |
28 | [FrameLite](https://github.com/U2FsdGVkX1/FrameLite)
29 |
30 | [Bootstrap](https://github.com/twbs/bootstrap)
31 |
32 | [jQuery](https://github.com/jquery/jquery)
33 |
34 | [js.cookie](https://github.com/js-cookie/js-cookie)
35 |
36 | [Chart.js](https://github.com/chartjs/Chart.js)
37 |
38 | [Ace](https://github.com/ajaxorg/ace)
39 |
40 | [jquery-pjax](https://github.com/defunkt/jquery-pjax)
41 |
42 | ---
43 |
44 | 感谢他们建议反馈以及精神支持,使得 Tbo 更加强大(更多 bug)
45 |
46 | [Momiji.Jin](https://github.com/MoeLoli)
47 |
48 | [Guoguo](https://github.com/imguoguo)
49 |
50 | [myluoluo](https://github.com/myluoluo)
51 |
--------------------------------------------------------------------------------
/System/FLBase.class.php:
--------------------------------------------------------------------------------
1 | controller = $controller;
50 | $this->action = $action;
51 | $this->module = $module;
52 | $this->param = $param;
53 | $this->view = new FLView ($controller, $action, $module, $param);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/System/FLModel.class.php:
--------------------------------------------------------------------------------
1 | db = self::getDB ();
22 | }
23 | }
24 |
25 | /**
26 | * 返回数据库实例
27 | *
28 | * @return medoo
29 | */
30 | private function getDB () {
31 | if (!self::$_instance) {
32 | self::$_instance = new Medoo (array (
33 | 'database_type' => 'mysql',
34 | 'database_name' => DBNAME,
35 | 'server' => DBHOST,
36 | 'username' => DBUSER,
37 | 'password' => DBPASS,
38 | 'charset' => 'utf8',
39 | 'option' => array (
40 | PDO::ATTR_PERSISTENT => DBPERSISTENT
41 | )
42 | ));
43 | }
44 | return self::$_instance;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/System/FLView.class.php:
--------------------------------------------------------------------------------
1 | controller = $controller;
43 | $this->action = $action;
44 | $this->module = $module;
45 | $this->param = $param;
46 | }
47 |
48 | /**
49 | * 渲染视图
50 | *
51 | * @param string $view 渲染的视图名
52 | * @param string $data 传递给视图的数据
53 | * @return void
54 | */
55 | public function render ($view = NULL, $data = array (), $noModule = false) {
56 | if ($view === NULL)
57 | $view = $this->controller;
58 | foreach ($data as $dataKey => $dataValue)
59 | $$dataKey = $dataValue;
60 | if ($this->module == '' || $noModule == true)
61 | require_once VIEW_PATH . '/' . $view . '.php';
62 | else
63 | require_once VIEW_PATH . '/' . $this->module . '/' . $view . '.php';
64 | }
65 |
66 | /**
67 | * 加载资源
68 | *
69 | * @param string $name 文件名
70 | * @return string 资源地址
71 | */
72 | public function loadSource ($name) {
73 | return VIEW_URL . '/' . $name;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/System/Init.php:
--------------------------------------------------------------------------------
1 | run (3);
28 |
--------------------------------------------------------------------------------
/Templates/Footer.php:
--------------------------------------------------------------------------------
1 |