dwbots

1.1.5 • Public • Published

Darkwolf Bots

Install

npm i --save dwbots

Usage

const DarkwolfBots = require('dwbots')
const dwbots = new DarkwolfBots(token)
 
await dwbots.getMe()
await dwbots.createTelegramBot('Darkwolf Bot', botToken)

Init

new DarkwolfBots(token)

Methods

request(query, variables, options[ignoreErrors]?)

getMe()

getBot(botId)

getBots(options[before, after, first, last, orderBy]?)

getUser(userId)

getUsers(options[before, after, first, last, orderBy]?)

getBotUser(botId, userId, options[languageCode]?)

getBotUsers(botId, options[before, after, first, last, orderBy, languageCode]?)

getBotAdmins(botId, options[before, after, first, last, orderBy, languageCode]?)

getBotBannedUsers(botId, options[before, after, first, last, orderBy, languageCode]?)

createTelegramBot(name, botToken, options[payload, webhookUrl, authToken, enableLanguage, enableLocation, enablePhoneNumber]?)

setName(name)

setPayload(payload?)

refreshBotToken(botId)

setBotName(botId, name)

setBotPayload(botId, payload?)

setBotWebhook(botId, webhookUrl, options[authToken]?)

setTelegramBotToken(botId, botToken)

setTelegramBotSettings(botId, options[enableLanguage, enableLocation, enablePhoneNumber])

setTelegramBotSettingsLanguage(botId, options[requestLanguage, disableLanguageCommand, allowedLanguages])

setTelegramBotSettingsLocation(botId, options[requestLocation, disableCountryCommand, disableLocationCommand, disableSelectState, disableSelectCity, allowedCountries])

setTelegramBotSettingsPhoneNumber(botId, options[requestPhoneNumber, allowedCountries])

setUserDisplayName(userId, displayName)

setUserPayload(userId, payload?)

setUserLanguage(userId, languageCode?)

setBotUserAdmin(botId, userId)

unsetBotUserAdmin(botId, userId)

setBotUserDisplayName(botId, userId, displayName?)

setBotUserAction(botId, userId, action?)

setBotUserState(botId, userId, state?)

setBotUserActionState(botId, userId, action?, state?)

setBotUserPayload(botId, userId, payload?)

setBotUserLanguage(botId, userId, languageCode?)

banBotUser(botId, userId, options[duration, until, reason]?)

unbanBotUser(botId, userId)

Package Sidebar

Install

npm i dwbots

Weekly Downloads

2

Version

1.1.5

License

Apache-2.0

Unpacked Size

98.5 kB

Total Files

29

Last publish

Collaborators

  • pavelwolfdark