seawolf2357 commited on
Commit
daa6be8
โ€ข
1 Parent(s): 7e1500a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -38,10 +38,23 @@ class MyClient(discord.Client):
38
  self.is_processing = False
39
  self.session = None
40
 
 
 
41
  async def on_ready(self):
42
  logging.info(f'{self.user}๋กœ ๋กœ๊ทธ์ธ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!')
 
 
 
 
 
 
43
  self.session = aiohttp.ClientSession()
44
 
 
 
 
 
 
45
  async def on_message(self, message):
46
  if message.author == self.user or not self.is_message_in_specific_channel(message):
47
  return
 
38
  self.is_processing = False
39
  self.session = None
40
 
41
+
42
+
43
  async def on_ready(self):
44
  logging.info(f'{self.user}๋กœ ๋กœ๊ทธ์ธ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!')
45
+
46
+ # web.py ํŒŒ์ผ ์‹คํ–‰
47
+ subprocess.Popen(["python", "web.py"])
48
+ logging.info("Web.py ์„œ๋ฒ„๊ฐ€ ์‹œ์ž‘๋˜์—ˆ์Šต๋‹ˆ๋‹ค.")
49
+
50
+ # aiohttp ํด๋ผ์ด์–ธํŠธ ์„ธ์…˜ ์ƒ์„ฑ
51
  self.session = aiohttp.ClientSession()
52
 
53
+ # ๋ด‡์ด ์‹œ์ž‘๋  ๋•Œ ์•ˆ๋‚ด ๋ฉ”์‹œ์ง€๋ฅผ ์ „์†ก
54
+ channel = self.get_channel(SPECIFIC_CHANNEL_ID)
55
+ if channel:
56
+ await channel.send("์œ ํŠœ๋ธŒ ๋น„๋””์˜ค URL์„ ์ž…๋ ฅํ•˜๋ฉด, ์ž๋ง‰๊ณผ ๋Œ“๊ธ€์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋‹ต๊ธ€์„ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.")
57
+
58
  async def on_message(self, message):
59
  if message.author == self.user or not self.is_message_in_specific_channel(message):
60
  return