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
Discord Bot はじめの一歩
Search
ASKUL Engineer
March 30, 2021
Technology
0
690
Discord Bot はじめの一歩
20210325 AStudy+
https://askul.connpass.com/event/204742/
speaker:みわすけ
ASKUL Engineer
March 30, 2021
Tweet
Share
More Decks by ASKUL Engineer
See All by ASKUL Engineer
EditorConfigで導くコードの「美しさ」
askul
0
640
いまさら聞けないAWS
askul
0
6.3k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
200
チームでリーダブルコードを実現するには?
askul
0
3.2k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
840
10分で「エラスティックリーダーシップ」をアウトプット
askul
0
3.7k
1on1をする上で大切なこと
askul
1
850
JBUG東京#20 〜そこが知りたい!Backlog活用術〜
askul
1
3.4k
GCPを活用した物流倉庫内の異常検知/Anomaly detection in distribution warehouse using GCP
askul
0
3.5k
Other Decks in Technology
See All in Technology
dbt meetup #19 『dbtを『なんとなく動かす』を卒業します』
tiltmax3
0
110
AWS Bedrock Guardrails / 機密情報の入力・出力をブロックする — Blocking Sensitive Information Input/Output
kazuhitonakayama
2
180
Intro SAGA Event Space
midnight480
0
160
俺の失敗を乗り越えろ!メーカーの開発現場での失敗談と乗り越え方 ~ゆるゆるチームリーダー編~
spiddle
0
340
Amazon Bedrock AgentCoreでブラウザ拡張型AI調査エージェントを開発した話 (シングルエージェント編)
nasuvitz
2
120
社内ワークショップで終わらせない 業務改善AIエージェント開発
lycorptech_jp
PRO
1
380
EMから現場に戻って見えた2026年の開発者視点
sudoakiy
1
490
Agent Ready になるためにデータ基盤チームが今年やること / How We're Making Our Data Platform Agent-Ready
zaimy
0
170
WBCの解説は生成AIにやらせよう - 生成AIで野球解説者AI Agentを実現する / Baseball Commentator AI Agent for Gemini
shinyorke
PRO
0
130
Kubernetes環境周りの責任範囲をいい機会なので考える / Taking the Opportunity to Clarify Kubernetes Responsibilities
kohbis
1
110
AI活用を"目的"にしたら、データの本質が見えてきた - Snowflake Intelligence実験記 / chasing-ai-finding-data
pei0804
0
670
Agent Payments Protocolで実装するAIエージェント間取引
tokio007
0
170
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
180
Code Reviewing Like a Champion
maltzj
527
40k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
The agentic SEO stack - context over prompts
schlessera
0
670
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
140
Building the Perfect Custom Keyboard
takai
2
700
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
450
Into the Great Unknown - MozCon
thekraken
40
2.3k
Rails Girls Zürich Keynote
gr2m
96
14k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Transcript
DiscordBot はじめの⼀歩 アスクル株式会社 三輪亮介
⾃⼰紹介 • ⾃分について⾊々わかっていないためサイズ違いの靴や服が 余っている • 社会⼈になって太った • 業務では、AWSの構築などインフラ関連のことを⾏なっている 1
⽬次 1. Discordの紹介 2. やってみる 3. Botの例 2
Discordって︖ • ビデオ、⾳声通話ソフト • 1つのサーバーに複数の通話部屋、チャット部屋を作ることが できる 3
4
DiscordのBotって︖ • ユーザーの⼊⼒に⾃動応答させられる • ユーザーができることはだいたいできる • 複数⾔語対応 (https://discordpy.readthedocs.io/ja/latest/api.html) 5
6 やってみる
サンプル import discord import os import setToken # 環境変数を使うべき。今回は外部ファイルを参照 #
token = os.environ['DISCORD_TOKEN’] TOKEN = setToken.tokenclient = discord.Client()# 起動時 @client.event async def on_ready(): print("AStudy discordBot")# チャットイベント @client.event async def on_message(message): # メッセージ送信者がBotだった場合は無視する if message.author.bot: return # /test に対してhelloを返答 if message.content == '/test': await message.channel.send('hello')# bot起動 client.run(TOKEN) 7