Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PirxcyFinal/DiscordFilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

DiscordFilter

Use This To Detect Filtered words on discord (nitro scams etc)

Downloads Downloads Downloads Requires: Python 3.x Version: 0.0.2

Setup:

pip3 install DiscordFilter

import DiscordFilter
import asyncio
import discord

from discord.ext import commands


filter = DiscordFilter.filter(blacklist_file="blacklist.json")
bot = commands.Bot(command_prefix="!")

async def update_blacklist():
  while True:
    update = await filter.update_blacklist()
    if update == True:#If a new update was recieved.
      print(f"Updated {filter.blacklist_file}")
    await asyncio.sleep(300)#Wait 5min Then check for update again.

@bot.event
async def event_ready():
  bot.loop.create_task(update_blacklist())#Set a background task to check for updates every 5min.

@bot.event
async def on_message(message):
  if filter.is_filtered(message) == True: #if the message is filtered
    await message.delete()#deletes the filtered message

@bot.command()
async def hello(ctx):
  await ctx.reply("Hello!")

bot.run('token')

About

Use this to find filtered keywords with discord.py

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages