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
| # lib/faraday/steam_api_exceptions.rb | |
| class SteamApiExceptions < Faraday::Middleware | |
| def call(env) | |
| begin | |
| @app.call(env) | |
| raise "this will be actually entered if everything is correct" | |
| rescue => e | |
| raise "this should be called, shouldn't it?" | |
| end | |
| end |
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
| var addPendingFriends = function() { | |
| console.log("searching for pending friend requests..."); | |
| console.log(bot.steamID); | |
| var bot_db = models.Bot.where({ steam_id: bot.steamID }).fetch(); // i need the model here, not a promise | |
| new models.User().botStatusPending().fetchAll().then(function(users){ | |
| users.forEach(function(user){ | |
| console.log(bot_db.get('id')); | |
| if(bot.friends[user.get('steam_id')] && bot.friends[user.get('steam_id')] == 2) { | |
| console.log(bot_db); |
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
| var _ = require("underscore"), | |
| steam = require("steam"), | |
| util = require("util"), | |
| fs = require("fs"), | |
| dota2 = require("dota2"), | |
| bot = new steam.SteamClient(), | |
| Dota2 = new dota2.Dota2Client(bot, true); | |
| var models = require("./models"); |
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
| class User < ActiveRecord::Base | |
| # Include default devise modules. Others available are: | |
| # :confirmable, :lockable, :timeoutable and :omniauthable | |
| devise :recoverable, :rememberable, :trackable, #:validatable, | |
| :omniauthable, :omniauth_providers => [:steam] | |
| #:database_authenticatable, :registerable, | |
| def self.from_omniauth(auth) | |
| where(steam_id: auth.uid).first_or_create do |user| | |
| user.steam_id = auth.uid |
NewerOlder