#+TITLE: SpamProtection-rs #+HTML:
* Table of contents :PROPERTIES: :TOC: :END: :CONTENTS: - [[#about][About]] - [[#supported-rust-version][Supported Rust version]] - [[#features][Features]] - [[#How to use][How to use]] - [[#credits][Credits]] - [[#license][License]] :END: * About SpamProtection-rs is a [[https://rust-lang.org][Rust]] wrapper for [[https://intellivoid.net][Intellivoid]] SpamProtection API which uses the [[https://crates.io/crates/reqwest][Reqwest]] library to make the request and [[https://crates.io/crates/serde][serde]] to parse the json output. This wrapper was made in focus of speed, reliability and memory safety. * Supported Rust version At the time of development we used rustc version 1.53.0. Anything newer than this should work fine with the library unless if there were any syntax breaking changes included in future rust updates in which we will update our code to the latest standards. * Features + =Easy to use= + =Looking up userID, PTID or username= + =Check if user is blacklisted due to specific flag= + =Check if user is a operator= + =Check if user is verified= + =Check if user is official= + =Check if user is a agent= + =Spam and ham prediction= + =Language prediction with probability= * How to use ** To use this library in your project you would need to add the below code to your Cargo.toml #+BEGIN_SRC toml [dependencies] spamprotection = "0.1.0-2" #+END_SRC ** Here's an example of how you can use the spamprotection library in your code #+BEGIN_SRC rust use spamprotection::info; use std::env; /* We would need to first to declare the spamprotection library with use declaration. We would also need to declare the env trait from std library as args variable will be collecting the arguments passed to the program. */ fn main() { /* Here we will need to assign a Vector type to args variable to collect the arguments passed to program. Then we will need to assign String type to arg variable to parse the arguments passed. Alternatively you can use the commented code below too if you don't want an argument-based program. You don't need to add quotes for userID, but you'll need to add quotes if you want to check with username. let info = info::full(123456789); */ /* You can also use a private_telegram_id (PTID) to get info Example: info::full("TEL-9b7ef46a550112edea3ba46220283b1bfd8feddd09b26888524ef7245947e97f-b105a169"); ,*/ let args: Vec