BanAPI Module V1 - abandoned

Hey there, I just created an new module that makes the use of the new BanAPI easier. Examples are included in the Script inside the Module, also an Instruction. If you use it read the notes inside the module, I am not liable for anything you do with this module.

You can:

  • Ban UserId/s
  • Unban UserId/s
  • Get the Ban History of an UserId

You can find the module under here.

If you need any help, message me.
have a nice day :slight_smile:

  • janis

EDIT: this project is abandoned since people think its completly useless

3 Likes

You don’t really provide enough benefit to justify getting this module. I may as well just use the ban api. After all, I don’t see myself writing this a lot.

If this was something like tweens which you do use a lot, maybe I can see a use.

But otherwise, all you change is that you don’t have to put the arguments in a table, or the arguments in at all.


Also, a lot of the time it’s enough to just open the built-in ban panel on the creator hub anyways.


Best regards,
Pinker

Just from a quick look on my part, this doesn’t seem like something that would even make using the BanAsync/Ban API easier. The code is fairly sloppy and the documentation/notes are riddled with grammar issues and is unprofessional. In addition, directly on this sentence:

“DO NOT REPUBLISH, IF YOU DO OTHERWISE, WE WILL FILE A PROPERTY CLAIM.”.

You did release a module as open source, it’s bound to get edited and republished, there’s no way they can make it any worse regardless.

5 Likes

There isn’t any reason for this module to have that many functions, what’s wrong with make a single proper function for banning via userid, player instance or a table? Even if you ignore all the mistakes and bad code practices in this module, it’s fully useless.

2 Likes

Hey there,
thanks for replying.

My goal with this was to make the new BanAPI usable from scripts, not from the dashboard.

Sincerely,
janis

Yea sorry, my bad. ill remove it.

Give ue one reason to use this over the original BanAPI

I’ll look into it and fix it, sorry.

The Module uses the original BanAPI… Maybe you should look into the code.

But you can already do that, like you did in your module.
I don’t understand?

Plus, that’s not the only thing I wrote.


Best regards,
Pinker

The code:

Non-binding license

– [[ made by janis <@the_h0lysandwich> ]] –


–[[
hey there, thanks for using my ban module using the new BanAPI from Roblox.
PLEASE READ THE FOLLOWING NOTES, THEY ARE MOSTLY RULES. I’M NOT LIABLE FOR ANYTHING YOU DO WITH THIS MODULE.
NOTE: According to the new BanAPI’s TOS, you have to list the rules of YOUR experience somewhere accessible for the Players.
NOTE 2: The Reason/etc has to follow Roblox’s TOS, I’m not liable for anything you do with this Module.
BanAPI Forum Note: You can determine the reason and duration of the ban, as long as it follows Roblox Community Standards and Terms of Use.
BanAPI Forum Note 2: You will now be allowed to establish your own Experience Rules, and moderate your own experiences according to those rules,
as long as those rules abide by the Roblox TOS and Community Standarts, as well as the Ban API Guidance that applies to the use of Ban API.
Roblox may take action against creators who violate the Roblox Terms of Use in their application of the Ban API.
Instruction is in the Script called “Instruction” inside the Module.
BanAPI Forum: Introducing the Ban API and Alt Account Detection
also, DO NOT REPUBLISH, IF YOU DO OTHERWISE, WE WILL FILE A PROPERTY CLAIM.
]]

local run = game:GetService("RunService")
local plrs = game:GetService("Players")
local defaults = {
	Duration = 0,
	DisplayReason = "An Moderator has banned you.",
	PrivateReason = "Moderator Note",
	ApplyToUniverse = true,
	ExcludeAltAccounts = false,
}
local ban = {}
ban.BanSinglePlayer = function(player:Player, duration:string, reason:string, privateReason:string, applyToUniverse:boolean, excludeAltAccounts:boolean)
	if run:IsClient() then return end
	if player.Parent == not plrs then return end
	
	local data:BanConfigType = {
		UserIds = {player.UserId},
		ApplyToUniverse = applyToUniverse or defaults.ApplyToUniverse,
		Duration = duration or defaults.Duration,
		DisplayReason = reason or defaults.DisplayReason,
		PrivateReason = privateReason or defaults.PrivateReason,
		ExcludeAltAccounts = excludeAltAccounts or defaults.ExcludeAltAccounts,
	}
	
	local success, result = pcall(function()
		plrs:BanAsync(data)
	end)
	
	return success, result
end
ban.BanUserId = function(userId_s:number, duration:string, reason:string, privateReason:string, applyToUniverse:boolean, excludeAltAccounts:boolean)
	if run:IsClient() then return end
	local data:BanConfigType = {
		UserIds = userId_s,
		ApplyToUniverse = applyToUniverse or defaults.ApplyToUniverse,
		Duration = duration or defaults.Duration,
		DisplayReason = reason or defaults.DisplayReason,
		PrivateReason = privateReason or defaults.PrivateReason,
		ExcludeAltAccounts = excludeAltAccounts or defaults.ExcludeAltAccounts,
	}
	local success, result = pcall(function()
		plrs:BanAsync(data)
	end)
	return success, result
end
ban.BanMultiplePlayers = function(playerList, duration:string, reason:string, privateReason:string, applyToUniverse:boolean, excludeAltAccounts:boolean)
	if run:IsClient() then return end
	
	local array = {}
	
	for _, player in playerList do
		if player.Parent == plrs then
			table.insert(array, player.UserId)
		else
			return
		end
	end
	local data:BanConfigType = {
		UserIds = array,
		ApplyToUniverse = applyToUniverse or defaults.ApplyToUniverse,
		Duration = duration or defaults.Duration,
		DisplayReason = reason or defaults.DisplayReason,
		PrivateReason = privateReason or defaults.PrivateReason,
		ExcludeAltAccounts = excludeAltAccounts or defaults.ExcludeAltAccounts,
	}
	local success, result = pcall(function()
		plrs:BanAsync(data)
	end)
	
	return success, result
end
ban.Unban = function(userId_s:number, applyToUniverse:boolean)
	if run:IsClient() then return end
	local data:UnbanConfigType = {
		UserIds = {userId_s},
		ApplyToUniverse = applyToUniverse or defaults.ApplyToUniverse,
	}
	local success, result = pcall(function()
		plrs:UnbanAsync(data)
	end)
	
	return success, result
end
ban.GetBanHistory = function(userId:number)
	if run:IsClient() then return end
	
	pcall(function()
		return plrs:GetBanHistoryAsync(userId)
	end)
end
return ban

This is just a wrapper for the Ban API, and doesn’t add any extra functionality. I wouldn’t consider it easier to use than the Ban API itself!

2 Likes

Ok this is really unnecessary and just overcomplicates things

Why not just use the built in BanAPI instead of needing to install a third party module that supposedly “makes it easier”

1 Like

“But otherwise, all you change is that you don’t have to put the arguments in a table, or the arguments in at all.”

what do you mean by that?
it should just skip the step and make the use of ban api easier for scripter beginners.
also sorry if my grammar is bad english isnt my best language.

Tell me how i could improve it.

some people are too dumb to use the new banapi
and i was bored

I did not include a way to improve it in my response because there simply is no way to. The built-in Ban API is already documented, and is easy to use. If somebody is too dumb to use it, they simply don’t know how to code yet, and wouldn’t be able to use your resource either. Sorry!

1 Like

What???

Alright. Thanks for your opinion!

You’re just making the functions of the BanAPI again. There’s no need for that.


Bruh.

What he said.


Best regards,
Pinker

do you think that i should delete this
EDIT: ill just leave it