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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ASKUL Engineer
March 30, 2021
Technology
730
0
Share
Discord Bot はじめの一歩
20210325 AStudy+
https://askul.connpass.com/event/204742/
speaker:みわすけ
ASKUL Engineer
March 30, 2021
More Decks by ASKUL Engineer
See All by ASKUL Engineer
EditorConfigで導くコードの「美しさ」
askul
0
670
いまさら聞けないAWS
askul
0
6.5k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
210
チームでリーダブルコードを実現するには?
askul
0
3.3k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
870
10分で「エラスティックリーダーシップ」をアウトプット
askul
1
3.9k
1on1をする上で大切なこと
askul
1
890
JBUG東京#20 〜そこが知りたい!Backlog活用術〜
askul
1
3.5k
GCPを活用した物流倉庫内の異常検知/Anomaly detection in distribution warehouse using GCP
askul
0
3.6k
Other Decks in Technology
See All in Technology
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
イベントストーミングとKiroの仕様駆動開発で実現する要件の認識合わせプロセス
syobochim
7
970
Unlocking the Apps
pimterry
0
120
Agentic AI時代における メルカリのAIガバナンスとガードレール実装
naoichihara
16
17k
AI時代から振り返るTerraform drift運用の歴史 / AI Age Reflections on the History of Terraform Drift Operations
aeonpeople
0
600
海外カンファレンス「JavaOne」参加レポート ユーザー系IT企業における目的・成果/JavaOne Report Purpose and Results in the User IT Company
muit
0
120
oracle-to-databricks-migration-with-llm-and-dbt
casek
1
380
NFLコンペ2026 解法
lycorptech_jp
PRO
0
130
layerx-fde-practices
cipepser
6
2.9k
TypeScript Compiler APIとPHP-Parserを活用し、TypeScriptとPHPで型を共有する
shuta13
0
230
AI Adaptable なテストを整える工夫 / Ways to Make Your Tests AI-Adaptable
bitkey
PRO
2
180
組織の中で自分を経営する技術
shoota
0
230
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
The SEO identity crisis: Don't let AI make you average
varn
0
480
Color Theory Basics | Prateek | Gurzu
gurzu
0
320
Crafting Experiences
bethany
1
160
Art, The Web, and Tiny UX
lynnandtonic
304
21k
The World Runs on Bad Software
bkeepers
PRO
72
12k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
390
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
210
The Spectacular Lies of Maps
axbom
PRO
1
770
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
160
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