Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RustのLINEBot SDKを自作した話
Search
Yuto Takamune
September 29, 2023
Programming
0
1.4k
RustのLINEBot SDKを自作した話
Yuto Takamune
September 29, 2023
Tweet
Share
More Decks by Yuto Takamune
See All by Yuto Takamune
GPT-3.5 Turbo をファインチューニングして自分のクローンを作った話
shinbunbun_
0
290
セキュリティキャンプ2023 Y3分散合意ゼミ 最終発表
shinbunbun_
0
3.4k
NixOSでもご自宅k8sがしたい!
shinbunbun_
2
3.3k
カーネルレベルでTwitterを禁止しよう
shinbunbun_
0
220
CRDTで始めるコンフリクトしないデータ同期
shinbunbun_
0
460
Haskell初心者がHaskellの楽しさについて語る
shinbunbun_
0
180
Rustで楕円曲線暗号の署名アルゴリズムをフルスクラッチ実装してみた話
shinbunbun_
0
1.3k
IEEE802.1X認証を導入してみた
shinbunbun_
0
250
UBICの食材管理APIを作った話
shinbunbun_
0
210
Other Decks in Programming
See All in Programming
Embracing Ruby magic
vinistock
2
230
エンジニア向けCursor勉強会 @ SmartHR
yukisnow1823
3
12k
監視 やばい
syossan27
12
10k
Cursorを活用したAIプログラミングについて 入門
rect
0
190
Носок на сок
bo0om
0
1.3k
On-the-fly Suggestions of Rewriting Method Deprecations
ohbarye
3
5.4k
UMAPをざっくりと理解 / Overview of UMAP
kaityo256
PRO
3
1.5k
The Nature of Complexity in John Ousterhout’s Philosophy of Software Design
philipschwarz
PRO
0
170
AIコーディングの理想と現実
tomohisa
37
40k
ドメイン駆動設計とXPで支える子どもの未来 / Domain-Driven Design and XP Supporting Children's Future
nrslib
0
250
Road to Ruby for A Linguistics Nerd
hayat01sh1da
PRO
0
190
fieldalignmentから見るGoの構造体
kuro_kurorrr
0
140
Featured
See All Featured
Code Review Best Practice
trishagee
68
18k
Done Done
chrislema
184
16k
The Cost Of JavaScript in 2023
addyosmani
49
7.8k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Rails Girls Zürich Keynote
gr2m
94
13k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
570
Raft: Consensus for Rubyists
vanstee
137
6.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
What's in a price? How to price your products and services
michaelherold
245
12k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
5
600
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
Six Lessons from altMBA
skipperchong
28
3.8k
Transcript
RustのLINEBot SDKを自作した話 しんぶんぶん
自己紹介 • 名前: しんぶんぶん • 所属: 会津大学学部3年 • Twitter: @shinbunbun_,
@4fa19623 • LINE API Expert / seccamp ’23 / Cybozu labyouth 13th ◦ セキュキャン: 分散合意ゼミ(Raft) ◦ ラボユース: CRDTを使ったP2P分散データベースの開発
LINE Messaging APIについて/今回作ったもの • いわゆるLINEBotを作るのに必要な API • 各言語でSDKが公式から提供されて いる •
Rustは公式で提供されていないので 自作してみた • リポジトリ: https://github.com/shinbunbun/line- bot-sdk-rust LINEBot→
実装したもの • 基本的には構造体の型を定義してい く作業 • LINEから送られてくるメッセージと サーバから送信するメッセージそれぞ れの型を、ドキュメントを見ながら地道 に書いた •
いろいろなAPIがあるので、それらの ラッパーを書いた
使用した(主な)Crate • awc ◦ APIを叩くのに使用 • typed-builder ◦ 型レベルビルダーパターンでメッセージの structを構築できるようにした
• thiserror ◦ エラーハンドリングを良い感じにするのに使用
使用イメージ
使用イメージ
SDKを使ったサンプル実装 • Hands-on LINEBOT Rust編 Vol.1 ◦ 技術書典で頒布した本 • リポジトリ
◦ https://github.com/shinbunbun/Hands-on-LINEB OT-Rust-Vol.1
みんなもRustでLINEBot作ろう!