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.2k
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
270
セキュリティキャンプ2023 Y3分散合意ゼミ 最終発表
shinbunbun_
0
3.1k
NixOSでもご自宅k8sがしたい!
shinbunbun_
2
3k
カーネルレベルでTwitterを禁止しよう
shinbunbun_
0
200
CRDTで始めるコンフリクトしないデータ同期
shinbunbun_
0
420
Haskell初心者がHaskellの楽しさについて語る
shinbunbun_
0
170
Rustで楕円曲線暗号の署名アルゴリズムをフルスクラッチ実装してみた話
shinbunbun_
0
1.1k
IEEE802.1X認証を導入してみた
shinbunbun_
0
230
UBICの食材管理APIを作った話
shinbunbun_
0
190
Other Decks in Programming
See All in Programming
法律の脱レガシーに学ぶフロントエンド刷新
oguemon
5
740
Amazon Bedrock Multi Agentsを試してきた
tm2
1
280
Djangoアプリケーション 運用のリアル 〜問題発生から可視化、最適化への道〜 #pyconshizu
kashewnuts
1
250
Pulsar2 を雰囲気で使ってみよう
anoken
0
240
Java Webフレームワークの現状 / java web framework at burikaigi
kishida
9
2.2k
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
6
4k
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
150
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.2k
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
160
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
560
Domain-Driven Transformation
hschwentner
2
1.9k
バックエンドのためのアプリ内課金入門 (サブスク編)
qnighy
8
1.8k
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
Automating Front-end Workflow
addyosmani
1368
200k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.2k
Designing for humans not robots
tammielis
250
25k
Six Lessons from altMBA
skipperchong
27
3.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
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作ろう!