SpamProtection-Go is an Official golang wrapper for Intellivoid SpamProtection API

Overview

SpamProtection-go

Name: SpamProtection-go
Version: v1.0.4
Edit: 13 Jun 2021
By: Intellivoid (C)


Go Reference

SpamProtection-Go is an Official golang wrapper for Intellivoid SpamProtection API, which is fast, secure and requires no additional packages to be installed.

Preview:


What is SpamProtection?

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.


Supported Go versions

For better experience, we recommend you to use latest version of Go (v1.16), but this library requires at least Go version 1.15.


Features

  • 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.

Getting started

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.


How to use

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)

") 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 } } ">
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("")
	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.


Support and Contributions

  • 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.


Links


License

The Intellivoid.SpamProtection-go project is under the GPL-3.0 license. You can find the license file here.

Issues
  • Added new methods and support for different formats of username

    Added new methods and support for different formats of username

    What I've added in these commits:

    • get methods (such as GetBlacklistFlag, GetBlacklistReason, etc...)
    • Flags.md file
    • support of different format of a username such as "t.me/falling_inside_the_black" .

    What I've moved?

    • moved tests functions to the specific files.

    What I've changed?

    • name of functions in helpers.go
    opened by ALiwoto 0
  • Improved README file

    Improved README file

    What I've added in these commits:

    • didn't add any new file

    What I've moved?

    • nothing

    What I've changed?

    • changed and improved readme file
    • changed and corrected some mistakes in comments
    opened by ALiwoto 0
  • fixed problems in json decoding and added comments

    fixed problems in json decoding and added comments

    What I've added in these commits:

    • I've added commits which are explanation from official intellivoid docs and some of them are its founder words.
    • added constants.go file, which contains the endpoint of the API.

    What I've moved?

    • nothing specially.

    What I've changed?

    • I've changed the name of request.go file to helpers.go file, since it contains the helper functions for sending the HTTP requests and parsing them into structs.
    • I've changed the package name from SpamProtection to spamProtection (which begins with lower-case letters)
    • I've changed the non-builtin variables in structures to pointer variable of them.
    • some of the fields used in our structures, were array, which wasn't according to the json data recieved from servers, so I changed them to fix the problem.

    Signed-off-by: Aliwoto [email protected]

    opened by ALiwoto 0
Releases(v1.0.4)
Owner
Intellivoid
Software and services developed by student developer(s) for consumers and businesses.
Intellivoid
Unofficial SDK of official notion API in Go

notion-go A go client for the Notion API Description This aims to be an unofficial Go version of the official SDK which is written in JavaScript. Inst

Pei-Ming Wu 8 Aug 20, 2021
Go client for official Notion API.

notion notion is a Go client for the Notion API. Features The client supports all (non-deprecated) endpoints available in the Notion API, as of May 15

Krzysztof Kowalczyk 19 Dec 5, 2021
A GoLang wrapper for Politics & War's API. Forego the hassle of accessing the API directly!

A GoLang wrapper for Politics & War's API. Forego the hassle of accessing the API directly!

null 1 Mar 5, 2022
The NVD API is an unofficial Go wrapper around the NVD API.

NVD API The NVD API is an unofficial Go wrapper around the NVD API. Supports: CVE CPE How to use The following shows how to basically use the wrapper

Lucas TESSON 3 May 9, 2022
A Wrapper Client for Google Spreadsheet API (Sheets API)

Senmai A Wrapper Client for Google Spreadsheet API (Sheets API) PREPARATION Service Account and Key File Create a service account on Google Cloud Plat

ytnobody / satoshi azuma 0 Nov 5, 2021
Amplitude unofficial client for Go, inspired in their official SDK for Node

Amplitude Golang SDK Amplitude unofficial client for Go, inspired in their official SDK for Node. For reference, visit HTTP API v2 documentation. Inst

Renato Almeida 5 Apr 23, 2022
WeChat Official Account's Verification using Revel

Welcome to Revel A high-productivity web framework for the Go language. Start the web server: revel run myapp Go to http://localhost:9000/ and you'll

Tri R.A. Wibowo 0 Dec 25, 2021
Simple golang airtable API wrapper

Golang Airtable API A simple #golang package to access the Airtable API. Table of contents Golang Airtable API Table of contents Installation Basic us

mehanizm 37 Mar 21, 2022
This is a Golang wrapper for working with TMDb API. It aims to support version 3.

This is a Golang wrapper for working with TMDb API. It aims to support version 3. An API Key is required. To register for one, head over to themoviedb

Cyro Dubeux 52 May 18, 2022
⚡️ SharePoint authentication, HTTP client & fluent API wrapper for Go (Golang)

Gosip - SharePoint authentication, HTTP client & fluent API wrapper for Go (Golang) Main features Unattended authentication using different strategies

Andrew Koltyakov 73 May 10, 2022
A small, fast, reliable pastemyst API wrapper written in Golang

A small, fast, reliable pastemyst API wrapper written in Golang. Official pastemyst API docs found here.

null 11 Nov 18, 2021
Unofficial Anilist.co GraphQL API wrapper for GoLang.

anilistWrapGo Unofficial Anilist.co GraphQL API wrapper for GoLang. Examples All examples are present as tests in test directory. Below are a few snip

ダンクデル (Sayan Biswas) 14 Feb 17, 2022
Pterodactyl API wrapper written in Golang

WARNING That repository isn't available for production environment. Many endpoints aren't yet implemented. Be careful if you are using that module. pt

Luiz Otávio de Farias Correa 3 Mar 28, 2022
A Wrapper of the Piston API in Golang

Go-Piston! This is a Go wrapper for working with the Piston API. It supports both the endpoints, namely runtimes and execute, mentioned here. ?? Insta

null 7 Feb 20, 2022
Golang wrapper for the FiveM natives API

Golang wrapper for the FiveM natives API

normalM 3 Nov 20, 2021
Golang API wrapper of OkEX

A complete golang wrapper for Okex V5 API. Pretty simple and easy to use. For more info about Okex V5 API read here.

Amir 25 May 19, 2022
Golang wrapper for the Sylviorus antispam API for telegram

Syl-Go Golang wrapper for the Sylviorus antispam API for telegram package test

Pranav Ajay 1 Jan 2, 2022
Gocaptcha - An API wrapper for popular captcha solvers such as AntiCaptcha and 2Captcha in Golang

An API wrapper for popular captcha solvers such as AntiCaptcha and 2Captcha in Golang

null 14 Apr 27, 2022
Trello API wrapper for Go

Go Trello API A #golang package to access the Trello API. Nearly 100% of the read-only surface area of the API is covered, as is creation and modifica

Aaron Longwell 199 Apr 13, 2022