ddg.rb 496 Bytes
Newer Older
Cool Fire's avatar
Cool Fire committed
1 2 3 4 5 6 7
#!/usr/bin/env ruby

# Plugin to do autovoice in #ddg
class Ddg

	# This method is called when the plugin is first loaded
	def initialize( status, config, output, irc, timer )
8 9 10 11 12
		@status  = status
		@config  = config
		@output  = output
		@irc     = irc
		@timer   = timer
Cool Fire's avatar
Cool Fire committed
13

14
		@channel = "#ddg"
Cool Fire's avatar
Cool Fire committed
15 16 17
	end
	
	# Method that receives a notification when a user joins (optional)
Cool Fire's avatar
Cool Fire committed
18
	def joined( nick, _user, _host, channel )
Cool Fire's avatar
Cool Fire committed
19
		if( channel == @channel )
20
			@irc.mode( channel, "+v" ,nick, true )
Cool Fire's avatar
Cool Fire committed
21 22 23
		end
	end
end