Log for
OwO
Android Telegram 支援 *Markdown* 了欸
包在 if 裡面啊,用 callAPI 的方式呼叫 sendSticker
可是他的框架一整個和bot黏在一起,要獨立使用很有障礙吧
如果是koru的框架
在tg.js裡寫sendSticker
TGBOT.prototype.sendSticker = function(chat_id,sticker,datas,cb){
datas = typeof datas === "object" ? datas : {};
datas.chat_id = chat_id;
datas.sticker = sticker;
return this._invoke('sendSticker',datas,cb);
};
這樣(
我的計畫:
偵測使用者傳送了某個貼圖
bot輸出文字和一張貼圖
bot.on('sticker' , message => bot.sendSticker(chatId, sticker));
if(message.sticker){
if(message.sticker.file_id = XXX){
bot.sendSticker(chatID, sticker);
};
};
感覺好像有點長(?
Wood Man:
if(message.sticker){
if(message.sticker.file_id = XXX){
bot.sendSticker(chatID, sticker);
bot.sendMessage(chatID,'message');
};
};
欸等等,那bot要輸出的sticker id要放在哪?
bot.sendSticker(chatID,這裡);
是說,那個的話是使用者傳貼圖才會觸發w(應該
OwO
QwQ
TwT
AwA
@w@
☆w☆
OUO
QUQ
TUT
AUA
應該可以用隨機數(?
還是有其他方式
我沒用過wwww
[Welcome to Python.org]
https://www.python.org/
The official home of the Python Programming Language.
[Download Python | Python.org]
https://www.python.org/downloads/
Wondering which version to use? Here's more about the difference between Python 2 and 3. Looking for Python with a different OS? Python for Windows ...
[Python - 維基百科,自由的百科全書 - Wikipedia]
https://zh.wikipedia.org/zh-tw/Python
Python(英國發音:/ˈpaɪθən/ 美國發音:/ˈpaɪθɑːn/),是一種物件導向、直譯式的電腦程式語言。它包含了一組功能完備的標準庫,能夠輕鬆完成很多常見的任務。
我有時候會先在這邊問才Google,如果我沒查到才會繼續問下去
反正隨機發貼圖很簡單啦,把一些貼圖弄成陣列,然後用js的隨機函數去抓出陣列中的其中一個後發送就好了
因為這邊問問題的方式是混在一起 我才會認為你不會拆。
Google 會幫你判斷,不然像是 How to convert pdf to odf 是怎麼查到結果的?
問題是你不知道關鍵字是哪些字,你關鍵字沒出現怎可能有答案
我有時候會先在這邊問才Google,如果我沒查到才會繼續問下去
我知道他Google過了 所以我認為他可能是Google的方式錯了
我記得之前有人說過你問問題時附上你已經嘗試了哪些事
怎麼查的怎樣都好吧,幫助他解決問題才是重點阿...
1. Google
2. W3School
3. Sololearn
你不覺得反覆幫一個人解決一些瑣碎問題麻煩的話,請便
當做妳時間比每個人珍貴喔?
@hugwalk 你覺得自已對這社群除了廢話還貢獻了什麼嗎
那幹嘛不直接寫就好
要用(function () {} )(); 包起來
wo shi jue de mon guo shi none bo one. ha me gua na,,, yo shie ren shi huan, yo shie ren boo shi huan, yin wei ha me gua yo yee zhong ha wei.
Hello mingtsay@tg,
I am ysitdbot@tg.
You could use /help to get all commands and usage of this bot.
bot.on('message', function(message){
if(message.sticker){
if(message.sticker.file_id == "BQADBAADJAEAAjYNIAZ5NKdG_pdZgQI"){
bot.sendSticker(
message.chat.id, "BQADBQADaAEAArqdrgMLgu1JTrS4ogI");
bot.sendMessage(
message.chat.id,'有隻頑皮的小貓吃了你的ㄐㄐ!幹林老師!');
};
};
});
node js random
node js delay
sendSticker和sendMessage改成promise
然後用await, async
等一下 Node.js 裡面的 delay 應該不是 setTimeout 吧ww
setTimeout(callback, delay, [arg], [...])
callback 是回傳,意思是要呼叫誰
在 setTimeout 裡面就是時間到了要呼叫誰,
你把任何一個函式傳入,時間到了就會呼叫那個函式
yield 到底怎麼用
沒有generator的可以用他嗎
setTimeout(callback, delay, [arg], [...])
setTimeout(回傳, 延遲時間, [參數], [...])
但是 callback 的時候也會回傳一些東西嘛 ..
var t=setTimeout("alert('5 seconds!')",5000)
這樣不能動啦
我看到的原因是沒力氣看其他東西,比較能專心
但你還在 Telegram ._.
他直接var delay=1000; //1 second
setTimeout(function() {
//your code to be executed after 1 second
}, delay);
我根本不知道應該要放在哪R
你有看到那個註解嗎
你有看到那個註解嗎
你有看到那個註解嗎
/maketextHugwalk:
他直接
var delay=1000; //1 second
setTimeout(function() {
//your code to be executed after 1 second
}, delay);
我根本不知道應該要放在哪R
/maketext -d
Hugwalk:
他直接
var delay=1000; //1 second
setTimeout(function() {
//your code to be executed after 1 second
}, delay);
我根本不知道應該要放在哪R
/maketextHugwalk:
他直接
var delay = 1000; //1 second
setTimeout(function() {
// your code to be
// executed after 1 second
}, delay);
我根本不知道應該要放在哪R
都說了嘛,我們權重比 Google search & Google translator 高上許多
//your code to be executed after 1 second
bot.on('message', function(message){
if(message.sticker){
if(message.sticker.file_id == "BQADBAADJAEAAjYNIAZ5NKdG_pdZgQI"){
bot.sendSticker(
message.chat.id, "BQADBQADaAEAArqdrgMLgu1JTrS4ogI");
bot.sendMessage(
message.chat.id,'有隻頑皮的小貓吃了你的ㄐㄐ!幹林老師!');
};
};
});
你剛剛要的是delay傳送訊息
所以把傳送訊息的部分塞進去
這樣(?
明明有了promise可以減少層次,你為啥要把它變callback hell
單純那個module用promise,然後就...
bot.sendSticker(
message.chat.id, "BQADBQADaAEAArqdrgMLgu1JTrS4ogI");
^
TypeError: Cannot read property 'chat' of undefined
var delay=5000;
bot.on('message', function(message){
if(message.sticker){
if(message.sticker.file_id == "BQADBAADJAEAAjYNIAZ5NKdG_pdZgQI"){
setTimeout(function(message){
bot.sendSticker(
message.chat.id, "BQADBQADaAEAArqdrgMLgu1JTrS4ogI");
bot.sendMessage(
message.chat.id,'有隻頑皮的小貓吃了你的ㄐㄐ!幹林老師!');
}, delay);
};
};
});
可不可以請推薦一台可以跑C9而且600p以下的Windows 平板
只要你沒有開flash 然後browser有定期更新 就好
我的小米手機有一個叫做Analytics的系統程序一個月吃了我幾百MB
Intel® Core 2 或 AMD Athlon® 64 處理器;2 GHz 或更快的處理器
從我進去Orz到現在
Orz都沒設 username
我覺得 Telegram 只會判斷 Supergroup
如果我是設計者,可能是因為單純不想讓他再騷擾人,所以只能在小群組說話
如果我是設計者,我會讓使用者可以選擇不要接受某人的訊息。
去租 Ubuntu VPS 學 Shell 啦 (推
[mmis1000 (mmis1000) · GitHub]
https://github.com/mmis1000
mmis1000 has 59 repositories available. Follow their code on GitHub.
[GitHub - mmis1000/node-comet: a simple comet server to do long ...]
https://github.com/mmis1000/node-comet
a simple comet server to do long polling. Contribute to node-comet development by creating an account on GitHub.
[GitHub - mmis1000/irc-web-log: material design styled web log]
https://github.com/mmis1000/irc-web-log
material design styled web log. Contribute to irc-web-log development by creating an account on GitHub.
DO 的話可以用 PayPal 付,就不用綁定帳號
@Senoc 先去申請 GitHub edu pack 吧,這需要等審核
然後再給我帳號、promo code,我用我的 PayPal 付第一筆試試看
我記得 GitHub free credit 有 50USD,只要 PayPal 付 5USD 就能啟用帳號
I'm going to do some projects that need a server to work(X
To contribute in Open Source and help with my learning in coding
這是跟我討付款用的證據嗎 ._.
不是啊
只是可以找你付錢而已