govisi commited on
Commit
f7082fd
1 Parent(s): fa2f35a

add discord code

Browse files
Files changed (2) hide show
  1. app.py +26 -0
  2. requirements.txt +1 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ # import pickle
3
+ import discord
4
+
5
+ intents = discord.Intents.default()
6
+ intents.message_content = True
7
+
8
+ client = discord.Client(intents=intents)
9
+
10
+ # model_pipe = pickle.load(open('pipe.pkl', 'rb'))
11
+
12
+ @client.event
13
+ async def on_ready():
14
+ print(f'We have logged in as {client.user}')
15
+
16
+ @client.event
17
+ async def on_message(message):
18
+ if message.author == client.user:
19
+ return
20
+
21
+ if message.content.startswith('$hello'):
22
+ print(message.content)
23
+ # await message.channel.send(model_pipe.predict([message.content]))
24
+ await message.channel.send('Hello')
25
+
26
+ client.run("MTA3NjU3MDc3MDYzMDc5MTIxOA.GvxRm6.Lm7ZDPwrkmz0AqrUxkxTRXKcObCzswDMfNpCIc")
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ discord="^2.1.0"