Answer the question
In order to leave comments, you need to log in
How to add user to teelgram chat?
How to add a user to a telegram chat? There is a messages.addChatUser method, but it cannot add by username, it requires user_id and access_hash. Where can you get them?
I use telegram-mtproto library
Answer the question
In order to leave comments, you need to log in
getUserID
async function getUserID() {
const auth = await api.storage.get('user_auth')
return auth.id || 0
}
const chatHistory = async chat => {
const max = 400
const limit = 100
let offset = 0
let full = [],
messages = []
do {
const history = await telegram('messages.getHistory', {
peer: {
_ : 'inputPeerChannel',
channel_id : chat.id,
access_hash: chat.access_hash
},
max_id: offset,
offset: -full.length,
limit
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question