ShareNX
ShareNX copied to clipboard
Telegram
I got a bot API token, but I cannot for the life of me figure out how to actually set up the telegram service.
what is USERID?
Can I make it post in a channel or is it essentially going to private message me?
Lastly, wouldn't using document be better than photo and video? It says that this method can be used to "send general files". Sounds like this would avoid the need to have two seperate configs for photo and video, and just send them as files...
Okay, I figured out how to make it work, and using document seems to work too:
First, here is a slightly modified version of the file that hopefully is self-explanatory on which part to edit. Maybe it will help anyone stumbling upon this.
- Make a channel, and give it a username (this means public, I think. Private Channels are untested). Let's assume the channel is called JohnDoe_Switch. Your invite url should reflect this (t.me/JohnDoe_Switch)
- Invite bot to channel
- edit the info bellow to match yours. This means the URL needs to have your own bot API key in it, and the
datain [1] needs to match the channel id ( in this example,@JohnDoe_Switch)
Again, bot API key and the data field are the only values you need to change
[hoster]
name=Telegram
url=https://api.telegram.org/bot9999999999:AAAAAAAAAAAAAAAAAAAAAAAA/sendDocument
mime_count=2
[0]
name=document
data=
is_file_data=true
[1]
name=chat_id
data=@JohnDoe_Switch
is_file_data=false
[theme]
color_text=#000000FF
color_background=#FFFFFFFF
color_focus=#CCCCCCFF
color_topbar=#FFFFFFFF
background_path=romfs:/bg.png
Would it be possible for you to somehow implement a custom 'success' message @HookedBehemoth? Right now it just spits out what I assume is JSON which is helpful when testing things, but not very pretty.
Also, during testing I failed to upload a few screenshots due to incorrect config file. For some reason screen-nx remembers the failure though, even if I restart it. It would be nice if it was possible to try upload again
I was working on an overhaul of the entire config system but I got distracted and I currently have no time at all to work on that. Sorry to disappoint you but I'll message you if I ever get back to it.
It technically is useable so it's fine :)
Just to follow up, there is a way to have the message send directly to a username if wanted.
open this url in your browser, https://api.telegram.org/bot[bot-token]/getUpdates
Send a DM to the bot, then refresh that page.
Look for the chat id in the result > message > from > id field. For me this was an 8 digit number, then put that id in the chat_id data field.