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
はじめてのDiscordBot
Search
株式会社ビットキー / Bitkey Inc.
PRO
June 29, 2022
Technology
0
480
はじめてのDiscordBot
株式会社ビットキー / Bitkey Inc.
PRO
June 29, 2022
Tweet
Share
More Decks by 株式会社ビットキー / Bitkey Inc.
See All by 株式会社ビットキー / Bitkey Inc.
【開発を止めるな】機能追加と並行して進めるアーキテクチャ改善/Keep Shipping: Architecture Improvements Without Pausing Dev
bitkey
PRO
1
270
“決まらない”NSM設計への処方箋 〜ビットキーにおける現実的な指標デザイン事例〜 / A Prescription for "Stuck" NSM Design: Bitkey’s Practical Case Study
bitkey
PRO
1
900
AI時代の戦略的アーキテクチャ 〜Adaptable AI をアーキテクチャで実現する〜 / Enabling Adaptable AI Through Strategic Architecture
bitkey
PRO
17
17k
Dev Containers と Skaffold で実現する クラウドネイティブ開発環境 ローカルのみという制約に挑む / Cloud-Native Development with Dev Containers and Skaffold: Tackling the Local-Only Constraint
bitkey
PRO
0
320
待つ、歩く、そして祈る -モバイルアプリの厄介なテスト奮闘記-/Wait, Walk, and Pray -The Troublesome Struggle of Mobile App Testing-
bitkey
PRO
1
130
見栄えと使いやすさの先にある 特別感 をデザインする / Designing a Sense of Specialness Beyond Aesthetics and Usability
bitkey
PRO
0
250
フレームワーク探しはもう終わり! チームに「ジャストフィット」するワークショップの作り方 / No More Framework Searching: How to Build a 'Just-Fit' Workshop for Your Team
bitkey
PRO
0
140
一次体験を起点にしたUX改善の取り組み / Direct Experience Driven UX Improvements
bitkey
PRO
0
360
ユーザー体験は細部に宿る -ウィジェットQAの挑戦と気づき- / UX is in the details: Challenges and Learnings from Widget QA
bitkey
PRO
0
140
Other Decks in Technology
See All in Technology
システムのアラート調査をサポートするAI Agentの紹介/Introduction to an AI Agent for System Alert Investigation
taddy_919
2
1.9k
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
130
データ民主化のための LLM 活用状況と課題紹介(IVRy の場合)
wxyzzz
2
680
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
120
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
180
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
410
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Stately
mu7889yoon
1
110
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
110
Azure Durable Functions で作った NL2SQL Agent の精度向上に取り組んだ話/jat08
thara0402
0
150
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
9.7k
The Curse of the Amulet
leimatthew05
1
8.3k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
320
Faster Mobile Websites
deanohume
310
31k
How to Talk to Developers About Accessibility
jct
2
130
GraphQLとの向き合い方2022年版
quramy
50
14k
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Scaling GitHub
holman
464
140k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
220
Transcript
͡ΊͯͷDiscord Bot
Outline 1. ࣗݾհ 2. ͳͥDiscord Bot͕ඞཁͳͷ͔ 3. Discord Bot Λಈ͔ͯ͠ΈΔ
4. Discord Bot ΛVCʹࢀՃͤ͞Δ 5. ·ͱΊ 2 2
1. ࣗݾհ • ໊લ ◦ ͼ͖͋ (BYAK) • ձࣾ ◦
גࣜձࣾϏοτΩʔ • ࣄ ◦ Go ͰόοΫΤϯυͷ։ൃ ◦ React+Firebase Ͱϑϩϯτͷ։ൃ ◦ C++ ͰϑΝʔϜΣΞͷςετσόοά • झຯ ◦ ϘʔυήʔϜ ◦ VϥΠόʔͷਪ͠׆ 3
ͳͥDiscord Bot͕ඞཁͳͷ͔ 4 4
2. DiscordͱίϛϡχςΟ ίϛϡχςΟαʔόʔͱͯ͠ͷ Discord • ίϛϡχςΟʹɺίϛϡχςΟಛ༗ͷϧʔϧͱͦΕʹ͏ӡ༻࡞ۀ͕ੜ ·Ε͕ͪ ◦ ྫ: αʔόʔʹࢀՃͨ͠ਓͷΦϯϘʔσΟϯά
▪ ࣗݾհɺϩʔϧͷద༻ ◦ ྫ: ϒϩʔυΩϟετ৴ͷࡍͷςΩετͷಡΈ্͛ 5
2. DiscordͱίϛϡχςΟ ίϛϡχςΟαʔόʔͱͯ͠ͷ Discord • ίϛϡχςΟʹɺίϛϡχςΟಛ༗ͷϧʔϧͱͦΕʹ͏ӡ༻࡞ۀ ͕ੜ·Ε͕ͪ ◦ ྫ: αʔόʔʹࢀՃͨ͠ਓͷΦϯϘʔσΟϯά
▪ ࣗݾհɺϩʔϧͷద༻ ◦ ྫ: ϒϩʔυΩϟετ৴ͷࡍͷςΩετͷಡΈ্͛ 6 ࣗಈԽ͠Α͏ɹˠɹDiscord ͷ BotػೳΛ͑Ͱ͖ͦ͏
2. DiscordͱίϛϡχςΟ ࠓઆ໌͢Δ༰ 1. Discord Bot Λىಈ͠ɺαʔόʔͰϝοηʔδΛΓͱΓ͢Δ 2. Bot ΛϘΠενϟοτʹࢀՃͤ͞ɺԻσʔλΛ࠶ੜ͢Δ
7
Discord Bot Λಈ͔ͯ͠ΈΔ 8 8
3. Discord Bot Λಈ͔ͯ͠ΈΔ ͜ 9
3. Discord Bot Λಈ͔ͯ͠ΈΔ ͜ 10
3. Discord Bot Λಈ͔ͯ͠ΈΔ ͜ 11
3. Discord Bot Λಈ͔ͯ͠ΈΔ ͜ 12
3. Discord Bot Λಈ͔ͯ͠ΈΔ • Πϕϯτͱϋϯυϥ ◦ discord ͍͔ͭ͘Πϕϯτ͕ఆٛ͞Ε͍ͯͯɺదٓൃՐ͢Δͷ ͰɺΠϕϯτʹԠͨ͡ϋϯυϥΛొ͢Δ͜ͱͰɺͦͷΠϕϯτ͕
ൃੜͨ͠λΠϛϯάͰ bot ʹॲཧΛ࣮ߦͤ͞Δ͜ͱ͕Ͱ͖·͢ɻ ▪ ྫ: Ready: Bot͕αʔόʔʹଓ͠·ͨ͠ ▪ ྫ: Message Create: ϝοηʔδ͕ૹΒΕ·ͨ͠ ◦ discordgo Ͱ discord ͷΠϕϯτ໊ʹରԠͨ͠ struct ͕ఆٛ͞Ε ͍ͯͯɺϋϯυϥͷୈ̎Ҿʹ͖ͬͯ·͢ɻ 13
3. Discord Bot Λಈ͔ͯ͠ΈΔ 14
3. Discord Bot Λಈ͔ͯ͠ΈΔ 15
3. Discord Bot Λಈ͔ͯ͠ΈΔ 16
3. Discord Bot Λಈ͔ͯ͠ΈΔ 17
Bot ΛVCʹࢀՃͤ͞Δ 18 18
Α͋͘ΔΠϯλʔϑΣʔε “!!” ࢝·ΓͳͲͰίϚϯυΛஅ͠ɺ ίϚϯυͷૹ৴ऀͷ͍ΔVCʹࢀՃͨ͠Γɺ ίϚϯυʹΑͬͯޮՌԻΛྲྀͨ͠Γ͢Δػೳ͕͋Γ·͢ 4. Bot ΛVCʹࢀՃͤ͞Δ 19
20 4. Bot ΛVCʹࢀՃͤ͞Δ
21 4. Bot ΛVCʹࢀՃͤ͞Δ
22 4. Bot ΛVCʹࢀՃͤ͞Δ
23 4. Bot ΛVCʹࢀՃͤ͞Δ
24 4. Bot ΛVCʹࢀՃͤ͞Δ
25 4. Bot ΛVCʹࢀՃͤ͞Δ
26 4. Bot ΛVCʹࢀՃͤ͞Δ
·ͱΊ 27 27
28 5. ·ͱΊ • ·ͱΊ ◦ discordgo, dgvoice Λ͏͜ͱͰ؆୯ʹBotΛ࣮Ͱ͖Δ ◦
Discord্Ͱਓ͕ߦ͏ૢ࡞BotʹҠৡͰ͖Δ ◦ ͜͜Ͱઆ໌͠ͳ͔ͬͨΠϕϯτૢ࡞ʹ͍ͭͯެࣜυΩϡϝϯτΛࢀ র͠ɺରԠͨ͠ discordgo ͷAPIΛௐΔͱྑ͍ɻ ▪ discordgo Discord API ͷϨϕϧϚοϐϯάΛతͱͨ͠ϥΠϒ ϥϦͷͳͷͰɺެࣜυΩϡϝϯτ͕ͦͷ··ͯ·Δ͜ͱ͕ଟ͍ ▪ discordgo/examples ࢀߟʹͳΔ ▪ Ͳ͏ͯ͠Θ͔Βͳ͚Ε Discord Gophers
29 5. ·ͱΊ ͜ͷࢿྉͷݩʹͳͬͨDiscord Botͪ͜Β https://github.com/byakheee/my-discord-bot