Skip to content

Commit

Permalink
fixed referredby and lookup db bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonp committed Jul 23, 2014
1 parent 75c54c1 commit ed5a81d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
24 changes: 12 additions & 12 deletions botconfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@
#
# LIVE CONFIG INFO

configure do |c|
c.nick = "botspade"
c.server = "irc.twitch.tv"
c.port = 6667
c.password = "oauth:cbr74bjxkfc5r24lqs0yph44fgbgam7" # Get yours here: http://twitchapps.com/tmi/
c.verbose = true
end

#
# TEST CONFIG INFO

#configure do |c|
# c.nick = "botspade"
# c.server = "0.0.0.0"
# c.server = "irc.twitch.tv"
# c.port = 6667
# c.password = "oauth:cbr74bjxkfc5r24lqs0yph44fgbgam7" # Get yours here: http://twitchapps.com/tmi/
# c.verbose = true
#end

#
# TEST CONFIG INFO

configure do |c|
c.nick = "botspade"
c.server = "0.0.0.0"
c.port = 6667
c.verbose = true
end

#############
#
# Whose bot is this? Let's set some customizeations. How many points should people get when
Expand Down
Binary file modified botspade.db
Binary file not shown.
16 changes: 10 additions & 6 deletions botspade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,16 @@ def user_is_an_admin?(user)
msg channel, "#{person}: Empty profile!"
end
else
if (person_hash[attribute])
lookup_value = person_hash[attribute]
msg channel, "#{person}: #{lookup_value}"
if (person_hash)
if (person_hash[attribute])
lookup_value = person_hash[attribute]
msg channel, "#{person}: #{lookup_value}"
else
msg channel, "Sorry, nothing in the viewer database for that!"
end
else
msg channel, "Sorry, nothing in the viewer database for that!"
end
msg channel, "#{person}: Empty profile!"
end # if person_hash
end
else
msg channel, "Sorry, nothing in the viewer database for that!"
Expand Down Expand Up @@ -544,7 +548,7 @@ def user_is_an_admin?(user)
newuser = get_user(nick)
if (newuser)
if db_checkins_get(newuser[0])
total_checkins = db_user_checkins_count(user[0])
total_checkins = db_user_checkins_count(newuser[0])
give_points(nick, 14)
give_points(referrer, 10)
msg channel, "Welcome #{nick}! You & #{referrer} have been awarded 10 #{@botmaster} Points! You have also been checked in for 4 #{@botmaster} Points."
Expand Down

0 comments on commit ed5a81d

Please sign in to comment.