Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mishl-dev authored May 29, 2023
1 parent 022f589 commit 971ce81
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
TOKEN = os.environ['DISCORD_TOKEN']
VIRUSTOTAL_API_KEY = os.environ['VIRUSTOTAL_API_KEY']

delete_message = False # Configure this

intents = discord.Intents.all()
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print(f'{bot.user.name} has connected to Discord!')
print(f'{bot.user.name} has connected to Discord!')

async def download_file(url, file_name):
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
Expand All @@ -22,8 +24,8 @@ async def download_file(url, file_name):
chunk = await response.content.read(1024)
if not chunk:
break
file.write(chunk)

file.write(chunk)
async def check_virus(file_path):
with open(file_path, 'rb') as file:
file_bytes = file.read()
Expand All @@ -49,9 +51,8 @@ async def on_message(message):

for attachment in message.attachments:
if attachment.content_type.startswith('image/'):
return

delete_message = False
return

if message.attachments:
for attachment in message.attachments:
file_name = attachment.filename
Expand Down

0 comments on commit 971ce81

Please sign in to comment.