Giter Site home page Giter Site logo

kik-node-api's Introduction

Hi there ๐Ÿ‘‹

kik-node-api's People

Contributors

nanofuxion avatar yassienw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kik-node-api's Issues

Get admins and owners, total users, is group public of the group

Below is the following I use currently to retrieve member status of the group and total number of users and if the group is public:

'iqHandler.js':
Within 'if(xmlns === "jabber:iq:roster")':
image

This will add "users_data", "total" and "ispublic" to the group object
(You can get who is owner or admin upon 'receivedgroupmsg' by console.log(group.users_data)
(You can get total number of users upon 'receivedgroupmsg' by console.log(group.total)
(You can get if the group is public or private upon 'receivedgroupmsg' by console.log(group.ispublic)

Profile/Group Change Name

/* Part 1: */
Location: kik-node-api\src\kikClient.js = add:
const g_changeName = require("./requests/g_changeName");
const p_changeName = require("./requests/p_changeName");

Add anywhere in KikClient within KikClient class:
Profile Change Name:

Change Group Name:

/* Part 2: */
Location: kik-node-api\src\requests = create file:
p_changeName.js
g_changeName.js

p_changeName Code:

g_changeName Code:

Call function:
Kik.g_changeName(group.jid, "Group Name");
Kik.p_changeName("Firstname, "Lastname"

Get Info from Username

Get Info from username:

{
    "firstName":"Kik",
    "lastName":"Team",
    "displayPicLastModified":1531418402837,
    "displayPic":"pic_url.jpg"
}

Code (KikClient.js):

Const axios = require('axios');

getInfoFromUsername(username){
    const url = `https://ws2.kik.com/user/${username}`;
    axios(url).then(response => {
        const htmlToObj = response.data;
        return htmlToObj;
    }).catch();
    return null;
}

packet size limitation

(excuse me if my github etiquette is lacking, total newb here as you know)
but....
kikconnection.js
if(data.length >= 16384)

regarding this data size amount, im coming across two issues

1 (seems to be purely a server side issue)
but "hidden" groups are shown listed in this first packet i recieve, groups that don't show in my apps listings. UNLESS there are other users than myself listed in them (usually its just me) then i must add those users to a functioning group, then start a pm with them. only then will the group we share in common appear in the app, and then i can actually leave the group.
....... which besides just being over all interesting..... is causing me to just get a listing of glitched groups within the first received packet...... and then the roster/group listing of the API, just terminats because its hit the packet size limit.... causing me to be unable to proceed to the actual functioning groups that would be displayed by the next full packet

  1. how can i code this function to continue to produce more packet results?
    (because im ignorant as discussed and highlighted in shame and dispair ....ealier )

Cant access 'friends' from outside of "recievedroster"

Trying to create a function that checks if the user is already a friend, however I cannot seem to figure it out.

I thought getRoster(friends) would return an array like the one within the "receivedroster" event console.log(friends) from within the recievedprivatemsg event.

I have to admit I am very rusty with a limited knowledge of what I am actually doing - this is all a learning experience for me and hope you can help me understand my issue.

repeated unhandled data notifications

I noticed i was getting a string of data notifications
every 30 minutes if no data is recieved
then if data is receieved its delayed 40 minutes
and then continues every 30 minutes again....

until windows reports that its run out of memory

possibly some message handling functions are missing?

qqqq

Friend requests

Might be a silly question, but how does one access friend requests?

Profile Change Email Function

Below is the following I use currently to change the profile email:

Create File 'p_setEmail.js' in Requests Folder:
image

Call Function:
Kik.p_setEmail(email@youuse, current_password);

Notes:
Make sure to add the functions to KikClient.js
image

Not an issue, just posting to fix a bug.

In the iqHandler.js file, you have down

groups.push({
    jid: group.attrs.jid,
    code: group.find("code")? group.find("code").text : null,
    name: group.find("n").text,
    users: users
})

And this is an issue because in group.find("code")? group.find("code").text : null, it's gonna try to access .text, and if group.find("code") is undefined, it will throw an TypeError error.

I propose making these changes here:

groups.push({
    jid: group.attrs.jid,
    code: group.find("code") && group.find("code").text || null,
    name: group.find("n") && group.find("n").text || null,
    users: users
})

As it will try to make sure it exists before it tries getting .text, if it doesn't, it'll default to null. I added it in name also, as it seems to fix a connection hanging issue with the roster. This is tested working on the current build on this device, as well as another device a user had the same issue with.

Profile Change Password Function

Below is the following I use currently to hange the profile password:

Create File 'p_setPassword.js' in Requests Folder:
image

Call Function:
Kik.p_setPassword('new_pass', 'old_pass')

Notes:
Make sure to add the functions to KikClient.js
image

private message echoing back to sender

(hello)

its minor but here's a contribution to help me feel productive.

if im not mistaken exampleBot.js is sending back a copy of what the remote user PMs to user .
(just delete since a console.log exists at the end?)

line 57

Kik.sendPrivateMessage(sender.jid, msg, (delivered, read) =>

Errors With Running The Bot

internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module './src/kikClient'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (C:\Users\Liam\Desktop\Kik - StarBot\exampleBot.js:1:19)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)

would anyone happen to know a fix for this?

Send group images

Hi,

Just wondering if you're going to update this to make sending group images possible?

Happy to help out in anyway I can

Leave Group Function

Below is the following I use currently to leave the group:

Create File 'g_leaveGroup.js' in Requests Folder:
image

Call Function:
Kik.leaveGroup(group.jid)

Notes:
Make sure to add the functions to KikClient.js
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.