-
Notifications
You must be signed in to change notification settings - Fork 0
/
discord_spam.py
35 lines (28 loc) · 863 Bytes
/
discord_spam.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
32
33
34
35
import discord
from discord.ext import commands
import os
import asyncio
import spam
from dotenv import load_dotenv
load_dotenv()
intents = discord.Intents.all()
intents.messages = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f'We have logged in as {client.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
await asyncio.sleep(1)
# to check if the bot is working
# output in cmd window
print(message)
print("------------------------------------")
print(message.content)
print("------------------------------------")
if message.content!="":
if spam.check_spam(message.content) == 'spam':
await message.reply("Your message is considered spam.")
client.run(os.getenv('SECOND_BOT_TOKEN'))