Bottender offers a bunch of helpers to route within your Telegram or multi-platform app. For example, you may use Telegram particular routes within your
router
:
const
{ router, telegram } =
require
(
'bottender/router'
);
function
App
( )
{
return
router([ telegram.message(HandleMessage), telegram.editedMessage(HandleEditedMessage), telegram.channelPost(HandleChannelPost), telegram.editedChannelPost(HandleEditedChannelPost), telegram.inlineQuery(HandleInlineQuery), telegram.chosenInlineResult(HandleChosenInlineResult), telegram.callbackQuery(HandleCallbackQuery), telegram.shippingQuery(HandleShippingQuery), telegram.preCheckoutQuery(HandlePreCheckoutQuery), telegram.poll(HandlePoll), telegram.any(HandleTelegram), ]); }
async
function
HandleMessage
(
context
)
{}
async
function
HandleEditedMessage
(
context
)
{}
async
function
HandleChannelPost
(
context
)
{}
async
function
HandleEditedChannelPost
(
context
)
{}
async
function
HandleInlineQuery
(
context
)
{}
async
function
HandleChosenInlineResult
(
context
)
{}
async
function
HandleCallbackQuery
(
context
)
{}
async
function
HandleShippingQuery
(
context
)
{}
async
function
HandlePreCheckoutQuery
(
context
)
{}
async
function
HandlePoll
(
context
)
{}
async
function
HandleTelegram
(
context
)
{}
All available routes in
telegram
that recognize different kind of events:
-
telegram.any
– triggers the action when receiving any Telegram events. -
telegram.message
– triggers the action when receiving Telegram
message
events. -
telegram.editedMessage
– triggers the action when receiving Telegram
editedMessage
events. -
telegram.channelPost
– triggers the action when receiving Telegram
channelPost
events. -
telegram.editedChannelPost
– triggers the action when receiving Telegram
editedChannelPost
events. -
telegram.inlineQuery
– triggers the action when receiving Telegram
inlineQuery
events. -
telegram.chosenInlineResult
– triggers the action when receiving Telegram
chosenInlineResult
events. -
telegram.callbackQuery
– triggers the action when receiving Telegram
callbackQuery
events. -
telegram.shippingQuery
– triggers the action when receiving Telegram
shippingQuery
events. -
telegram.preCheckoutQuery
– triggers the action when receiving Telegram
preCheckoutQuery
events. -
telegram.poll
– triggers the action when receiving Telegram
poll
events.
telegram路由
心血来潮想在路由器上直接设置SS,于是给K2刷了潘多拉固件,也配好了SSR,路由器性能不可,只能用rc4-md5,load稳定在0.3,还算可以。
gfwlist模式工作还算稳定,只是这种模式下不能直接设置IP黑名单(要么我不知道怎样操作),以是Telegram就连不上了。
搜索了一番,大家好像都是直接在路由器上敲ipset下令来解决的:
ipset add gfwlist 91.108.56.0/22 ipset add gfwlist 91.108.4.0/22 ipset add gfwlist 109.239.140.0/24 ipset add gfwlist 149.154.160.0/20
试了一下,报错。
ipset list看了一下,没著名叫gfwlist的set,但有个china-banned,加到它内里试试:
ipset add china-banned 149.154.164.0/22 ipset add china-banned 149.154.168.0/21 ipset add china-banned 67.198.55.0/24 ipset add china-banned 91.108.4.0/22 ipset add china-banned 91.108.56.0/22 ipset add china-banned 109.239.140.0/24
(注:IP段已更新)
有效!
不外别兴奋地太早,路由器一重启就又不可了。于是把这段加在启动脚本中,重启测试,无效。
大抵翻看了一下
/etc/init.d/ssr-redir.sh
,没太看懂
china-banned
这个ipset是谁创建的,烦不了,直接在
start()
函数的末端,添加上面那段脚本,保存退出,重启路由,搞掂!
Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up
You can’t perform that action at this time.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
本文网址:
http://www.1cm8858.com/d/2020616112636_6735_3030652403/home
Ten articles before and after
如何让上传速度加快10倍解决电脑变慢的问题-电报telegram技巧分享
telegram群组资源狗狗币DOGE中国区总群-电报telegram技巧分享
telegram中文是什么意思-电报telegram技巧分享
telegram建群怎么创建群组-电报telegram技巧分享
telegramDesktop桌面版如何清理本地文件夹?设置缓存上限-电报telegram技巧分享
韩国n号房创始人身份被保护众多女艺人声明请愿公开-电报telegram技巧分享
工具教程第三十一讲:电报的使用(二)TelegramPC最新版支持移动端扫码登陆-电报telegram技巧分享
福建福州修车资源Channelstatistics北京.TelegramAnalytics-电报telegram技巧分享