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連携サービスを作った話
Search
misosoup160
June 29, 2021
65
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Discord連携サービスを作った話
フィヨルドブートキャンプの最終課題で作ったDiscord連携サービスの紹介です
misosoup160
June 29, 2021
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
Bash Introduction
62gerente
615
220k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
460
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
Everyday Curiosity
cassininazir
0
360
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
Transcript
RailsͰDiscordͷ ࿈ܞαʔϏεΛ࡞Γ·ͨ͠ 2021-06-29 misosoup
ࣗݾհ • misosoupʢΈͦ͠ΔʣͰ͢ɻ • fjordbootcampͰϓϩάϥϛϯάͷษڧΛ͍ͯ͠·͢ɻ • twitter : @miso160cm •
github : misosoup160
Discord࿈ܞαʔϏεΛ࡞ͬͨܦҢ • ϑΟϤϧυϒʔτΩϟϯϓશʹΦϯϥΠϯͷεΫʔϧͰɺίϛϡ χέʔγϣϯखஈDiscordΛར༻͍ͯ͠Δ • ৽͘͠ೖ͖ͬͯͯ͘ΕΔडߨੜ͕૿͍͑ͯΔ͕ɺੵۃతʹίϛϡχ έʔγϣϯΛͱ͍͖͔͚͕ͬͯͬ͘ͳ͔ͳ͔௫Ίͳ͍ਓ͍Δ • ͔ࣗΒࣗݾհ͠ͳͯ͘ϝϯόʔΛհͯ͘͠ΕΔΑ͏ͳBot͕ ཉ͍͠ʂ
ͲΜͳαʔϏεʹ͢Δʁ ࠷ۙͲΜͳԻָΛௌ͍͍ͯ·͔͢ʁ αʔϏεଆ Discordଆ Ұ൪ָ͔ͬͨ͠ϓϥΫςΟεͳΜͰ͔ͨ͠ʁ ࡞ۀதʹʓʓΛΑ͘ฉ͍͍ͯ·͢ νʔϜ։ൃͷϓϥΫςΟεͰ͢ #PU Έͦ͠Δ͞Μʹฉ͍ͨ͜ͱΛγΣΞ͢ΔΑʂ Ұ൪ָ͔ͬͨ͠ϓϥΫςΟεͳΜͰ͔ͨ͠ʁ
νʔϜ։ൃͷϓϥΟςε͕Ұ൪ָ͔ͬͨ͠Ͱ͢ɻ #PU ͳΔ΄Ͳʙʙʙʂʂ
ͲΜͳαʔϏεʹ͢Δʁ
ͲΜͳαʔϏεʹ͢Δʁ ϩάΠϯ ࣭ʹ͑Δ ࣗϝϯόʔͷաڈͷճ͕ݟΕΔ
ͲΜͳαʔϏεʹ͢Δʁ ཧऀ࣭ΛՃฤूͰ͖Δ DiscordʹૹΒΕΔϝοηʔδ
Discord APIͬͯʁ
Discord APIͰͰ͖Δ͜ͱ • HTTP API • HTTPϦΫΤετΛૹͬͯDiscordαʔόʔͷใΛऔಘͨ͠Γɺߋ ৽ͨ͠ΓͰ͖Δͷ • Gateway
API • WebSocketͷଓͰɺDiscordαʔόʔͷϦΞϧλΠϜͷΠϕϯτ Λऔಘͯͦ͠Εʹରͯ͠ԠΛฦͤΔͷ #PU Λαʔόʔʹটͯ͠Ͷ
Discordؔ࿈ͷ࣮ • DiscordೝূͰϩάΠϯ͢Δ • ϩάΠϯ͢Δͱ͖ϑΟϤϧυϒʔτΩϟϯϓαʔόʔͷਓ͔͠ϩάΠ ϯͰ͖ͳ͍Α͏ʹ͢Δ • ϩάΠϯ͢Δͱ͖αʔόʔͷΦʔφʔʢ࡞ͬͨਓʣΛࣝผ͢Δ • DiscordαʔόʔʹϝοηʔδΛࣗಈૹ৴͢Δ
• αʔόʔ͔ΒڈͬͨϢʔβʔΛαʔϏεଆ͔Βআ͢Δ
HTTP APIͷྫɿϝοηʔδΛૹΔ https://discord.com/developers/docs/resources/channel#create-message https://www.rubydoc.info/gems/discordrb/Discordrb/API/Channel#create_message-class_method Discord document Discordrb document
HTTP APIͷྫɿϝοηʔδΛૹΔ
HTTP APIͷྫɿϝοηʔδΛૹΔ )FSPLV4DIFEVMFS
Gateway APIͷྫɿBANϢʔβʔͷऔಘ https://discord.com/developers/docs/topics/gateway#guild-member-remove https://www.rubydoc.info/gems/discordrb/Discordrb/EventContainer#member_leave-instance_method
Gateway APIͷྫɿBANϢʔβʔͷऔಘ Procfile
·ͱΊ • DiscordͷAPIBotΛ௨ͯ͡ɺHTTP APIͱGateway APIΛ͍ɺ৭ʑ ͳػೳΛ࣮͢Δ͜ͱ͕Ͱ͖Δ • Discord APIΛಡΈղ͖ͳ͕Β༷Λߟ͍͑ͯ͘ͱ͜Ζ͕ۤ࿑͕ͨ͠ ໘ന͍ͱ͜ΖͰͨ͠
• RubyͰDiscordʹָ͍͠ػೳΛ͍ͭͬͯ͘͜͏