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
470
はじめてのDiscordBot
株式会社ビットキー / Bitkey Inc.
PRO
June 29, 2022
Tweet
Share
More Decks by 株式会社ビットキー / Bitkey Inc.
See All by 株式会社ビットキー / Bitkey Inc.
ハードウェアとソフトウェアをつなぐ全てを内製している企業の E2E テストの作り方 / How to create E2E tests for a company that builds everything connecting hardware and software in-house
bitkey
PRO
1
68
チームビルドのためのワークショップ設計/Workshop design for team building
bitkey
PRO
0
50
「職種に名前が付く、ということ」 / When a Role Gets a Name
bitkey
PRO
0
25
ゼロから始めるEnabling SRE〜Datadogへの戸惑いや敬遠を無くすためにやったこと〜
bitkey
PRO
0
18
「書く」より「任せる」! 生成AIでローコード自動テストの属人化を防ぐ! / Delegate, Don't Write! Preventing Silos in Low-Code Auto-Testing with Gen AI
bitkey
PRO
0
63
オフィスビルを監視しよう:フィジカル×デジタルにまたがるSLI/SLO設計と運用の難しさ / Monitoring Office Buildings: The Challenge of Physical-Digital SLI/SLO Design & Operation
bitkey
PRO
3
570
事例で学ぶ!B2B SaaSにおけるSREの実践例/SRE for B2B SaaS: A Real-World Case Study
bitkey
PRO
1
570
整頓のジレンマとの戦い〜Tidy First?で振り返る事業とキャリアの歩み〜/Fighting the tidiness dilemma〜Business and Career Milestones Reflected on in Tidy First?〜
bitkey
PRO
3
23k
遠隔で同時に4人教育!? 〜リモート新人の「孤立」を防ぐオンボーディング事例〜/Educating 4 people at the same time remotely!〜Onboarding Case Studies to Prevent “Isolation” of Remote Newcomers〜
bitkey
PRO
0
89
Other Decks in Technology
See All in Technology
AWSで推進するデータマネジメント
kawanago
1
1.2k
2025年にHCP Vaultを学び直して見えた景色 / Lessons and New Perspectives from Relearning HCP Vault in 2025
aeonpeople
0
210
Vault を基盤として整備し、 みんなに使ってもらえるようになるまで
takahiko
1
110
スマートファクトリーの第一歩 〜AWSマネージドサービスで 実現する予知保全と生成AI活用まで
ganota
1
140
Kubernetes における cgroup v2 でのOut-Of-Memory 問題の解決
pfn
PRO
0
460
Nstockの一人目エンジニアが 3年間かけて向き合ってきた セキュリティのこととこれから〜あれから半年〜
yo41sawada
0
210
データアナリストからアナリティクスエンジニアになった話
hiyokko_data
2
430
なぜスクラムはこうなったのか?歴史が教えてくれたこと/Shall we explore the roots of Scrum
sanogemaru
5
1.4k
Kiroと学ぶコンテキストエンジニアリング
oikon48
6
9.3k
「魔法少女まどか☆マギカ Magia Exedra」の必殺技演出を徹底解剖! -キャラクターの魅力を最大限にファンに届けるためのこだわり-
gree_tech
PRO
0
590
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
8.7k
La gouvernance territoriale des données grâce à la plateforme Terreze
bluehats
0
120
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Optimizing for Happiness
mojombo
379
70k
The Invisible Side of Design
smashingmag
301
51k
Automating Front-end Workflow
addyosmani
1370
200k
Designing Experiences People Love
moore
142
24k
The Pragmatic Product Professional
lauravandoore
36
6.9k
The Cult of Friendly URLs
andyhume
79
6.6k
BBQ
matthewcrist
89
9.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
187
54k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
840
GraphQLとの向き合い方2022年版
quramy
49
14k
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