seawolf2357 commited on
Commit
78efe79
ยท
verified ยท
1 Parent(s): 26dafea

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import discord
2
+
3
+ class MyClient(discord.Client):
4
+ async def on_ready(self):
5
+ print(f'Logged on as {self.user}!')
6
+
7
+ async def on_message(self, message):
8
+ # ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ธ ์‚ฌ๋žŒ์ด ๋ด‡ ์ž์‹ ์ด๋ฉด ๋ฐ˜์‘ํ•˜์ง€ ์•Š์Œ
9
+ if message.author == self.user:
10
+ return
11
+
12
+ # ์ž…๋ ฅ๋ฐ›์€ ํ…์ŠคํŠธ์— "hello"๋ฅผ ๋”ํ•ด์„œ ์‘๋‹ต
13
+ response = message.content + " hello"
14
+ await message.channel.send(response)
15
+
16
+ # ๋ด‡ ๊ฐ์ฒด ์ƒ์„ฑ ๋ฐ ์‹คํ–‰
17
+ client = MyClient()
18
+ client.run('your_token_here') # ์—ฌ๊ธฐ์— ์•ˆ์ „ํ•˜๊ฒŒ ํ† ํฐ์„ ์ €์žฅํ•˜์„ธ์š”.