-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (22 loc) · 849 Bytes
/
main.py
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
import discord
from os import environ
from dotenv import load_dotenv
from imagereader import *
from messages import *
class MyClient(discord.Client):
async def on_ready(self):
print(f'Logged on as {self.user}!')
async def on_message(self, message):
if not message.author.bot:
# checking message content
if len(message.attachments) > 0:
image_statement = read_image_text(message.attachments[0].url)
if not image_statement == "Nothing":
messages_agenda_dict = get_messages_agenda_dict()
await message.reply(messages_agenda_dict[image_statement]["reply_message"])
intents = discord.Intents.default()
intents.message_content = True
client = MyClient(intents=intents)
load_dotenv()
token = environ["TOKEN"]
client.run(token)