Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Discord Embede SDK入門…… してみたかった話
Search
godan
March 22, 2024
Programming
590
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Discord Embede SDK入門…… してみたかった話
2024-03-22
【エンジニアLTイベント】春のアウトプットLT会登壇資料です
godan
March 22, 2024
More Decks by godan
See All by godan
献立を支える技術
godan
1
130
僕の イベントスタッフ 装備の最適解
godan
2
180
YAPC::Hakodateの映像記録を支える技術
godan
5
690
ミシンと刺繍とOSS
godan
3
210
Nest Hubがある生活
godan
2
130
オンライン配信の始め方
godan
3
220
SOFT SKILLSは定期的に読み返したくな良書
godan
2
120
今年どれだけ本読んだ?
godan
0
150
本とスプシと同人誌
godan
0
390
Other Decks in Programming
See All in Programming
Agents on Rails - Rails at Scale 2026
irinanazarova
0
340
dotNET_vulnclicker_intro.pdf
deka_morita
0
110
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
7.7k
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
260
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.1k
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
380
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
120
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
480
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
320
ジョジョの世界をXRで再現する
mofurune
0
130
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
140
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
350
Featured
See All Featured
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
460
エンジニアに許された特別な時間の終わり
watany
109
250k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
The Cost Of JavaScript in 2023
addyosmani
55
10k
The Language of Interfaces
destraynor
162
27k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
210
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
YesSQL, Process and Tooling at Scale
rocio
174
15k
Typedesign – Prime Four
hannesfritz
42
3.2k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
30 Presentation Tips
portentint
PRO
1
420
Transcript
虎の穴ラボ エンジニア
⾃⼰紹介 最近は⿓が如く3とラスティッド‧モスがマイブーム 倫理が退廃した世界と ⼈類が退廃した世界が好き
Discord Embedded SDKについて - Discordの通話にアクティビティとしてアプリを起動できる - watch together, gartic phoneなど⼀部に公開されてい
た - 18⽇に⼀般でもSDKを通して実装できるように!
Discord Embedded SDKについて https://discord.com/build/embedded-app-sdk
Discord Embedded SDKについて - Discordの通話にアクティビティとしてアプリを起動できる - watch together, gartic phoneなど⼀部に公開されていた
- 18⽇に⼀般でもSDKを通して実装できるように! - 将来的には収益化などもできそう - > 「デベロッパーが⾃らのアプリを構築、共有、配信し、ユーザーの⽬に触れ、そして収益化する。私たちはDiscordを、その全てができる最⾼の場所にした いと考えています」 https://gigazine.net/news/20240313-discord-sdk-third-party/
とりあえず⼊⾨する - ⾊々遊べそうな気配を感じる - 会社でもDiscordは使っているのでなにか仕込みたい → とりあえず触ってみよう!
とりあえず⼊⾨する - Discord内のiFrameで動作するページ - やりとりは⼤雑把に2種類 - Discordのイベントに対して関数を⽤意して引っ掛ける - Discordに対してコマンドを発⾏する
とりあえず⼊⾨する Client App Discord (iFrame) Discord API App Server ソケット開通
初期化 アプリ情報取得 アプリ情報 認証リクエスト OAuth code 送付 認証 アクセストークン アクセストークン SD K が い い 感 じ に や っ て く れ る
とりあえず⼊⾨する とりあえず公式の「Building Your First Activity in Discord」を試す https://discord.com/developers/docs/activities/building-an-activity
とりあえず⼊⾨する Discord Developer Portalからアプリを作る
とりあえず入門する // Import the SDK import { DiscordSDK } from
"@discord/embedded-app-sdk"; import "./style.css"; import rocketLogo from '/rocket.png'; // Instantiate the SDK const discordSdk = new DiscordSDK(import.meta.env.VITE_DISCORD_CLIENT_ID); setupDiscordSdk().then(() => { console.log("Discord SDK is ready"); }); async function setupDiscordSdk() { await discordSdk.ready(); } document.querySelector('#app').innerHTML = ` <div> <img src="${rocketLogo}" class="logo" alt="Discord" /> <h1>Hello, World!</h1> </div> `;
とりあえず⼊⾨する サーバーを実⾏したら合わせてCloudflared tunnelを実⾏する $ npm run dev client terminal output
VITE v5.0.12 ready in 100 ms ➜ Local: http://localhost:5173/ ➜ Network: use --host to expose ➜ press h + enter to show help $ cloudflared tunnel --url http://localhost:5173
Cloudflare tunnelとは - Cloudflareを通して外部からlocalへトンネリングしてくれ る - 今回はローカルの開発サーバーへアクセスするためのURL を取得するために使っている
URLを登録する
URLを登録する - 悪意あるエンドポイントにリクエストしない対策 - パスごとにアクセス先のエンドポイントを指定する
Hello, world!
ここで⼒尽きました React導⼊までは頑張った
ここで⼒尽きました - ⾊々遊べそう - 参加サーバーや名前、発⾔中?なども取れそう - 基本はSPAなのでwebでできることは基本全部できる - 普段使ってるサービス内で⾃分のアプリが動いてる
ここで⼒尽きました - 複数ユーザーの同期を取る必要 - ポーリングか、WebSocketか何かしらがいる - WebSocketの知識がなさすぎて間に合わなかったです… 今年中になかしら⼀つアプリを出したい……!
おわり ⾃宅ネットワークはまたどこかで……