This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import macros, strutils | |
macro route(path: untyped, s: untyped): untyped = | |
let pathParts = path.strVal().split("/") | |
let functionName = pathParts[1] | |
var pathVars: seq[string] = @[] | |
for pathPart in pathParts: | |
if pathPart.startsWith("{"): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
class Bot: | |
def __init__(self, token): | |
self.token = token | |
self.url = "https://api.telegram.org/bot{}".format(self.token) | |
def get_me(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
class Pushover: | |
def __init__(self, token): | |
self.token = token | |
self.message_url = 'https://api.pushover.net/1/messages.json' | |
def send_message(self, user, message, title=None, url=None, url_title=None, html=0, token=None): | |
params = dict( |