Skip to content

Instantly share code, notes, and snippets.

@10maurycy10
Created August 3, 2022 19:10
Show Gist options
  • Save 10maurycy10/071c91001d38dbf6afee6e146c825e43 to your computer and use it in GitHub Desktop.
Save 10maurycy10/071c91001d38dbf6afee6e146c825e43 to your computer and use it in GitHub Desktop.
Removes the rust gift raid messages.
import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
intents = discord.Intents.default()
intents.messages = True
bot = commands.Bot(command_prefix='?', description="Removes the raids messages", intents=intents)
@bot.command()
async def purge(ctx, limit: int = 100):
"""Purge all messages, with the phising url."""
def check_msg(msg):
if "https://egifpremium.com/" in msg.content:
return True
return False
deleted = await ctx.channel.purge(limit=limit, check=check_msg)
msg = await ctx.send(f'purge {len(deleted)}')
bot.run('[put token here]')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment