File size: 898 Bytes
9a5ae39
 
 
 
f80d9e5
9a5ae39
f7082fd
 
f80d9e5
a509010
f7082fd
9a5ae39
 
 
 
 
 
d5a5e2a
 
d5ed24c
 
9a5ae39
e6f6ea0
d5ed24c
9a5ae39
 
d5a5e2a
9a5ae39
80c55a7
d5ed24c
80c55a7
5bf88a3
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os, asyncio
# import pickle
import discord
from discord.ext import commands
from dotenv import load_dotenv
from threading import Thread


load_dotenv()
bot = commands.Bot("", intents=discord.Intents.all())

# model_pipe = pickle.load(open('pipe.pkl', 'rb'))

@bot.event
async def on_ready():
    print(f'We have logged in as {bot.user}')

@bot.listen('on_message')
async def on_message_event(message):
    if message.author == bot.user:
        return   

    if message.content:
        print(message.content)
        # await message.channel.send(model_pipe.predict([message.content]))
        await message.channel.send('Hello from hugging face')
    # await bot.process_commands(message)

bot.env = "prod"  # type: ignore
bot.name = "testAniPin"  # type: ignore

t = Thread(target=bot.run, daemon=True, args=(os.getenv("discord_token"), ))
# bot.run(os.getenv("discord_token"))
t.start()