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
2.4k
0
Share
RustのLINEBot SDKを自作した話
Yuto Takamune
September 29, 2023
More Decks by Yuto Takamune
See All by Yuto Takamune
GPT-3.5 Turbo をファインチューニングして自分のクローンを作った話
shinbunbun_
1
380
セキュリティキャンプ2023 Y3分散合意ゼミ 最終発表
shinbunbun_
0
4.8k
NixOSでもご自宅k8sがしたい!
shinbunbun_
2
4.9k
カーネルレベルでTwitterを禁止しよう
shinbunbun_
0
300
CRDTで始めるコンフリクトしないデータ同期
shinbunbun_
0
650
Haskell初心者がHaskellの楽しさについて語る
shinbunbun_
0
230
Rustで楕円曲線暗号の署名アルゴリズムをフルスクラッチ実装してみた話
shinbunbun_
0
2.3k
IEEE802.1X認証を導入してみた
shinbunbun_
0
330
UBICの食材管理APIを作った話
shinbunbun_
0
250
Other Decks in Programming
See All in Programming
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
130
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.4k
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
13
3.4k
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
440
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
210
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
420
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
240
Lessons from Spec-Driven Development
simas
PRO
0
130
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
580
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
530
CSC307 Lecture 17
javiergs
PRO
0
310
dRuby over BLE
makicamel
2
300
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
247
13k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Skip the Path - Find Your Career Trail
mkilby
1
140
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
720
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
380
sira's awesome portfolio website redesign presentation
elsirapls
0
270
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
830
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
840
Building Adaptive Systems
keathley
44
3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Raft: Consensus for Rubyists
vanstee
141
7.5k
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作ろう!