Code Monkey home page Code Monkey logo

skypetotelegrambot's Introduction

SkypeToTelegramBot

Skype <-> Telegram Bot, finally, no more skype client...

Source Code

Source is stored on GitLab and mirrored to Github
Repo on GitHub
Repo on GitLab

Downloads

Grab the latest build from the CI here Build Status

Usage

Create a bot using the telegram BotFather
Give this bot access to read all messages in group chats with the /setprivacy command in BotFather

Start the bot using java -jar SkypeToTelegramBot.jar TG_BOT_API_KEY

Create a group chat with just you and the bot in it after successfully logging in and use the /link command.

Commands

Telegram Private Chat With Bot

/login [username] [password]
/logout

Telegram Group Chat

/link - Shows a selection of clickable buttons of the known group chats.
/link (chatID) - You can get the chat ID of a skype chat by typing /showname in the skype chat.
/link (username) - You can link to a skype private chat by just entering the username of the person you want to link to.
/unlink - Removes the link to the skype chat if one exists.

skypetotelegrambot's People

Contributors

zackpollard avatar

Stargazers

 avatar  avatar  avatar  avatar  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  avatar  avatar  avatar

skypetotelegrambot's Issues

Bad Request: Can't parse message text

Tonight I've got more than 120 messages from Bot. All are the same:

The stacktrace is:
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
java.net.Socket.connect(Socket.java:589)
sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:656)
sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
sun.net.NetworkClient.doConnect(NetworkClient.java:180)
sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1104)
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512)
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
com.samczsun.skype4j.internal.threads.PollThread.lambda$run$25(PollThread.java:66)
com.samczsun.skype4j.internal.threads.PollThread$$Lambda$52/2016594453.run(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)

---
Please send the previous two messages to @zackpollard on telegram.

And in console, where Bot is running, I see following errors:

java.net.NoRouteToHostException: No route to host
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:656)
        at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1104)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
        at com.samczsun.skype4j.internal.threads.PollThread.lambda$run$25(PollThread.java:66)
        at com.samczsun.skype4j.internal.threads.PollThread$$Lambda$52/2016594453.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
The API returned the following error: Bad Request: Can't parse message text: Can't find end of the entity starting at byte offset 43
JSON Response was null, something went wrong...

Availability of server, where this Bot is running, is monitored from three different places - and internet connection was stable all this night.

Always "An error occurred with the Skype API, please try again later."

I got everything to run but i always get an "An error occurred with the Skype API, please try again later." if i try to log in. I tried it with an normal Skype and with an Microsoft account.
And yes i double checked if the password is the right one.

This is the console output i get:

com.samczsun.skype4j.exceptions.ConnectionException:
Cause: While logging in
Response: 401 Unauthorized
Begin Message

{"status":{"code":40120,"text":"Authentication failed. Bad username or password."}}

            End message

    at com.samczsun.skype4j.internal.ExceptionHandler.generateException(ExceptionHandler.java:101)
    at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.connect(Endpoints.java:385)
    at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.connect(Endpoints.java:315)
    at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.post(Endpoints.java:295)
    at com.samczsun.skype4j.internal.client.FullClient.login(FullClient.java:70)
    at pro.zackpollard.telegrambot.skypetotelegrambot.managers.SkypeManager.skypeLogin(SkypeManager.java:223)
    at pro.zackpollard.telegrambot.skypetotelegrambot.managers.SkypeManager.addUser(SkypeManager.java:181)
    at pro.zackpollard.telegrambot.skypetotelegrambot.telegram.listeners.TelegramCommandListener.onCommandMessageReceived(TelegramCommandListener.java:54)
    at pro.zackpollard.telegrambot.api.internal.event.ListenerRegistryImpl.lambda$callEvent$12(ListenerRegistryImpl.java:84)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at pro.zackpollard.telegrambot.api.internal.event.ListenerRegistryImpl.callEvent(ListenerRegistryImpl.java:84)
    at pro.zackpollard.telegrambot.api.internal.updates.RequestUpdatesManager$UpdaterRunnable.run(RequestUpdatesManager.java:180)
    at java.lang.Thread.run(Thread.java:748)

Use Releases :D

Once the code base is stable, please put the releases in Github's releases tab.

Thx. ๐Ÿ˜

How it should work? Chat is loaded but didn't send the message

I tried to run the bot then, after link, if i receive a message i just have in the console the message like

Person is typing in 8:quann969
Chat is loaded.
Chat is now loaded.
Person is typing in 8:quann969
Chat is loaded.
Chat is now loaded.
Person is typing in 8:quann969
Chat is loaded.
Chat is now loaded.
Person is typing in 8:quann969
Chat is loaded.
Chat is now loaded.

but no message on telegram

seems not working anymore

