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
750
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
組織における AI-DLC 実践
askul
0
390
EditorConfigで導くコードの「美しさ」
askul
0
680
いまさら聞けないAWS
askul
0
6.6k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
220
チームでリーダブルコードを実現するには?
askul
0
3.4k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
880
10分で「エラスティックリーダーシップ」をアウトプット
askul
1
4k
1on1をする上で大切なこと
askul
1
910
JBUG東京#20 〜そこが知りたい!Backlog活用術〜
askul
1
3.6k
Other Decks in Technology
See All in Technology
AI エージェント時代のデジタルアイデンティティ
fujie
3
1.4k
AIエージェントを前提としたプラットフォーム エンジニアリング:GKEで作るAgent-Ready Golden Path
legalontechnologies
PRO
1
150
SmartHR Engineering Team Deck
smarthr
0
190
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
8
7.6k
[MIRU26] Open-Vocabulary Intention-Guided Object Detection in Diverse Scenes
keio_smilab
PRO
0
140
サイバー捜査員研修(後半)
nomizone
1
590
Breaking the Seal: Static Deobfuscation of Compiled V8 JavaScript Bytecode Malware
hshrzd
0
450
【CEDEC2026】『GRANBLUE FANTASY: Relink - Endless Ragnarok』のバトル制作事例 ~最高のキャラゲーを目指して~
cygames
PRO
0
190
PLaMoを毎日の開発で使い育てていく
pfn
PRO
0
180
Redmine 7.0 新機能・機能強化解説(OSC2026京都ダイジェスト版)
vividtone
1
190
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
PLaMo 3.0 Primeの構造化出力サポート
pfn
PRO
0
180
Featured
See All Featured
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
650
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
WENDY [Excerpt]
tessaabrams
11
39k
How to train your dragon (web standard)
notwaldorf
97
6.7k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
GraphQLとの向き合い方2022年版
quramy
50
15k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
240
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
420
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
440
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
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