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.
June 29, 2022
Technology
0
460
はじめてのDiscordBot
株式会社ビットキー / Bitkey Inc.
June 29, 2022
Tweet
Share
More Decks by 株式会社ビットキー / Bitkey Inc.
See All by 株式会社ビットキー / Bitkey Inc.
オフィスビルを監視しよう:フィジカル×デジタルにまたがるSLI/SLO設計と運用の難しさ / Monitoring Office Buildings: The Challenge of Physical-Digital SLI/SLO Design & Operation
bitkey
1
120
事例で学ぶ!B2B SaaSにおけるSREの実践例/SRE for B2B SaaS: A Real-World Case Study
bitkey
1
160
整頓のジレンマとの戦い〜Tidy First?で振り返る事業とキャリアの歩み〜/Fighting the tidiness dilemma〜Business and Career Milestones Reflected on in Tidy First?〜
bitkey
3
17k
遠隔で同時に4人教育!? 〜リモート新人の「孤立」を防ぐオンボーディング事例〜/Educating 4 people at the same time remotely!〜Onboarding Case Studies to Prevent “Isolation” of Remote Newcomers〜
bitkey
0
56
ファームウェアは土管になるべきか 翻訳機になるべきか/Should firmware be a clay pipe or a translator?
bitkey
0
55
テストは合意形成をすべし!/Testing should be consensus building!
bitkey
0
63
Agentic Coding と 山登り と TypeScript〜体系的に考えてみよう!〜/Agentic Coding, Mountain Climbing and TypeScript~Let's think systematically!~
bitkey
0
250
"発信文化"をどうやって計測する?技術広報のKPI探索記/How do we measure communication culture?
bitkey
4
640
MCP でモノが動くとおもしろい/It is interesting when things move with MCP
bitkey
3
770
Other Decks in Technology
See All in Technology
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
2
7.8k
20250705 Headlamp: 專注可擴展性的 Kubernetes 用戶界面
pichuang
0
290
Claude Code に プロジェクト管理やらせたみた
unson
6
4.6k
OSSのSNSツール「Misskey」をさわってみよう(右下ワイプで私のOSCの20年を振り返ります) / 20250705-osc2025-do
akkiesoft
0
170
AIの全社活用を推進するための安全なレールを敷いた話
shoheimitani
2
560
IPA&AWSダブル全冠が明かす、人生を変えた勉強法のすべて
iwamot
PRO
2
190
スタートアップに選択肢を 〜生成AIを活用したセカンダリー事業への挑戦〜
nstock
0
260
Enhancing SaaS Product Reliability and Release Velocity through Optimized Testing Approach
ropqa
1
240
shake-upを科学する
rsakata
7
780
Glacierだからってコストあきらめてない? / JAWS Meet Glacier Cost
taishin
1
170
【あのMCPって、どんな処理してるの?】 AWS CDKでの開発で便利なAWS MCP Servers特集
yoshimi0227
4
280
How to Quickly Call American Airlines®️ U.S. Customer Care : Full Guide
flyaahelpguide
0
140
Featured
See All Featured
Music & Morning Musume
bryan
46
6.6k
Why Our Code Smells
bkeepers
PRO
336
57k
How GitHub (no longer) Works
holman
314
140k
A better future with KSS
kneath
238
17k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Code Reviewing Like a Champion
maltzj
524
40k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Site-Speed That Sticks
csswizardry
10
690
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
The Cult of Friendly URLs
andyhume
79
6.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
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