govisi commited on
Commit
d5ed24c
1 Parent(s): 3ec1d01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -7,8 +7,7 @@ from threading import Thread
7
 
8
 
9
  load_dotenv()
10
- bot = commands.Bot("", intents=discord.Intents(messages=True))
11
-
12
 
13
  # model_pipe = pickle.load(open('pipe.pkl', 'rb'))
14
 
@@ -17,17 +16,17 @@ async def on_ready():
17
  print(f'We have logged in as {bot.user}')
18
 
19
  @bot.event
20
- async def on_message(message: discord.Message):
21
- # if message.author == bot.user:
22
- # return
23
 
24
- if message.content and message.content.startswith('$hello'):
25
- # print(message.content)
26
  # await message.channel.send(model_pipe.predict([message.content]))
27
  await message.channel.send('Hello from hugging face')
28
 
29
  bot.env = "prod" # type: ignore
30
- bot.name = "Anipins" # type: ignore
31
 
32
  t = Thread(target=bot.run, daemon=True, args=(os.getenv("discord_token"), ))
33
  t.start()
 
7
 
8
 
9
  load_dotenv()
10
+ bot = commands.Bot("", intents=discord.Intents(messages=True, guilds=True))
 
11
 
12
  # model_pipe = pickle.load(open('pipe.pkl', 'rb'))
13
 
 
16
  print(f'We have logged in as {bot.user}')
17
 
18
  @bot.event
19
+ async def on_message(message):
20
+ if message.author == bot.user:
21
+ return
22
 
23
+ if message.content.startswith('$hello'):
24
+ print(message.content)
25
  # await message.channel.send(model_pipe.predict([message.content]))
26
  await message.channel.send('Hello from hugging face')
27
 
28
  bot.env = "prod" # type: ignore
29
+ bot.name = "testAniPin" # type: ignore
30
 
31
  t = Thread(target=bot.run, daemon=True, args=(os.getenv("discord_token"), ))
32
  t.start()