go-telegram-bot-api/telegram-bot-api 2298
Golang bindings for the Telegram Bot API
jaredallard/minecraft-preempt 14
Automatically start your minecraft server when a user joins
The codebase for the old version of CAH Creator.
ASCII art library written in Go
tjhorner/asdnpadsnpoansdopasdn 1
a poorly written, but funny, script
Donation page for Academus
integration for slack that shows latest commit
push eventtjhorner/tjhorner
commit sha 3e0e8c21d8e906c3bb198f8060521b212d25deac
add lorem ipsum
commit sha 6b8aec2ca9976ce660425f4bad77a619f1f84859
Merge pull request #3 from cktang88/patch-1 add corporate lorem ipsum
push time in 10 hours
pull request commenttjhorner/tjhorner
it would be really funny if this legitimately helps me in getting a job in the future
comment created time in 10 hours
push eventtjhorner/asciify
commit sha c0133b965ccfe7f51b2c2b9f1380fd60d842add6
chore: fix readme, again
push time in 2 days
push eventtjhorner/asciify
commit sha d7e56fc3c66220742555bdee43e4f21a86a0af37
change dat line height
push time in 2 days
push eventtjhorner/asciify
commit sha 21027a918985952539d21525b566cdc6f9595dfb
lol oops
push time in 2 days
push eventtjhorner/asciify
commit sha 47ac9615578c2dc24a14a6c1b1781cbd3c6956b4
the readme is now accurate again
push time in 2 days
push eventtjhorner/asciify
commit sha 80e7a60785278fd73781ecc4570a698690eb73f4
eee
push time in 2 days
push eventtjhorner/asciify
commit sha c2cf66a93070b025fd5b66162a77b531f083f8de
fix: closes #1 and adds some perf improvements
push time in 2 days
issue closedtjhorner/asciify
It doesn't actually do the thing correctly
So it's actually calculating the luminance -> character conversion wrong. I initially wrote this method with an alpha value in mind, then I realized that didn't make any sense so I used luminance instead. But I forgot to change the calculation because I am dumb. It's actually treating dark values as light values and vice versa. So that needs to be fixed.
Also, when it does calculate the luminance, I tried to make it factor in the alpha value, but that didn't really work because, again, I am dumb. I guess I need to make a "brighten" method that takes the original color and brightens it by a factor of 1 - A, so if there's like a fully transparent area it will just treat that as a fully bright (e.g. white) area. More transparent = more bright.
closed time in 2 days
tjhornerissue commenttjhorner/asciify
It doesn't actually do the thing correctly
wait a second, (color.Color).RGBA returns it alpha-premultiplied
bruh
comment created time in 2 days
issue openedtjhorner/asciify
It doesn't actually do the thing correctly
So it's actually calculating the brightness -> character conversion wrong. I initially wrote this method with an alpha value in mind, then I realized that didn't make any sense so I used luminance instead. But I forgot to change the calculation because I am dumb. It's actually treating dark values as light values and vice versa. So that needs to be fixed.
Also, when it does calculate the luminance, I tried to make it factor in the alpha value, but that didn't really work because, again, I am dumb. I guess I need to make a "brighten" method that takes the original color and brightens it by a factor of the alpha value, so if there's like a fully transparent area it will just treat that as a fully bright (e.g. white) area.
created time in 2 days
push eventtjhorner/asciify
commit sha b22c5e72333ae36d6cc15919d837a307afc90a8f
chore: readme
push time in 3 days
push eventtjhorner/asciify
commit sha 90eadc208fab7dde108ffb0af224212dfa8ff8ee
fix: more descriptive error
push time in 3 days
push eventtjhorner/asciify
commit sha 43eb75dbacfb4679c79cb3903b6cb9abd66e7675
chore: clean up readme
push time in 3 days
push eventtjhorner/asciify
commit sha 00e500fa724ce19dd582baa4014e2e885b534304
feat: imagify
push time in 3 days
push eventtjhorner/asciify
commit sha af60bfd97f06ac893ff8255321e4fe23438e1730
chore: add doc link to readme
push time in 3 days
push eventtjhorner/asciify
commit sha 8c0f135340f04b7c03b790afc8238e84712616bd
chore: tweak readme
push time in 3 days
startedtwostraws/VisualEffects
started time in 3 days
issue commentgo-telegram-bot-api/telegram-bot-api
@himynameisulpa The CustomTitle field is now available on ChatMember.
comment created time in 3 days
push eventgo-telegram-bot-api/telegram-bot-api
commit sha 5ebb3edeffaa49f5bdf05e6f810d171714211628
feat: Add CustomTitle field to ChatMember
commit sha 15c95b8a841865bf5cb00292f227f410c01cf4a2
Merge pull request #364 from go-telegram-bot-api/chatmember-custom-title Add CustomTitle field to ChatMember
push time in 3 days
PR merged go-telegram-bot-api/telegram-bot-api
Closes #363
pr closed time in 3 days
issue closedgo-telegram-bot-api/telegram-bot-api
Hi, https://godoc.org/github.com/go-telegram-bot-api/telegram-bot-api#ChatMember I need to use the title attribute. the python library has it: https://python-telegram-bot.readthedocs.io/en/stable/telegram.chatmember.html#telegram.ChatMember I hope, i can use it soon.
closed time in 3 days
himynameisulpaissue commentgo-telegram-bot-api/telegram-bot-api
Thanks for bringing this up. I created #364 to address this. You can use the chatmember-custom-title branch in the meantime.
comment created time in 4 days
PR opened go-telegram-bot-api/telegram-bot-api
Closes #363
pr created time in 4 days
create barnchgo-telegram-bot-api/telegram-bot-api
branch : chatmember-custom-title
created branch time in 4 days
issue closedgo-telegram-bot-api/telegram-bot-api
Is it possible to run this alongside an HTTP server?
Apologies if this is a little confusing, but let me try to explain what I'm trying to achieve.
I have a REST API that currently does some processing for a SaaS app. We want to use Telegram for notifications. I want to be able to set this up so that the bot server is listening for POST requests on say /notification and then pass that on to the bot, say using something like bot.NewMessage(chatId, messageBody)
Would something like that be possible with this library?
Thanks in advance.
closed time in 4 days
Snazzyhamissue commentgo-telegram-bot-api/telegram-bot-api
Is it possible to run this alongside an HTTP server?
Assuming this was resolved... closing. Let me know if you need any more help.
comment created time in 4 days
pull request commentjaredallard/minecraft-preempt
Add auto-shutdown based on player count
Writing automated tests would be awesome. But would probably require lotsa mocks lol
comment created time in 6 days
push eventtjhorner/minecraft-preempt
commit sha 5f302c0924d67645b491629c87aabe5eb0d4f0ff
fix: use that error
push time in 6 days
PR opened jaredallard/minecraft-preempt
I have tested none of this. But the logic goes like this:
Every time the server is pinged...
- If at least 1 player is online,
playersLastSeenAtis set to the current time - If the duration between
playersLastSeenAtand now (i.e., how long it has been since we last saw a player) is less than what is configured, do nothing - Else, shut down the instance
Test it and let me know if it works lol
pr created time in 6 days
push eventtjhorner/minecraft-preempt
commit sha 23c8154a4f1bb2a5ce78c5ec028c11a8f04c64d0
chore: oops I fix
push time in 6 days
issue openedjaredallard/minecraft-preempt
Currently the config is loaded relative from where the binary is located, which may not necessarily be the current directory. It should be changed so that it is loaded relative to the user's current directory. It would also be nice to have a flag to indicate where the config is stored.
created time in 6 days
fork tjhorner/minecraft-preempt
Automatically start your minecraft server when a user joins
fork in 6 days
startedjaredallard/minecraft-preempt
started time in 6 days
startedmandatoryprogrammer/NorthKoreaDNSLeak
started time in 7 days
issue commentgo-telegram-bot-api/telegram-bot-api
Is it possible to run this alongside an HTTP server?
If I am understanding you correctly, you have some other source sending events to POST /notification, and you want the bot to send a message to a Telegram user in response? That is definitely possible. You could do something like this (I didn't test it, so treat it like pseudocode):
bot, _ := tgbotapi.NewBotAPI("YourBotToken")
http.HandleFunc("/notification", func(w http.ResponseWriter, r *http.Request) {
// Parse the data, or whatever
msg := tgbotapi.NewMessage(12345, "Message text")
bot.Send(msg)
w.WriteHeader(200)
})
comment created time in 9 days
startedmicrosoft/companion-device-framework
started time in 11 days
push eventgo-telegram-bot-api/telegram-bot-api
commit sha 7629a37f7708fa9a24c55fd490114922d026bdb3
Added validation and error checking for incoming updates in ListenForWebhook
commit sha 20b57111fc7b1d362967c786b2052b4481e6cccb
Merge branch 'master' of https://github.com/go-telegram-bot-api/telegram-bot-api into wehook-validation
commit sha b6575a2934b018fc5109ac4b161cc52f51210436
Added stream processing of input JSON Co-authored-by: TJ Horner <[email protected]>
commit sha fb8759e91dfc6af21bd422f49040e4ff463381b4
Merge pull request #282 from dmitriy-kharchenko/master Added validation and error checking for incoming updates in ListenFor…
push time in 16 days
PR merged go-telegram-bot-api/telegram-bot-api
if you open the URL of the webhook in the browser for example to debug... then your app will crash due to memory violation. These Changes fix it!:)
pr closed time in 16 days
issue commentgo-telegram-bot-api/telegram-bot-api
Answering inline query with a sticker
Oh that is a very old version, last commit is from 2018. Versioning is kind of a mess right now; you might want to just reference master until it's all figured out.
comment created time in 16 days
issue commentgo-telegram-bot-api/telegram-bot-api
Answering inline query with a sticker
It seems to be available in the current release:
https://github.com/go-telegram-bot-api/telegram-bot-api/blob/7a018ae8739bcd25eeb220a85c35bf1ad73e1da8/types.go#L756-L764
comment created time in 16 days
push eventtjhorner/gndr
commit sha acb92a60e129a35a2bd564bf32bf7ec9bd48c266
add git repo to the thing
push time in 16 days
push eventtjhorner/gndr
commit sha 731a5c45b8e84ee0ffa71c80a1d8f24ba972c47d
fix typo
push time in 16 days
pull request commentgo-telegram-bot-api/telegram-bot-api
Close update channel and cancel current request on shutdown
the first one is to drop support of go <= 1.12 (current is 14)
Since this library doesn't have any real versioning at the moment, this would be pretty undesirable since it has a high chance of breaking existing installs. @Syfaro what do you think?
comment created time in 16 days
pull request commentgo-telegram-bot-api/telegram-bot-api
Agreeing with @Syfaro here; seems simpler (and easier to understand) to have constant strings rather than constant ints alongside a map to their string equivalents. I think using a switch for validation would be just fine here.
comment created time in 16 days
Pull request review commentgo-telegram-bot-api/telegram-bot-api
Added validation and error checking for incoming updates in ListenFor…
func (bot *BotAPI) ListenForWebhook(pattern string) UpdatesChannel { ch := make(chan Update, bot.Buffer) http.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {- ch <- bot.HandleUpdate(w, r)+ update, err := bot.HandleUpdate(r)+ if err != nil {+ errMsg, _ := json.Marshal(map[string]string{"error": err.Error()})+ w.WriteHeader(http.StatusBadRequest)+ w.Header().Set("Content-Type", "application/json")+ _, _ = w.Write(errMsg)+ return+ }++ ch <- *update }) return ch } // HandleUpdate parses and returns update received via webhook-func (bot *BotAPI) HandleUpdate(res http.ResponseWriter, req *http.Request) Update {- bytes, _ := ioutil.ReadAll(req.Body)- req.Body.Close()+func (bot *BotAPI) HandleUpdate(r *http.Request) (*Update, error) {+ if r.Method != http.MethodPost {+ err := errors.New("wrong HTTP method required POST")+ return nil, err+ } - var update Update- json.Unmarshal(bytes, &update)+ payload, err := ioutil.ReadAll(r.Body)+ if err != nil {+ return nil, err+ }++ if err := r.Body.Close(); err != nil {+ return nil, err+ }++ var update Update+ err = json.Unmarshal(payload, &update)+ if err != nil {+ return nil, err+ }
While we are here, how about we use json.Decoder instead of json.Unmarshal? This way we don't need to load the entire body into memory first. Well, loading it into memory is essentially what Go does internally, but I think it is better to let the language worry about the implementation of decoding a JSON stream. (Plus, it has some other niceties like failing early if a token is not allowed as it's streamed in, closing the body stream for us, etc.)
Could do something like:
var update Update
err := json.NewDecoder(r.Body).Decode(&update)
if err != nil {
return nil, err
}
comment created time in 17 days
push eventtjhorner/docker-redirector
commit sha 37728c3287ce18a6cfd223089510c98c8eea6b97
Update README.md
push time in 18 days
push eventtjhorner/schema.tl
commit sha e067b8152824872a7e0b1750c52748876ea10af7
[chore] Update to layer 116 (#37)
push time in 18 days
PR merged tjhorner/schema.tl
Hello! It's time... time to update the schema layer! This pull request migrates from layer 114 to layer 116. Please check to make sure I didn't screw anything up!
New constructors
- updateChannelParticipant
- chatInvitePeek
- statsGroupTopAdmin
- statsGroupTopPoster
- statsGroupTopInviter
- stats.megagroupStats
- globalPrivacySettings
New methods
- account.getGlobalPrivacySettings
- account.setGlobalPrivacySettings
- help.dismissSuggestion
- stats.getMegagroupStats
Documentation files were created for these new constructors and methods.
With ❤️, Your Friendly Neighborhood Schemabot
pr closed time in 18 days
startedgo-telegram-bot-api/telegram-bot-api
started time in 18 days
pull request commentsrnd/engage-a-tron
JAKE I WAS ABOUT TO M ERGE IT
comment created time in 20 days
startedXe/site
started time in a month
pull request commentPaperMC/Parchment
@electronicboy Just wondering if you'd be happy with the change described above. If so, I'll implement it that way so we can get this PR merged.
comment created time in a month
push eventtjhorner/textscreen
commit sha 3021d97f412c9c9b19e7df09e719ca0da710c6f0
MIT license
push time in a month
push eventtjhorner/portal-sounds-bot
commit sha 068b4dba575c0ee9b2a07cdf029e9c36ce275459
o
push time in a month
push eventtjhorner/portal-sounds-bot
commit sha 4d40d1e27ab845320f266a15bb9ba8856c8fa9af
haven't tested lol
push time in a month
push eventtjhorner/tjhorner.github.io
commit sha a7c6daed7104bc238172b7c50dc7bfe7440ddd2f
lol oops
push time in a month
push eventtjhorner/tjhorner.github.io
commit sha 054e080d6d5ab7a7435a6dd7ea40de05ef14b324
cool thinG
commit sha 08005f0f4db6b08faaad73b5a8e465a3d3ca2336
Merge branch 'master' of github.com:tjhorner/tjhorner.github.io
push time in a month
push eventtjhorner/textscreen
commit sha 6fcc580cfbbe9e0faf455656c04d48b88dbb0943
forward initial messageG
push time in a month
push eventtjhorner/textscreen
commit sha 378f85db1e6fa7abe410074e45257ceba6f75866
AAAAA
push time in a month
push eventtjhorner/textscreen
commit sha 222edfcda30acd98f8b2554edb8c784ba1f15850
god ok
push time in a month
push eventtjhorner/tjhorner
commit sha e5a2a81a46ebce4337d6674ba33b603f4743bd42
Update README.md beating captchas with gotchas
commit sha ebb50b237d8c07e8a0d914fdfab64927090cf988
Merge pull request #2 from eahrend/patch-1 Update README.md
push time in a month
push eventtjhorner/tjhorner
commit sha 6b06e13b099f458481a324e20b8fb0357745592d
Update README.md
commit sha 4c6e18cfdc3aed230d9ed548f366f2680a15af4a
Actually follow the rules and not be stupid
commit sha 55628d48d4343357b6b665fb3789f3d2f7980bdd
Merge pull request #1 from plusreed/master awful
push time in a month
PR merged tjhorner/tjhorner
Name was not added to README so I added it ❤️
pr closed time in a month
pull request commenttjhorner/tjhorner
actually it does violate rule 2, please move your content
comment created time in a month
pull request commenttjhorner/tjhorner
violates rule 3, it is very vulgar
comment created time in a month
push eventtjhorner/tjhorner
commit sha a2151148cb42ea842c8651713c0c18e82246f8b2
Update README.md
push time in a month
pull request commentzwagoth/e621ng
Return avatar ID in user API response
Oh awesome, thanks!
comment created time in a month
pull request commentPaperMC/Parchment
Sure, what about:
{
"hashes": {
"md5": "...",
"sha256": "..."
}
}
Just in case more algos are added later on. I was also considering adding a query-string parameter to specify which algorithm you wanted to use, so it wouldn't need to compute them all at once or needlessly increase response size. What do you think?
comment created time in a month
PR opened PaperMC/Parchment
Resolves #5
My friend kept asking me to +1 issues related to this so I decided to make a pull request so he would stop bugging me.
Also, as an unrelated side note, it doesn't look like it ever actually reads from the cache. For example:
https://github.com/PaperMC/Parchment/blob/3dc9af6f679e2d87b40dc1849c0d8575fb33747d/src/V1/BuildCacheTrait.php#L38-L46
It always writes to the cache, but never reads from it. Is this intended? Is there some Symfony voodoo-magic I'm missing here?
pr created time in a month
push eventtjhorner/Parchment
commit sha 5084559f3b7db5a805fd8a9c0fd89613ac7dbd03
chore: Slightly improve hashing logic
push time in a month
startededgar-zigis/SegmentedArcView
started time in a month
push eventtjhorner/discord-gsuite
commit sha 947b66fea6c852e0874fe1add95baf7bdf75184a
sigh
push time in a month
push eventtjhorner/discord-gsuite
commit sha 10841570c7bdfd875ca5845f044fb9c9251d34fc
Docker GitHub Actions workflow
push time in a month
push eventtjhorner/vrhr-server
commit sha bf45158223c7e7d0df314987380ac4603e2cc4ba
ok
push time in 2 months
push eventtjhorner/vrhr-server
commit sha 0132dad7d18e5bf1031e499c305db248b7a1099d
lots of stuff
push time in 2 months