![èŠåºãç»å](https://assets.st-note.com/production/uploads/images/122428488/rectangle_large_type_2_b6cea45743d25a23c221cd3ea2f53349.jpeg?width=1200)
ðLINE Botæ¹è¯ãšæžãããæžç±ã®æ§æ³ïŒãããã¯ãŒã¯ã®éå±€ã¢ãã«ã«ã€ããŠã®åŠç¿
2023幎11æ24æ¥ãåææ¥ã
ããã§ã¯ããããã®è¶£å³ãšåŠã³ã®èšé²ããéçºã»å·çäœæ¥ã®é²æã«ã€ããŠæžããŠããŸãã
ãã©ã€ããŒãã®ããšãå«ããŠäœã§ãæžãããéèšåž³ããšããŠå é±ãããã®ã·ãªãŒãºãã¯ãããŠã¿ãŸãããããŸããžã£ã³ã«ãããªã¥ãŒã ãªã©ã¯æ±ºããããŒã¡ãŒã¡ãšç¶ããŠã¿ãããšæããŸãã
ãããŸã§ã®èšé²ã¯ãã¬ãžã³ã«ãŸãšããŠããŸãã
LINE Botæ¹è¯ãšæžç±æžç±ã®æ§æ³
ä»äºã§éçšããŠããLINE Botãããã®ã§ãããå°ããããæ¹è¯ããããšæã£ãŠããŸããåæã«ãããã«é¢é£ããŠæžãããæè¡æžç±ã®æ§æ³ããããŸãã
LINE Botã®ããã°ã©ã æ¹è¯
éçšäžã®LINE Botã¯ã蟲家ã®å ±ååç©«äœæ¥ã§æ¥å ±ãå ¥åããæ©æ¢°ããšã®äœæ¥æéãšè³éã®éèšã«çšãããã®ã§ãã7人ã®ã¯ããŒãºãªã¡ã³ããŒã§äœ¿ã£ãŠãããäœæ¥æéã®å ¥åãšéèšãã©ã¯ã«ãªãããã«ã4幎ã»ã©åã«å¶äœããŸããã
ããããäŒèšæ åœè ïŒéèšãã人ïŒããã£ãšäœ¿ããããããã«æ¹è¯ããããªãšèããŠããŸãã
çŸç¶ãéèšçµæã¯LINEäžã«ã¡ãã»ãŒãžã§éãããã«ããŠããŸããå®éã«éèšããéã«ã¯ããã®ã¡ãã»ãŒãžãèŠãªããåã³èšç®ãçŽããŠExcelã®ãã©ãŒãããã«å ¥ããŠãããããªç¶æ³ãªã®ã§ããããªãã¯ãããããã©ãŒãããéãã«åºåãã¡ããã°è¯ããããããšïŒãªãä»ãŸã§æ°ã¥ããªãã£ããã§ããããïŒã
ãŸãã¯ãã£ããèŠä»¶å®çŸ©ããå§ããŸããä¹ ã ã«ãéäžããŠéçºããæéãåããããªãŒã£ãŠæããŸãã
æžç±å·çã«ã€ããŠ
ããã°ã©ã æ¹è¯ã®æ§æ³ãšåæã«ããã®ããŒã«ã«ã€ããŠæè¡å人èªã«ãŸãšããããªãšãã欲ãåºãŠããŠããŸãã
èªåã§èšãã®ããªãã§ããâŠèº«è¿ãªçŸå Žã®äººãã¡ããã®è©å€ããŸããŸãè¯ããã§ããLINEã®UI/UXãæ倧éã«çãããŠäœã£ãããŒã«ã«ãªã£ãŠããŠã䜿ãåŽã«ãšã£ãŠãéçºããŠããåŽã«ãšã£ãŠãã觊ã£ãŠããŠé¢çœãã§ãã
ãã®ããŒã«ã«ã€ããŠä»ãŸã§ããŸãå 容ãã¢ãŠããããã§ããŠããããäœãã£ã±ãªãã§ãã£ãããªããªããšã¯ãã£ãšæã£ãŠããŸãããæè¡çã«ã¯ããã°ã©ãã³ã°èšèªGoogle Apps ScriptãçšããŠãLINE Messaging APIã®ãããããªæ©èœãçµã¿åãããŠã察話åã§æ¥å ±ãå ¥åã§ããä»çµã¿ãäœã£ãŠããŸãã
ãªããã¡ãã¥ãŒ
ãã³ãã¬ãŒãã¡ãã»ãŒãž
ã¯ã€ãã¯ãªãã©ã€
ãããããªã¢ã¯ã·ã§ã³ïŒãã¹ãããã¯ãæ¥æéžæãªã©ïŒ
ãŠãŒã¶ãŒIDèªè
äžèšã§æããã©ã®æ©èœãã調ã¹ãã°ããã€ãæ
å ±ã¯ã§ãŠããŸãããåŠç¿è
ååŠè
ã«ã¯ããããŒãã«ãé«ãããã£ãšãŸãšãŸã£ãæ
å ±ããããšäŸ¿å©ãããªãããªïŒãšããæ°æã¡ããããŸãã
æžç±ã®æ³å®èªè
ã®ã¬ãã«æãšããŠã¯ãããã°ã©ãã³ã°ã®åºæ¬ãããçšåºŠåŠãã ååŠè
ã®æ¹ããGASã§ã¡ãã£ãšããLINE Botãäœã£ãããšãããæ¹ããæžç±ãéããŠæ¬¡ã®ã¹ããããžãšç§»ããããã«ãªããšããã®ãã€ã¡ãŒãžããŠããŸããAPIããã¥ã¡ã³ãã®èªã¿æ¹ã身ã«ã€ããŠãæ°ããäœéšãã§ããããã«ãªãããšããè£ããŒããšããŠçã蟌ã¿ãããªãšèããŠããŸãã
ä»å¹Žäžã«äŒç»æžã«èœãšã蟌ãããšãç®æšã«ããŠããŸãã®ã§ããŸãé²æãããã°ã話ããŠãããŸããã
ã¡ãªã¿ã«ãã®LINE Botã®å 容ã«ã€ããŠãéå»ã«LINE DCæ§ã®ã€ãã³ãã«ç»å£ããéã®6ååã®LTãå ¬éãããŠããŸããããŒã«ã«èå³ãæã£ãŠããã ããããã²ã
ãããã¯ãŒã¯ã®éå±€ã¢ãã«ã«ã€ããŠã®åŠç¿
æ±äº¬é信倧åŠã®ææ¥ã§ãã€ã³ã¿ãŒãããæè¡ã«ã€ããŠåŠãã§ããŸãã
åŠç¿ã®ã¢ãŠããããã®ããã«ãã€ã³ã¿ãŒãããã®ä»çµã¿ã®äžã§éèŠãªããããã¯ãŒã¯ã®éå±€ã¢ãã«ããšãã®ä»£è¡šçãªãTCP/IPã¢ãã«ãã«ã€ããŠæŽçããŠã¿ãŸããããã§ãŸãšããã®ã¯è¬çŸ©ã®å 容ãè©Šéšå¯Ÿçãšããããã§ã¯ãªããäžè¬çãªWebãæžç±ã§åŠã¹ãå 容ãšãªããŸãã
ãããã¯ãŒã¯ãåŠã¶éã«ã¯ããã¡ãã®ããã°ãšããããŸãšããæžç±ããããããããããã§ãã
åã¯3幎åã®ããã°ã©ãã³ã°ååŠè æ代ã«ãã®æžç±ãèªãã§ããŠããã®æã«ãããªèšäºãæžããŠããŸãããçšæãªæç« ã§ãããèªåã§èªã¿è¿ããŠå匷ã«ãªãã®ã§ãæãªããè¯ãèšäºã ãšæã£ãããããŸãïŒç¬ïŒã
ããã§ã¯ãããå°ãæŽçããŠãŸãšãçŽããŠã¿ãŸãã
ãããã¯ãŒã¯éå±€ã¢ãã«ãšã¯ãªããªã®ã
ãããã¯ãŒã¯éå±€ã¢ãã«ãšã¯ãã³ã³ãã¥ãŒã¿ãããã¯ãŒã¯ã§ã®éä¿¡ãå®çŸãããããããŸããŸãªããã°ã©ã ãæ©åšãããã€ãã®éå±€ã«åé¡ããŠã圹å²ãæ確ã«ãããšããèãæ¹ã§ãã
代衚çãªéå±€ã¢ãã«ãšããŠã次ã®2ã€ãæããããŸãã
TCP/IPïŒ4éå±€ã«åé¡ïŒ
OSIåç §ã¢ãã«ïŒ7éå±€ã«åé¡ïŒ
åå±€ã¯ç¬ç«ãã圹å²ãæã£ãŠããŠãããããã®å±€ã§éä¿¡ãè¡ãããã®ã«ãŒã«ïŒãããã³ã«ïŒã決ããããŠããŸãã
æå ã®ããœã³ã³ããä»ã®æ©åšã«äœããã®ããŒã¿ãéä¿¡ããéã«ã¯ããããã¯ãŒã¯ã®åå±€ãããããã®åœ¹å²ãæãããªãããçžæåŽã®æ©åšã®åãå±€ãžããŒã¿ãå±ããŠããŸãã
ãã®ãšããäžäžã«é£æ¥ããå±€ã§ããŒã¿ã®åãæž¡ããè¡ããªããçžæåŽãžã®ããŒã¿éä¿¡ãè¡ãããŸãïŒäžçªäžã®å±€ã®ã¿ãæ©åšéã§ã®ããŒã¿ã®ãããšããè¡ãããŸãïŒãäŸãã°ãäžã®å±€ããéãããŠããããŒã¿ã«æžããŠããå®å ã«ããŒã¿ãéã³ãããã«æ å ±ããã£ã€ããŠäžã®å±€ã«æž¡ãâŠã¿ãããªããšãããããã¯ãŒã¯éä¿¡ã§ã¯è¡ãããŠããŸãã
ãã®ããã«å±€ã«åããŠã«ãŒã«ãã¯ã£ãã決ããŠãæ©åšãããã°ã©ã ã®åœ¹å²ãæ確ã«ããããšã§ãè€éã«èŠãããããã¯ãŒã¯éä¿¡ãããŸãå®çŸã§ããŠããŸãã
TCP/IPã®æŠèŠ
éå±€ã¢ãã«ã®ãã¡ãããã¡ã¯ãã¹ã¿ã³ããŒãã«ãªã£ãŠããâŠã€ãŸãçŸåšåºãæ®åããŠããã¢ãã«ããæ¯èŒçã·ã³ãã«ãªæ§é ã®ãTCP/IPãã§ãã
WebããŒãžã衚瀺ãããä»çµã¿ã«ã䜿ãããŠããTCP/IPã¯ãæ©åšãããã°ã©ã ã®åœ¹å²ã4ã€ã®éå±€ã«åé¡ããŠããŸãïŒã«ãã³ã®äžã¯ç¹ã«éèŠãªããŒã¯ãŒãïŒã
ãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ãŒã¹å±€
ç©ççã«ç¹ãã£ãŠããæ©åšå士ã§ããŒã¿ã®éä¿¡ãè¡ãå±€ïŒMACã¢ãã¬ã¹ãã€ãŒãµãããïŒã€ã³ã¿ãŒãããå±€
è€æ°ãããã¯ãŒã¯ã®æ©åšãšã³ã³ãã¥ãŒã¿éã§ããŒã¿ãéåä¿¡ããå±€ïŒIPã¢ãã¬ã¹ãã«ãŒãã£ã³ã°ïŒãã©ã³ã¹ããŒãå±€
ã³ã³ãã¥ãŒã¿ãšã¢ããªéã§é©åã«ããŒã¿ãéåä¿¡ããå±€ïŒããŒãçªå·ïŒã¢ããªã±ãŒã·ã§ã³å±€
ã¢ããªãWebããŒãžãã¡ãŒã«ãªã©ããŒã¿ãå©çšã§ããããã«ããŒã¿åœ¢åŒãæé ã決ããå±€ïŒãµãŒããšã¯ã©ã€ã¢ã³ãïŒ
ããããã®å±€ã§ãäžå¿äººç©ã誰ïŒäœïŒã§ãããã倧äºã§ãã
äŸãã°ã€ã³ã¿ãŒãããå±€ã§ã¯ããããã¯ãŒã¯ã«æ¥ç¶ãããã³ã³ãã¥ãŒã¿ãæ©åšããã¡ãéä¿¡ã®äž»åœ¹ã ãããã©ã³ã¹ããŒãå±€ã§ã¯ãã³ã³ãã¥ãŒã¿ãšãã®äžã§éãããŠããã¢ããªããéä¿¡ã®äž»åœ¹ã§ããã¡ãªã¿ã«ããããã¯ãŒã¯ã€ã³ã¿ãŒãã§ãŒã¹å±€ã¯éãããç©ççã«ã€ãªãããŠããéãããããã¯ãŒã¯å ã®æ©åšããã¡ãéä¿¡ã®äž»åœ¹ã§ãããããã«ã¯ã±ãŒãã«ã§æ¥ç¶ãããæç·LANç°å¢ã®ã»ããç®ã«èŠããªããã©ç¹ãã£ãŠããç¡ç·LANç°å¢ãå«ãŸããŸãã
åå±€ã§ãã䜿ãããŠãããããã³ã«ã®äŸããç°¡åã«è¡šã«ãŸãšããŸããããããã¯ãåå±€ã®äžå¿äººç©å士ã§åã決ããããŠããå ±éã®ã«ãŒã«ã«ããããŸãã
![](https://assets.st-note.com/img/1700719741452-cAT6xbXoXy.png?width=1200)
TCP/IPãšããã¢ãã«ã®ååã¯ããã©ã³ã¹ããŒãå±€ã®ãããã³ã«ãTCPããšã€ã³ã¿ãŒãããå±€ã®ãããã³ã«ãIPãããæ¥ãŠãããã§ããã
ããŒã¿éåä¿¡ãã§ããã®ã¯ãIPã¢ãã¬ã¹ããšãã«ãŒãã£ã³ã°ãã®ããã
TCP/IPã«ãããŠã¯ã©ã®å±€ãéèŠãªåœ¹å²ãæ ã£ãŠããŸãããäžã§ãã€ã³ã¿ãŒãããã§é ãé¢ããã³ã³ãã¥ãŒã¿ãšéä¿¡ããããã®æ žãšãªãã®ã¯ããã®åã®éããã€ã³ã¿ãŒãããå±€ãã«ãããŸãã
ã€ã³ã¿ãŒãããå±€ã§ã¯ããŒã¿ãåãåã£ãéã«ãããã«ç€ºããããIPã¢ãã¬ã¹ããå®å ãšããŠãã©ã®ãããã¯ãŒã¯ã®ã©ã®æ©åšã«ãã®ããŒã¿ãéããã決ããŸããIPã¢ãã¬ã¹ã¯ãããã¯ãŒã¯ãšããã«æå±ããæ©åšã®ãäœæãã®ãããªãã®ã§ãããããã§æ³šæããªããã°ãããªãã®ããåãæ©åšã§ãæå±ãããããã¯ãŒã¯ãå€ããã°ãäœæã§ããIPã¢ãã¬ã¹ã¯å€ãããšããããšã§ãã
ãããŠããã®IPã¢ãã¬ã¹ãå®å ãšããŠå®éã«ããŒã¿ãå±ããçµè·¯ã決ããã®ããã«ãŒã¿ãŒãè¡ã£ãŠãããã«ãŒãã£ã³ã°ããšããä»äºã§ããã«ãŒã¿ãŒã¯è€æ°ã®ãããã¯ãŒã¯ã«æå±ããŠããããã¯ãŒã¯å士ã®ãããšãªã£ãŠããŸããç®çã®æ©åšã®IPã¢ãã¬ã¹ãŸã§ã©ããããããã¯ãŒã¯çµè·¯ã蟿ã£ãŠå±ããã®ãæçãªã®ãã調ã¹ãå¹ççã«ããŒã¿ãéä¿¡ãã圹å²ãæ ã£ãŠããŸãã
ãã®ãIPã¢ãã¬ã¹ãã«ã€ããŠãå æ¥èŠã€ããå ·äœçãªãã®ãäžã€ãæ®æ®µããœã³ã³ãããã°ã€ã³ããŠããDiscordã®ã¢ã«ãŠã³ãã«ã¹ãããããã°ã€ã³ãããšãã«ãIPã¢ãã¬ã¹ã®èªèšŒæäœãæ±ããããŸãããéãããŠããã¡ãŒã«ã«åŸã£ãŠèªèšŒæäœãçµããã®ããã¡ãã®ç»é¢ã§ãã
![](https://assets.st-note.com/img/1700721688751-OHnzS4w8Uy.png?width=1200)
Discordã¢ã«ãŠã³ãã¯ãè€æ°ã®ç«¯æ«ããåæã«ãã°ã€ã³ããŠããã ããŸãããéåžžãæ°ããå Žæ(å¥ã®ç«¯æ«)ãããã°ã€ã³ããããããã¯IPã¢ãã¬ã¹ãå€æŽãããå Žåãã·ã¹ãã ãèªåçã«æç¥ããã客æ§ä»¥å€ã®èª°ããDiscordã¢ã«ãŠã³ãã«ã¢ã¯ã»ã¹ããã®ãé²ãããã«IPèš±å¯ã®ããã®ã¡ãŒã«ãéä¿¡ãããŸãã
â Discord (@discord) March 6, 2019
ããã¯Discordã§çšæãããŠãããäžæ£ãªãã°ã€ã³ãé²æ¢ããããã®æªçœ®ã§ããèŠããã«ãæ®æ®µã¯IPã¢ãã¬ã¹AïŒããœã³ã³ïŒããéä¿¡ãæ¥ãŠããã©ãä»æ¥ã¯ãã€ããšéãIPã¢ãã¬ã¹BïŒã¹ããïŒããéä¿¡ãæ¥ãããããæ¬åœã«ããªãã§åã£ãŠãïŒããšããããšããDiscordããã芪åã«ç¢ºèªããŠãããŠãããã§ããIPã¢ãã¬ã¹ã®ä»çµã¿ã¯ããããã£ãã»ãã¥ãªãã£é¢ã§ã圹ç«ã€ãã§ããã
ãšããã§ããIPã¢ãã¬ã¹ããšãã£ã¡ãã«ãªããããçšèªã«ãMACã¢ãã¬ã¹ãããããŒãçªå·ãããããŸããããããéåä¿¡å ã®äœæãè¡šããã®ã§ããããããããã§ããããç°¡åã«æŽçãããšãã®ãããªæãã§ãã
MACã¢ãã¬ã¹
æ©åšããšã«äžæã«å²ãæ¯ãããçªå·ããããã¯ãŒã¯ã€ã³ã¿ãŒãã§ãŒã¹å±€ã§äœ¿ãããIPã¢ãã¬ã¹
ã©ã®ãããã¯ãŒã¯ã®ã©ã®æ©åšå®ãŠãã瀺ãçªå·ïŒåãæ©åšã§ãæå±ãããããã¯ãŒã¯ãå€ããã°å€ããïŒãã€ã³ã¿ãŒãããå±€ã§äœ¿ãããããŒãçªå·
ã³ã³ãã¥ãŒã¿å ã®ã©ã®ã¢ããªãã瀺ãçªå·ããã©ã³ã¹ããŒãå±€ã§äœ¿ããã
å ã»ã©ã®TCP/IPã¢ãã«ã®äžã§ãã©ã®ç»å Žäººç©ã«å²ãæ¯ãããçªå·ãªã®ãã»ã©ã®å±€ã§äœ¿ããããã®ãªã®ããç解ããŠãããšãã¹ãããªããŸããã
éèš
æšæ¥ããã倧åŠã®3åŠæã®åäœèªå®è©Šéšãã¹ã¿ãŒããããšããã§ããåã¯å±¥ä¿®ããŠãã2ç§ç®ã®è©Šéšãæ©ãã«çµãããã¡ãã£ãŠã¹ãããªãåããŠã®è©Šéšã§ã¡ãã£ãšç·åŒµããŸãããã倧äžå€«ã ãããšæãã®ã§çµæãåºãã®ãåŸ ã£ãŠããŸããæ¥å¹Žããçç§çãšããŠå ¥åŠããŠææ¥ã®æ°ãå¢ãããããªããªã倧å€ããã§ãã
ãããŠå®ã¯ã1ã¶æåŸãããã«åºæ¬æ å ±æè¡è è©Šéšãåéšããããšã«ããŠããŸãïŒè©Šéšæ¥ã¯12æ23æ¥ïŒãæ¥é±ãããã®åŠç¿ãã¹ã¿ãŒãäºå®ãåéšããçç±ãåŠç¿ãã©ã³ã«ã€ããŠã¯ãŸãæ¹ããŠæžããŸãã
ãã®èšäºãæ°ã«å ¥ã£ãããµããŒããããŠã¿ãŸãããïŒ