New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

icq-bot

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

icq-bot

ICQ-BOT

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

icq-bot

Pure NodeJS/TypeScript interface for Bot API.

Table of contents

  • Introduction
  • Getting started
  • Installing
  • Using
  • API description

Introduction

This library provides complete Bot API 1.0 interface and compatible with Node.js v13.10.1

Getting started

Create your own bot by sending the /newbot command to Metabot and follow the instructions.

Note a bot can only reply after the user has added it to his contact list, or if the user was the first to start a dialogue.

Installing

Install using npm:

npm install icq-bot 

Using

initialization

const ICQ = requier("icq-bot").default;
const TOKEN = "XXX.XXX.XXX:XXX"
const bot = new ICQ.Bot(TOKEN);

send message

const chatId = "XXX";
bot.sendText(charID,"TEXT HERE..").then( response =>{ console.log( response.ok ) });

How using pooling

You can using handlers: ICQ.Handler.* :

  • HelpCommand
  • Message
  • NewChatMembers
  • LeftChatMembers
  • PinnedMessage
  • UnPinnedMessage
  • EditedMessage
  • DeletedMessage
  • Command
  • StartCommand
  • FeedbackCommand
  • UnknownCommand
let handler = new ICQ.Handler.Message(null, (bot, event) => { });
bot.getDispatcher().addHandler(handler);
bot.startPolling(); 

How using filter

You can using handlers: ICQ.Filters.* :

  • message
  • command - only comman where message start on "/" or "."
  • file
  • image
  • video
  • audio
  • media
  • sticker
  • url
  • regexp
  • mention
  • forward
  • reply
  • sender
let handler = new ICQ.Handler.Message(new ICQ.Filter.url(), (bot, event) => { 
   // code here
});
bot.getDispatcher().addHandler(handler);
bot.startPolling(); 

API description

Keywords

FAQs

Package last updated on 10 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc