Giter Club home page Giter Club logo

Comments (27)

guoyunhe avatar guoyunhe commented on September 9, 2024 3

I solved my problem, it is just a naming confusion.

My Telegram group is called "openSUSE 中文社群" and the username is opensuse_cn. In teleirc's config.js, I write 'opensuse_cn' as Telegram group name. However, it only reads the display name of group, rather than username.

Suggestion: check both group display name and username. Username or short URL of group can also be treated as identity of a chat. This could help users avoid some mistakes.

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

Hello. Just some quick things I can come to think of from the README:

  1. Did you remember to use the /setprivacy command with BotFather to allow the bot to see all Telegram messages?
  2. Did you put your Telegram Bot API token into ~/.teleirc/config.js?

from teleirc.

melissaboiko avatar melissaboiko commented on September 9, 2024

Yes, and yes:

Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by username.
'Disable' - your bot will receive all messages that people send to groups.
Current status is: DISABLED

I also tested the API token via wget, seems to be working.

(Incidentally, this isn't the place for this, but it took me a while to find out that the Botfather only understands bot names preceded by '@'; and that the "Disable" command is case-sensitive...)

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

Weird. Something is stopping communication between the bot and the Telegram servers. Hmm, also, you did invite the bot via private chat with it -> click on name -> menu -> add to group? Just checking as there's this new inline bot feature - that doesn't work.

from teleirc.

melissaboiko avatar melissaboiko commented on September 9, 2024

I had clicked the group name, then "add member", on the web interface. Now I tried from the bot's private chat, and still no results.

I just noticed that getUpdates, via wget, returns an empty list for the API token (I don't know if this is expected). getMe does return the username correctly.

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

In the web interface, I don't have an option of adding a bot via group name -> add member (it only lists Telegram contacts for me, no bots). I have to do that by selecting the bot from my contacts (first open a chat via the link BotFather gave me when creating the bot), then click on bot name -> add to group.

Either way if you did manage to correctly add the bot to your group (please still double check 😃), it's starting to sound like an issue on Telegram's side if calling the API manually doesn't work either...

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

BTW I clarified the usage of /setprivacy command a little in 13aeff1, it was indeed a little dodgy.

from teleirc.

melissaboiko avatar melissaboiko commented on September 9, 2024

When it lists the human Telegram contacts, if I type the bot name, it then lists the bot. At any rate the result seems to be the same; it says leoboiko invited teleirc_si_bot on the group chat; and then the bot is listed on the left panel.

I'll delete the bot and try everything again, who knows...

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

Ah, I didn't know that, useful! Yeah, try at least generating a new API key and use that, this is sounding really odd...

from teleirc.

melissaboiko avatar melissaboiko commented on September 9, 2024

No luck; same behavior with a brand new bot. Maybe I'm missing something obvious, or else it's something on Telegram's side...

from teleirc.

xylix avatar xylix commented on September 9, 2024

Did you get it solved?

from teleirc.

melissaboiko avatar melissaboiko commented on September 9, 2024

No, sorry, I'm at my wit's and the bot just doesn't seem to respond to messages. Feel free to close this report if you think the problem is unrelated to teleirc itself.

from teleirc.

xylix avatar xylix commented on September 9, 2024

No I have the exactly same issue.

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

Huh, maybe this is an issue with teleirc then. Is @xylix also using the version from npm, or have you built it from git? Are you able to test running any other Telegram bot - that could really narrow it down to teleirc then if another bot does work. I can't really think of a reason why that should be though...

Also if you guys have got time to debug some more, can you test running a build from latest develop branch in git? There's instructions at the bottom of the README on how to set teleirc up from git.

Let's keep this issue open, I definitely am interested in what the cause may be, will investigate more during the weekend when I hopefully have more time! :)

from teleirc.

xylix avatar xylix commented on September 9, 2024

It was installed with npm-install.

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

Looks like I did not have time. ;p

Any progress on this?

from teleirc.

zertrin avatar zertrin commented on September 9, 2024

I think I had a similar problem some time ago, when trying to setup a second bot for teleirc to be run alongside the first one.

For some reason I never understood, I couldn't get it to work (it never received updates from Telegram), even though I followed the exact same steps as for the first one.

I eventually gave up and used the first bot with more chan-group pairs because that one was working.

Sorry for the lack of information, I have no plan in trying again since the current situation works well enough for me, but still wanted to report that the two previous reporters may not be alone to have experienced a similar issue.

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

The way chat IDs are stored has now changed to better support multiple teleirc instances running on the same machine. So at least the problem reported by @zetrin should be fixed.

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

Closing for now. Let me know if this is still of an issue to someone.

from teleirc.

guoyunhe avatar guoyunhe commented on September 9, 2024

I have the same problem and have no idea how to solve it.

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

It's supposed to be auto generated.

from teleirc.

FruitieX avatar FruitieX commented on September 9, 2024

@guoyunhe please provide more info :)

from teleirc.

guoyunhe avatar guoyunhe commented on September 9, 2024

I installed it on my openSUSE laptop with firewall (forbid all ports outside TCP/UDP).

teleirc can join irc channel #opensuse-cn with nickname opensuse_cn_bot. I also added opensuse_cn_irc_bot to the Telegram group chat opensuse_cn.

When I send message in IRC channel #opensuse-cn, it replies:

No chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!

error: while reading chat ID for group opensuse_cn
warn: NOTE!
warn: =====
warn: Please add your Telegram bot to a Telegram group and have
warn: someone send a message to that group.
warn: teleirc will then automatically store your group chat_id.
error: No chat_id set! Add me to a Telegram group and say hi so I can find your group's chat_id!

But when I type something in Telegram group, it won't add any chat ids. And here is no ~/.teleirc/chat_ids or other files generated.

I turned off privacy mode of Telegram bot so it can read messages. But still

from teleirc.

guoyunhe avatar guoyunhe commented on September 9, 2024

Debug output when receiving messages from Telegram:

debug: got tg msg: 
{ message_id: 1459,
  from: 
   { id: 197472852,
     first_name: 'Grover',
     last_name: 'Chou',
     username: 'GroverChouT' },
  chat: 
   { id: -1001091730439,
     title: 'openSUSE 中文社群',
     username: 'opensuse_cn',
     type: 'supergroup' },
  date: 1482946981,
  sticker: 
   { width: 512,
     height: 280,
     emoji: '🙈',
     thumb: 
      { file_id: 'AAQFABN_hb8yAASaOaci_DaksJMfAAIC',
        file_size: 1492,
        width: 128,
        height: 70 },
     file_id: 'BQADBQADSwADJ0oTCs0SsvHyP_3gAg',
     file_size: 7810 } }
verbose: Telegram group not found in config: "openSUSE 中文社群", dropping message...
CyclingPingTimer 0: server silent for too long, let's send a PING
28 Dec 19:42:49 - SEND: PING 6

from teleirc.

esahakki avatar esahakki commented on September 9, 2024

Bot does not handle Telegram group name change quite well. ChatID does not change that often, but is it really needed to verify correct TG-group on received messages?

After renaming the Teleirc bot does operate just fine, until it restarts. Configuration file is not updated, in turn, whole group becomes unavailable to bot, until configuration file manual change and restart. This manual restart is time-consuming and annoying with tens of channels one bot handles - usually IRCnets won't allow more than two connections from single IP address (also 10 minutes grace time sometimes applies), so I need to use single Teleirc process to handle multiple TGgroup-IRCchannel bridges.

from teleirc.

Mikaela avatar Mikaela commented on September 9, 2024

Bot does not handle Telegram group name change quite well. ChatID does not change that often, but is it really needed to verify correct TG-group on received messages?

Could you open a new issue if there isn't one already open yet? Sorry if you already did, I am behind my email by 500 messages and trying to read them all now.

from teleirc.

cerebrux avatar cerebrux commented on September 9, 2024

@guoyunhe Ι love it when I come and see that a solution like yours still works after two years !

So for anybody here that will see this after years (like I did). What @guoyunhe said is simple:

If your group name has a url name like 'GroupName' but the display is 'Group Name' you should use the 'Group Name' in the tgGroup:'Group Name'

from teleirc.

Related Issues (20)

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.