Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
21 |
-
|
22 |
-
|
23 |
|
24 |
-
if message.content
|
25 |
-
|
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 = "
|
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()
|