File size: 632 Bytes
78efe79
 
08baccf
 
 
78efe79
08baccf
 
 
78efe79
 
 
 
 
 
 
 
 
 
08baccf
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import discord

intents = discord.Intents.default()  # ๊ธฐ๋ณธ intents ํ™œ์„ฑํ™”
intents.messages = True  # ๋ฉ”์‹œ์ง€ ์ฝ๊ธฐ์— ๋Œ€ํ•œ intents ํ™œ์„ฑํ™”

class MyClient(discord.Client):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    async def on_ready(self):
        print(f'Logged on as {self.user}!')

    async def on_message(self, message):
        if message.author == self.user:
            return
        response = message.content + " hello"
        await message.channel.send(response)

# ๋ด‡ ๊ฐ์ฒด ์ƒ์„ฑ ๋ฐ ์‹คํ–‰
client = MyClient(intents=intents)
client.run('your_token_here')