Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 536 Bytes

README.md

File metadata and controls

21 lines (16 loc) · 536 Bytes

[C#] Discord AutoReg Bots BAN

Simple function to check if user is AutoReg

First Hook an Event

_client.UserJoined += functionname;

Then Create a function

private async Task functionname(SocketGuildUser user){
    if (user.CreatedAt <= DateTime.Now.AddHours(-12))
            {
                await user.BanAsync(0, "AutoBan");
            }
}

If you want to change Time difference just change AddHours(-12) to AddDays(-1) and it will ban every new joined person that account was created 1 day ago.