Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

I can't find out how to create ~/.teleirc/chat_ids #45

Closed
melissaboiko opened this issue Feb 16, 2016 · 27 comments
Closed

I can't find out how to create ~/.teleirc/chat_ids #45

melissaboiko opened this issue Feb 16, 2016 · 27 comments

Comments

@melissaboiko
Copy link

On console:

~/.teleirc/chat_ids file not found!

Please add your Telegram bot to a Telegram group and have
someone send a message to that group.
teleirc will then automatically store your group chat_id.

On the Telegram group, after inviting bot as teleirc_si_bot:

@teleirc_si_bot hi
hi @teleirc_si_bot
hi
/names@teleirc_si_bot

No response.

If I write on IRC:

>> relaying to TG: <leoboiko>: hi
>> relaying to IRC: ERROR: No chat_id set! Add me to a Telegram group and say hi so I can find your group's 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!

I installed teleirc via npm for debian wheezy.

@FruitieX
Copy link
Owner

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?

@melissaboiko
Copy link
Author

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...)

@FruitieX
Copy link
Owner

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.

@melissaboiko
Copy link
Author

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.

@FruitieX
Copy link
Owner

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

@FruitieX
Copy link
Owner

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

@melissaboiko
Copy link
Author

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

@FruitieX
Copy link
Owner

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

@melissaboiko
Copy link
Author

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

@xylix
Copy link

xylix commented Feb 17, 2016

Did you get it solved?

@melissaboiko
Copy link
Author

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.

@xylix
Copy link

xylix commented Feb 17, 2016

No I have the exactly same issue.

@FruitieX
Copy link
Owner

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! :)

@xylix
Copy link

xylix commented Feb 18, 2016

It was installed with npm-install.

@FruitieX FruitieX added the bug label Apr 3, 2016
@FruitieX
Copy link
Owner

FruitieX commented Apr 3, 2016

Looks like I did not have time. ;p

Any progress on this?

@zertrin
Copy link
Contributor

zertrin commented Apr 24, 2016

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.

@FruitieX
Copy link
Owner

FruitieX commented May 7, 2016

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.

@FruitieX FruitieX added this to the 0.5.0 milestone May 7, 2016
@FruitieX
Copy link
Owner

FruitieX commented May 7, 2016

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

@FruitieX FruitieX closed this as completed May 7, 2016
@guoyunhe
Copy link

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

@FruitieX
Copy link
Owner

It's supposed to be auto generated.

@FruitieX
Copy link
Owner

@guoyunhe please provide more info :)

@guoyunhe
Copy link

guoyunhe commented Dec 28, 2016

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

@guoyunhe
Copy link

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

@guoyunhe
Copy link

guoyunhe commented Dec 28, 2016

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.

@esahakki
Copy link

esahakki commented Sep 28, 2017

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.

@Mikaela
Copy link
Collaborator

Mikaela commented Oct 5, 2017

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.

@cerebrux
Copy link

cerebrux commented Sep 9, 2018

@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'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants