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
420
はじめてのDiscordBot
株式会社ビットキー / Bitkey Inc.
PRO
June 29, 2022
Tweet
Share
More Decks by 株式会社ビットキー / Bitkey Inc.
See All by 株式会社ビットキー / Bitkey Inc.
スタートアップにおける Platform Engineering の 片鱗 / A glimpse of platform engineering in startups
bitkey
PRO
2
110
Node.js のサーバーをなるべく自動生成に頼って Go にリプレイスした話 / A story about replacing a Node.js server with Go, relying on automatic generation as much as possible.
bitkey
PRO
2
92
スマートロック開発におけるSLI/SLOを用いた解錠体験の改善 / Improving the unlocking experience using SLI/SLO in smart lock development
bitkey
PRO
3
190
Bitkeyのモバイルアプリを進化させるための歩き方 / Walking the evolution of Bitkey's mobile apps
bitkey
PRO
1
290
Pointer と向き合う / Facing the Pointer
bitkey
PRO
1
46
Best of こんなTypeScriptは嫌だ! / I don't like this TypeScript
bitkey
PRO
1
69
こんなTypeScriptはいやだ! / I hate this kind of TypeScript!
bitkey
PRO
0
100
DevOpsDays Tokyo 2024 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略 / DevOpsDays Tokyo 2024 - Between Digital and Analog - Automated Testing Strategies to Support Smart Building Development.
bitkey
PRO
0
120
マルチプラットフォームを見据えるiOSのTCA設計|Designing iOS Apps with TCA for Multi-Platform Strategies
bitkey
PRO
2
120
Other Decks in Technology
See All in Technology
ABEMAにおけるLLMを用いたコンテンツベース推薦システム導入と効果検証
cyberagentdevelopers
PRO
1
720
[I/O Extended Android 2024] What`s new in Android 2024
kyeongwan
0
220
AIアシスタントの活用で品質の向上と開発ワークフローのスピードアップ
nagix
1
200
プレイドにおけるDatadog APMの活用方法
plaidtech
PRO
2
120
累計ダウンロード数1億8000万を超えるアプリケーションプラットフォームのレガシーシステム脱却とモダン化への道
kmitsuhashi
0
120
ここがすごいよ! AWS Systems Manager!
saichan11
0
1.8k
AOAI Dev Day LLMシステム開発 Tips集
hirosatogamo
15
3.7k
公共領域から学ぶ クラウド移行についてエンジニアが意識していること
kawakawa2222
0
140
目標設定は好きですか? アジャイルとともに目標と向き合い続ける方法 / Do you like target Management?
kakehashi
10
3k
GoとアクターモデルでES+CQRSを実践! / proto_actor_es_cqrs
ytake
1
150
テストケースの自動生成に生成AIの導入を試みた話と生成AIによる今後の期待
shift_evolve
0
180
簡単に始めるSnowflakeの機械学習
nayuts
1
190
Featured
See All Featured
Infographics Made Easy
chrislema
238
18k
A Modern Web Designer's Workflow
chriscoyier
689
190k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
360
22k
Statistics for Hackers
jakevdp
792
220k
Designing with Data
zakiwarfel
96
5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
26
2.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
229
130k
The Pragmatic Product Professional
lauravandoore
29
6.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
502
140k
Building Flexible Design Systems
yeseniaperezcruz
323
37k
GitHub's CSS Performance
jonrohan
1026
450k
StorybookのUI Testing Handbookを読んだ
zakiyama
15
4.9k
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