ba0f3 / telebot.nim

Async Telegram Bot API Client implement in @Nim-Lang
MIT License
165 stars 24 forks source link

stripping API keys #72

Closed melissaboiko closed 2 years ago

melissaboiko commented 2 years ago

If the API key is saved in a file with a newline, the sample echo bot will break at runtime.

I think it would be nice to add a bit of robustness by making the example code

import telebot, asyncdispatch, logging, options, std/strutils

const API_KEY = strip(slurp("secret.key")))

(or maybe add a convenience strip() directly on newTeleBot*()?)