seems not working anymore:

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
        The method getInstance() is undefined for the type SkypeToTelegramBot
        The method getTelegramBot() is undefined for the type SkypeToTelegramBot
        The method getTelegramToSkypeCredentials() is undefined for the type CredentialStore
        The method getUsername() is undefined for the type CredentialStore.Credentials
        The method getPassword() is undefined for the type CredentialStore.Credentials
        The method getTelegramUser() is undefined for the type SkypeManager.TelegramIDSkypeChat
        The method getSkypeChat() is undefined for the type SkypeManager.TelegramIDSkypeChat
        The method getTelegramUser() is undefined for the type SkypeManager.TelegramIDSkypeChat
        The method getSkypeChat() is undefined for the type SkypeManager.TelegramIDSkypeChat
        The method loadMoreMessages(int) is undefined for the type Chat
        The method getCredentialStore() is undefined for the type SkypeManager
        The type ReplyKeyboardHide.ReplyKeyboardHideBuilder is not visible
        The method getSkypeChat() is undefined for the type SkypeManager.TelegramIDSkypeChat
        The method getSkypeChat() is undefined for the type SkypeManager.TelegramIDSkypeChat
        The method getInstance() is undefined for the type SkypeToTelegramBot

        at pro.zackpollard.telegrambot.skypetotelegrambot.managers.SkypeManager.<init>(SkypeManager.java:71)
        at pro.zackpollard.telegrambot.skypetotelegrambot.SkypeToTelegramBot.initSkypeManager(SkypeToTelegramBot.java:67)
        at pro.zackpollard.telegrambot.skypetotelegrambot.SkypeToTelegramBot.<init>(SkypeToTelegramBot.java:40)
        at pro.zackpollard.telegrambot.skypetotelegrambot.Main.main(Main.java:7)

Unknown chat type with identity 28:concierge

Today bot crashed with following message:

java.lang.IllegalArgumentException: Unknown chat type with identity 28:concierge
        at com.samczsun.skype4j.internal.chat.ChatImpl.createChat(ChatImpl.java:307)
        at com.samczsun.skype4j.internal.SkypeImpl.loadChat(SkypeImpl.java:282)
        at com.samczsun.skype4j.internal.SkypeImpl.getOrLoadChat(SkypeImpl.java:295)
        at com.samczsun.skype4j.internal.MessageType.getChat(MessageType.java:682)
        at com.samczsun.skype4j.internal.MessageType.getChat(MessageType.java:670)
        at com.samczsun.skype4j.internal.MessageType$2.handle(MessageType.java:76)
        at com.samczsun.skype4j.internal.MessageType$4.handle(MessageType.java:149)
        at com.samczsun.skype4j.internal.EventType$1.handle(EventType.java:38)
        at com.samczsun.skype4j.internal.threads.PollThread.lambda$run$26(PollThread.java:139)
        at com.samczsun.skype4j.internal.threads.PollThread$$Lambda$53/1961874558.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        Suppressed: com.samczsun.skype4j.exceptions.SkypeException: {"messagetype":"RichText","originalarrivaltime":"2016-07-04T11:45:
34.604Z","version":"1467632734604","contenttype":"Text","isactive":true,"from":"https://db5-client-s.gateway.messenger.live.com/v1/use
rs/ME/contacts/28:concierge","id":"1467632734604","conversationLink":"https://db5-client-s.gateway.messenger.live.com/v1/users/ME/conv
ersations/28:concierge","type":"Message","imdisplayname":"Skype","ackrequired":"https://db5-client-s.gateway.messenger.live.com/v1/use
rs/ME/conversations/ALL/messages/1467632734604/ack","content":"__ ________ ___ ___ ___________ ______ _ _____ __________?\n<ss type=\"
hug\">(hug)</ss> <ss type=\"bow\">(bow)</ss> <ss type=\"heart\">(heart)</ss> <ss type=\"dance\">(dance)</ss>\n_________ ______ __-____
__ _ ___________ __________ ______ _ <a href='http://go.skype.com/howto.imemoticons?cm_mmc=ICCO_1493_msg03_instantmessage'>____ _ ____
____</a>.","composetime":"2016-07-04T11:45:34.604Z"}
                at com.samczsun.skype4j.internal.EventType$1.handle(EventType.java:40)
                ... 5 more
The API returned the following error: Bad Request: Can't parse message text: Can't find end of the entity starting at byte offset 43
JSON Response was null, something went wrong...

mvn compile failed

mvn compile failed:

mvn compile
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Telegram-SkypeToTelegramBot: Compilation failure
[ERROR] /home/u/IdeaProjects/SkypeToTelegramBot/src/main/java/pro/zackpollard/telegrambot/skypetotelegrambot/managers/SkypeManager.java:[105,21] cannot find symbol
[ERROR] symbol:   method loadMoreMessages(int)
[ERROR] location: variable chat of type com.samczsun.skype4j.chat.Chat
...

IMHO, it's better to set exact version of https://github.com/zackpollard/SkypeToTelegramBot/blob/master/pom.xml#L25 with which it works.

Exception in websocket client

Today bot crashed with following message:

[SEVERE] [Tue Jul 05 03:02:01 MSK 2016] Exception in websocket client
java.io.IOException: Broken pipe
        at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
        at sun.nio.ch.IOUtil.write(IOUtil.java:65)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
        at org.java_websocket.SSLSocketChannel2.close(SSLSocketChannel2.java:270)
        at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:453)
        at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:472)
        at org.java_websocket.WebSocketImpl.eot(WebSocketImpl.java:520)
        at org.java_websocket.client.WebSocketClient.interruptableRun(WebSocketClient.java:249)
        at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:188)
        at java.lang.Thread.run(Thread.java:745)
There was a connection error when trying to retrieve updates, waiting for 1 second and then trying again.
java.net.SocketTimeoutException: Read timed out

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.