Name: SpamProtection-go
Version: v1.0.4
Edit: 13 Jun 2021
By: Intellivoid (C)
SpamProtection-Go is an Official golang wrapper for Intellivoid SpamProtection API, which is fast, secure and requires no additional packages to be installed.
- What is SpamProtection?
- Supported Go versions
- Features
- Getting started
- How to use
- Support and Contributions
- Links
- License
SpamProtection is a community powered solution with the goal to effectively combat spam on Telegram using machine learning and manual spam reporting. This API allows you to lookup a user, chat or channel in the SpamProtection database, this method does not require authentication and there are no rate limits.
For better experience, we recommend you to use latest version of Go (v1.16), but this library requires at least Go version 1.15.
- Uses official Intellivoid API, which makes this library:
- Easy to update
- Guaranteed to match the docs
- No third party endpoints
- Self-documenting (Contains all pre-existing Intellivoid's docs)
- It's in pure go, no need to install any kind of plugin or include any kind of additional files.
- No third party library bloat; only uses standard library.
- Type safe; no weird
interface{}
logic. - Multiple searching for blacklist flags.
You can easily download the library with the standard go get
command:
go get github.com/Intellivoid/Intellivoid.SpamProtection-go
or
dep ensure -add github.com/Intellivoid/Intellivoid.SpamProtection-go
Full documentation of this library, can be found here.
The spamProtection
package contains all helpers you need!
You can lookup a user, channel, group or a bot and recieve it's status with calling only one function. (using either username or user id)
package main
import "github.com/Intellivoid/Intellivoid.SpamProtection-go/spamProtection"
func main() {
// get information of a user, channel or a group with a telegram id (int64)
info, err := spamProtection.GetInfoByID(1234567890)
if err != nil {
log.Fatal(err.Error())
}
// use this method to see if the target is blacklisted or not
if info.IsBlacklisted() {
// use GetType() method to see if the target is a user,
// channel, group or bot?
log.Println("This " + info.GetType() +
" is blacklisted, because of " + info.GetBlacklistReason())
// an example of the output would be:
// This user is blacklisted, because of RAID Initializer / Participator
}
// get information of a user, channel or a group with a telegram username (string)
// you can use also use '@' at the first of username
info2, err := spamProtection.GetInfoByUsername("<username>")
if err != nil {
log.Fatal(err.Error())
}
// Yup! it supports multiple searching
// pass more than one flag and see if the target has one of them or not!
if info2.HasFlag(spamProtection.SpamFlag, spamProtection.ChildAbuseFlag) {
log.Println("this " + info2.GetType() +
" is either a spammer or a child abuser")
log.Println("it has " + info2.GetBlacklistFlag() + " flag!")
// an example of the output would be:
// this user is either a spammer or a child abuser
// it has 0xSPAM flag!
}
// or see if a user is a potential spammer or not
// (based on their last activities)
if info2.IsPotential() {
log.Println("Be careful! this " + info2.GetType() +
" is a potential spammer!")
// an example for the output would be:
// "Be careful! this bot is a potential spammer!"
}
// also make sure you are joined in our official group
if info2.IsVerified() {
log.Println("This " + info2.GetType() +
" is verified by Intellivoid Technologies")
// an example for the output would be:
// This group is verified by Intellivoid Technologies
}
}
Still need more samples? Take a look at our samples directory.
-
If you want to be aware of most recent changes, you can join Intellivoid updates channel.
-
Have a problem with API? Servers are down? Something went wrong? Ensure that you are joined at our Support chat!
-
Having a problem with library? Wanna talk with repository's owner? Contact the Maintainer!
-
Still don't know what's going on? Not sure about how API works? Be sure to read Introduction.
-
Want to read original documentation? Want to see how we receive data from Servers? You can read API documents then!
-
Want to guarantee your group security? Protecting your groups from spammers is in high-priority for you? You can add our official SpamProtection bot with full features of our API!
-
If you think you have found a bug or have a feature request, feel free to use our issue tracker. Before opening a new issue, please search to see if your problem has already been reported or not. Try to be as detailed as possible in your issue reports.
-
If you need help using Intellivoid's APIs or have other questions we suggest you to join our telegram community. Please do not use the GitHub issue tracker for personal support requests.
- Official website
- Coffehouse
- Official channel
- Support chat
- Intellivoid Community
- Discord server
- Maintainer Telegram
- API Introduction
- API documents
- SpamProtection bot
The Intellivoid.SpamProtection-go project is under the GPL-3.0 license. You can find the license file here.