Skip to content

Instantly share code, notes, and snippets.

View DarkMentat's full-sized avatar

Andrew Kaganets DarkMentat

View GitHub Profile
@DarkMentat
DarkMentat / Main.kt
Created June 6, 2018 11:22
Wod probability Bot
package org.darkmentat
import org.telegram.telegrambots.ApiContextInitializer
import org.telegram.telegrambots.api.methods.send.SendMessage
import org.telegram.telegrambots.api.objects.Update
import org.telegram.telegrambots.bots.TelegramLongPollingBot
import java.util.Random
import org.telegram.telegrambots.TelegramBotsApi
extern crate telegram_bot;
use super::git_watcher::GitWatcher;
use telegram_bot::*;
use std::time::*;
use futures::Future;
use futures::Stream;
use futures::stream::*;
@DarkMentat
DarkMentat / Cargo.toml
Created October 1, 2017 18:01
Telegram echo-bot
[package]
name = "test_telegram_bot"
version = "0.1.0"
authors = ["darkmentat"]
[dependencies]
telegram-bot = { git = "https://github.com/telegram-rs/telegram-bot.git" }
tokio-core = "0.1"
futures = "0.1"
@DarkMentat
DarkMentat / structs.go
Last active April 21, 2017 23:21
Vk seeker
package vk
import "errors"
var (
ErrVkTooManyRequestsPerSecond = errors.New("Vk error, code: 6, msg: Too many requests per second")
ErrVkUndefinedError = errors.New("Vk error undefined")
)
@DarkMentat
DarkMentat / friendsOfFriends.vk
Last active August 29, 2015 14:25
VK retrieve friends of friends
var r = API.friends.get({"user_id": Args.user_id, "count" : "24", "offset": Args.offset, "fields": "domain"});
var friends = [];
var i = 0;
while(i < r.items.length){
var ff = API.friends.get({"user_id": r.items[i].id});
friends.push({
"id": r.items[i].id,
"first_name": r.items[i].first_name,
"last_name": r.items[i].last_name,