BanAPI Module V1 - abandoned

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

Consider adding a single ban function that will check the first argument type, check if it’s an instance, number or a table and continue ur logic there. It would make the module way easier to use, but I still don’t see a reason in simplifying default roblox api, as it’s already simple enough. You can also add type definition, since roblox default api doesn’t have it for some reason.

I think the thing people fail to realize here, is that using the Ban API isn’t all black and white.

For example, I work on a game called R6 Dances for my friend. Because they own the Experience, there is no way to transfer games to a group without paying a massive fee, and putting up with animation migration. In order for me to figure out the ban history of the game, including the users in said history, I would need to own the game which isn’t possible (obviously). This makes accessing ban information incredibly annoying if the Experience isn’t a group game, because Roblox doesn’t offer that permission to Team Create members of a “Shared with Me” experience. (Even though they offer it with groups. Incredibly dumb if you ask me)

The way the original poster can improve this resource is adding the ability to bring up a UI showing a list of banned users in the API, including the information pertaining to their bans. This could be placed in a dedicated UI that also lets you ban/unban users.

I’m a bit surprised none of these ideas were pitched, but I also shouldn’t be surprised given how bad feedback can be in this category sometimes. If there is a will, there is a way, and trust me, this could be improved into something that does actually save time. I’d probably use it :+1:

1 Like

People tried to give feedback, but a huge degree of incompetency was displayed. The module provided 3 separate functions where only 1 was needed. The other thing to realize here is, that this module doesn’t serve a purpose, it doesn’t make the Ban API easier or more reliable for anybody. These are the reasons people think this module shouldn’t have been published or needs to exist.

2 Likes

Shutting someone down who is likely new to creating resources isn’t fair though, and proper constructive criticism should be given so they can improve. It’s difficult to do so when you’re met with constant negativity. I think I’m going to stick with my opinion, and that this can be made better.

You don’t have to agree, neither does anyone else, but how else are we to avoid said mistakes? I’ll never understand the psychology around shutting people down to make them improve. It doesn’t help.

While there is merit to the point that telling people to not redistribute on a post that’s open source is bad, and that some spots look like it’s an API wrapper, the original posters intentions were to provide a resource. From what I’ve read, they only responded with such attitude, even through negativity.

I think at least everyone deserves a chance to create and try to improve others workflow, and if that doesn’t work out how they thought, there is people here to help build them up, rather than break them down.

2 Likes