Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Cool Fire
nanobot4
Commits
56580044
Commit
56580044
authored
Feb 19, 2018
by
Cool Fire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little cleanup
parent
dba5a075
Pipeline
#535
passed with stages
in 7 minutes
Changes
35
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
186 additions
and
193 deletions
+186
-193
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
commands.rb
commands.rb
+6
-6
plugins/btc.rb
plugins/btc.rb
+9
-9
plugins/calc.rb
plugins/calc.rb
+2
-2
plugins/core.rb
plugins/core.rb
+19
-19
plugins/ddg.rb
plugins/ddg.rb
+1
-1
plugins/debug.rb
plugins/debug.rb
+5
-5
plugins/delay.rb
plugins/delay.rb
+3
-3
plugins/demo.rb
plugins/demo.rb
+10
-10
plugins/dogecoin.rb
plugins/dogecoin.rb
+2
-2
plugins/git.rb
plugins/git.rb
+3
-3
plugins/hackerthreads.rb
plugins/hackerthreads.rb
+1
-1
plugins/identified.rb
plugins/identified.rb
+3
-3
plugins/kamikaze.rb
plugins/kamikaze.rb
+1
-1
plugins/login.rb
plugins/login.rb
+2
-2
plugins/ltc.rb
plugins/ltc.rb
+2
-2
plugins/memo.rb
plugins/memo.rb
+5
-5
plugins/mibs.rb
plugins/mibs.rb
+5
-5
plugins/netsplit.rb
plugins/netsplit.rb
+4
-4
plugins/paste.rb
plugins/paste.rb
+2
-2
plugins/search.rb
plugins/search.rb
+3
-3
plugins/seen.old.rb
plugins/seen.old.rb
+9
-9
plugins/seen.rb
plugins/seen.rb
+10
-10
plugins/shells.rb
plugins/shells.rb
+18
-18
plugins/socketmessage.rb
plugins/socketmessage.rb
+1
-1
plugins/svn.rb
plugins/svn.rb
+3
-3
plugins/tinyurl.rb
plugins/tinyurl.rb
+1
-1
plugins/title.rb
plugins/title.rb
+3
-3
plugins/toolbox.rb
plugins/toolbox.rb
+13
-13
plugins/topic.rb
plugins/topic.rb
+6
-6
plugins/tracker.rb
plugins/tracker.rb
+3
-3
plugins/translate.rb
plugins/translate.rb
+3
-3
plugins/twit.rb
plugins/twit.rb
+21
-27
plugins/youtube.rb
plugins/youtube.rb
+5
-5
startup.rb
startup.rb
+1
-2
No files found.
.gitlab-ci.yml
View file @
56580044
...
@@ -73,4 +73,4 @@ rubocop:
...
@@ -73,4 +73,4 @@ rubocop:
-
ruby
-
ruby
script
:
script
:
-
gem install rubocop --no-ri --no-rdoc
-
gem install rubocop --no-ri --no-rdoc
-
rubocop -l -f simple --except
UnusedMethodArgument,
RescueException,Eval,AssignmentInCondition,ScriptPermission
-
rubocop -l -f simple --except RescueException,Eval,AssignmentInCondition,ScriptPermission
commands.rb
View file @
56580044
...
@@ -123,7 +123,7 @@ class Commands
...
@@ -123,7 +123,7 @@ class Commands
end
end
# Quit command
# Quit command
def
quit
(
nick
,
user
,
host
,
from
,
msg
)
def
quit
(
_
nick
,
_
user
,
host
,
_
from
,
msg
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
con
)
if
(
con
)
@output
.
cbad
(
"This will also stop the bot, are you sure? [y/N]: "
)
@output
.
cbad
(
"This will also stop the bot, are you sure? [y/N]: "
)
...
@@ -153,7 +153,7 @@ class Commands
...
@@ -153,7 +153,7 @@ class Commands
end
end
# Load modules
# Load modules
def
load
(
nick
,
user
,
host
,
from
,
msg
,
auto
=
false
)
def
load
(
nick
,
_
user
,
host
,
_
from
,
msg
,
auto
=
false
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
_cmd
,
plugin
=
msg
.
split
(
' '
,
2
)
_cmd
,
plugin
=
msg
.
split
(
' '
,
2
)
if
(
plugin
!=
nil
)
if
(
plugin
!=
nil
)
...
@@ -222,7 +222,7 @@ class Commands
...
@@ -222,7 +222,7 @@ class Commands
end
end
# Unload module
# Unload module
def
unload
(
nick
,
user
,
host
,
from
,
msg
)
def
unload
(
nick
,
_
user
,
host
,
_
from
,
msg
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
_cmd
,
plugin
=
msg
.
split
(
' '
,
2
)
_cmd
,
plugin
=
msg
.
split
(
' '
,
2
)
if
(
plugin
!=
nil
)
if
(
plugin
!=
nil
)
...
@@ -282,14 +282,14 @@ class Commands
...
@@ -282,14 +282,14 @@ class Commands
end
end
# Meta funcion to load autoload modules
# Meta funcion to load autoload modules
def
autoload
(
nick
=
nil
,
user
=
nil
,
host
=
nil
,
from
=
nil
,
msg
=
nil
)
def
autoload
(
_
nick
=
nil
,
_
user
=
nil
,
_
host
=
nil
,
_
from
=
nil
,
_
msg
=
nil
)
@config
.
autoload
.
each
do
|
mod
|
@config
.
autoload
.
each
do
|
mod
|
load
(
nil
,
nil
,
nil
,
nil
,
"dummy "
+
mod
,
true
)
load
(
nil
,
nil
,
nil
,
nil
,
"dummy "
+
mod
,
true
)
end
end
end
end
# Function to get list of loaded modules
# Function to get list of loaded modules
def
loaded
(
nick
,
user
,
host
,
from
,
msg
)
def
loaded
(
nick
,
_
user
,
_
host
,
_
from
,
_
msg
)
if
(
con
)
if
(
con
)
@output
.
c
(
"Loaded plugins: "
)
@output
.
c
(
"Loaded plugins: "
)
@status
.
plugins
.
each_key
do
|
plugin_name
|
@status
.
plugins
.
each_key
do
|
plugin_name
|
...
@@ -308,7 +308,7 @@ class Commands
...
@@ -308,7 +308,7 @@ class Commands
end
end
# Function to list available modules
# Function to list available modules
def
available
(
nick
,
user
,
host
,
from
,
msg
)
def
available
(
nick
,
_
user
,
_
host
,
_
from
,
_
msg
)
contents
=
Dir
.
entries
(
"./"
+
@config
.
plugindir
+
"/"
)
contents
=
Dir
.
entries
(
"./"
+
@config
.
plugindir
+
"/"
)
plugs
=
Array
.
new
plugs
=
Array
.
new
contents
.
entries
.
each
do
|
file
|
contents
.
entries
.
each
do
|
file
|
...
...
plugins/btc.rb
View file @
56580044
...
@@ -22,7 +22,7 @@ class Btc
...
@@ -22,7 +22,7 @@ class Btc
@bits_last
=
0.0
@bits_last
=
0.0
end
end
def
main
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
main
(
_
nick
,
_
user
,
_
host
,
from
,
_
msg
,
_
arguments
,
con
)
uri
=
URI
.
parse
(
"https://
#{
@bits_host
}#{
@bits_path
}
"
)
uri
=
URI
.
parse
(
"https://
#{
@bits_host
}#{
@bits_path
}
"
)
http
=
Net
::
HTTP
.
new
(
uri
.
host
,
uri
.
port
)
http
=
Net
::
HTTP
.
new
(
uri
.
host
,
uri
.
port
)
...
@@ -63,7 +63,7 @@ class Btc
...
@@ -63,7 +63,7 @@ class Btc
end
end
# Get current value
# Get current value
def
mtgox
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
mtgox
(
_
nick
,
_
user
,
_
host
,
from
,
_
msg
,
_
arguments
,
con
)
uri
=
URI
.
parse
(
"https://
#{
@api_host
}#{
@api_path
}
"
)
uri
=
URI
.
parse
(
"https://
#{
@api_host
}#{
@api_path
}
"
)
http
=
Net
::
HTTP
.
new
(
uri
.
host
,
uri
.
port
)
http
=
Net
::
HTTP
.
new
(
uri
.
host
,
uri
.
port
)
...
@@ -139,7 +139,7 @@ class Btc
...
@@ -139,7 +139,7 @@ class Btc
end
end
end
end
# Get last value
# Get last value
def
last
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
last
(
_
nick
,
_
user
,
_
host
,
from
,
_
msg
,
_
arguments
,
con
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@bits_host
,
@bits_path
)
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@bits_host
,
@bits_path
)
)
line
=
"
#{
result
[
'last'
]
}
"
line
=
"
#{
result
[
'last'
]
}
"
...
@@ -152,7 +152,7 @@ class Btc
...
@@ -152,7 +152,7 @@ class Btc
end
end
# Get buy price
# Get buy price
def
buy
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
buy
(
_
nick
,
_
user
,
_
host
,
from
,
_
msg
,
_
arguments
,
con
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@bits_host
,
@bits_path
)
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@bits_host
,
@bits_path
)
)
line
=
"Bitstamp will buy your bitcoins for
#{
result
[
'bid'
]
}
"
line
=
"Bitstamp will buy your bitcoins for
#{
result
[
'bid'
]
}
"
...
@@ -165,7 +165,7 @@ class Btc
...
@@ -165,7 +165,7 @@ class Btc
end
end
# Get sell price
# Get sell price
def
sell
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
sell
(
_
nick
,
_
user
,
_
host
,
from
,
_
msg
,
_
arguments
,
con
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@bits_host
,
@bits_path
)
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@bits_host
,
@bits_path
)
)
line
=
"Bitstamp will sell you bitcoins for
#{
result
[
'ask'
]
}
"
line
=
"Bitstamp will sell you bitcoins for
#{
result
[
'ask'
]
}
"
...
@@ -178,7 +178,7 @@ class Btc
...
@@ -178,7 +178,7 @@ class Btc
end
end
# Get last value
# Get last value
def
mtgoxlast
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
mtgoxlast
(
_
nick
,
_
user
,
_
host
,
from
,
_
msg
,
_
arguments
,
con
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@api_host
,
@api_path
)
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@api_host
,
@api_path
)
)
if
(
result
[
"result"
]
!=
"success"
)
if
(
result
[
"result"
]
!=
"success"
)
...
@@ -196,7 +196,7 @@ class Btc
...
@@ -196,7 +196,7 @@ class Btc
end
end
# Get buy price
# Get buy price
def
mtgoxbuy
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
mtgoxbuy
(
_
nick
,
_
user
,
_
host
,
from
,
_
msg
,
_
arguments
,
con
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@api_host
,
@api_path
)
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@api_host
,
@api_path
)
)
if
(
result
[
"result"
]
!=
"success"
)
if
(
result
[
"result"
]
!=
"success"
)
...
@@ -214,7 +214,7 @@ class Btc
...
@@ -214,7 +214,7 @@ class Btc
end
end
# Get sell price
# Get sell price
def
mtgoxsell
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
mtgoxsell
(
_
nick
,
_
user
,
_
host
,
from
,
_
msg
,
_
arguments
,
con
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@api_host
,
@api_path
)
)
result
=
JSON
.
parse
(
Net
::
HTTP
.
get
(
@api_host
,
@api_path
)
)
if
(
result
[
"result"
]
!=
"success"
)
if
(
result
[
"result"
]
!=
"success"
)
...
@@ -232,7 +232,7 @@ class Btc
...
@@ -232,7 +232,7 @@ class Btc
end
end
# Function to send help about this plugin (Can also be called by the help plugin.)
# Function to send help about this plugin (Can also be called by the help plugin.)
def
help
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
help
(
nick
,
_
user
,
_
host
,
_
from
,
_
msg
,
_
arguments
,
con
)
help
=
[
help
=
[
"Gets current values from mtgox"
,
"Gets current values from mtgox"
,
" btc - Get bitstamp exchange rate (buying rate)"
,
" btc - Get bitstamp exchange rate (buying rate)"
,
...
...
plugins/calc.rb
View file @
56580044
...
@@ -13,7 +13,7 @@ class Calc
...
@@ -13,7 +13,7 @@ class Calc
end
end
# Default method, called when no argument is given (optional, but highly recomended)
# Default method, called when no argument is given (optional, but highly recomended)
def
main
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
main
(
_
nick
,
_
user
,
_
host
,
from
,
_
msg
,
arguments
,
_
con
)
# Check for invalid input
# Check for invalid input
if
(
arguments
=~
/^([0-9]|\.|,|\+|-|\*|\^|\/|%|\(|\)|E|pi|acos|acosh|asin|asinh|atan|atanh|cbrt|cos|cosh|erf|erfc|exp|frexp|gamma|hypot|ldexp|lgamma|log|sin|sinh|sqrt|tan|tanh| )+$/i
)
if
(
arguments
=~
/^([0-9]|\.|,|\+|-|\*|\^|\/|%|\(|\)|E|pi|acos|acosh|asin|asinh|atan|atanh|cbrt|cos|cosh|erf|erfc|exp|frexp|gamma|hypot|ldexp|lgamma|log|sin|sinh|sqrt|tan|tanh| )+$/i
)
...
@@ -77,7 +77,7 @@ class Calc
...
@@ -77,7 +77,7 @@ class Calc
end
end
# Function to send help about this plugin (Can also be called by the help plugin.)
# Function to send help about this plugin (Can also be called by the help plugin.)
def
help
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
help
(
nick
,
_
user
,
_
host
,
_
from
,
_
msg
,
_
arguments
,
con
)
help
=
[
help
=
[
"This plugin allows you to do some math."
,
"This plugin allows you to do some math."
,
" calc 5*5 - Do some calculation."
,
" calc 5*5 - Do some calculation."
,
...
...
plugins/core.rb
View file @
56580044
...
@@ -11,7 +11,7 @@ class Core
...
@@ -11,7 +11,7 @@ class Core
end
end
# Messaging commands
# Messaging commands
def
message
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
message
(
nick
,
_
user
,
host
,
_
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
to
,
message
=
arguments
.
split
(
' '
,
2
)
to
,
message
=
arguments
.
split
(
' '
,
2
)
...
@@ -29,7 +29,7 @@ class Core
...
@@ -29,7 +29,7 @@ class Core
end
end
end
end
def
raw
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
raw
(
nick
,
_
user
,
host
,
_
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
@irc
.
raw
(
arguments
)
@irc
.
raw
(
arguments
)
...
@@ -43,7 +43,7 @@ class Core
...
@@ -43,7 +43,7 @@ class Core
end
end
end
end
def
action
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
action
(
nick
,
_
user
,
host
,
_
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
to
,
action
=
arguments
.
split
(
' '
,
2
)
to
,
action
=
arguments
.
split
(
' '
,
2
)
...
@@ -61,7 +61,7 @@ class Core
...
@@ -61,7 +61,7 @@ class Core
end
end
end
end
def
notice
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
notice
(
nick
,
_
user
,
host
,
_
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
to
,
message
=
arguments
.
split
(
' '
,
2
)
to
,
message
=
arguments
.
split
(
' '
,
2
)
...
@@ -80,7 +80,7 @@ class Core
...
@@ -80,7 +80,7 @@ class Core
end
end
# Join/part commands
# Join/part commands
def
join
(
nick
,
user
,
host
,
from
,
msg
,
chan
,
con
)
def
join
(
nick
,
_
user
,
host
,
_
from
,
_
msg
,
chan
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
chan
.
nil?
&&
!
chan
.
empty?
)
if
(
!
chan
.
nil?
&&
!
chan
.
empty?
)
@irc
.
join
(
chan
)
@irc
.
join
(
chan
)
...
@@ -94,7 +94,7 @@ class Core
...
@@ -94,7 +94,7 @@ class Core
end
end
end
end
def
part
(
nick
,
user
,
host
,
from
,
msg
,
chan
,
con
)
def
part
(
nick
,
_
user
,
host
,
_
from
,
_
msg
,
chan
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
chan
.
nil?
&&
!
chan
.
empty?
)
if
(
!
chan
.
nil?
&&
!
chan
.
empty?
)
@irc
.
part
(
chan
)
@irc
.
part
(
chan
)
...
@@ -109,7 +109,7 @@ class Core
...
@@ -109,7 +109,7 @@ class Core
end
end
# Mode command
# Mode command
def
mode
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
mode
(
nick
,
_
user
,
host
,
_
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
arguments
==
nil
)
if
(
arguments
==
nil
)
arguments
=
""
arguments
=
""
...
@@ -134,7 +134,7 @@ class Core
...
@@ -134,7 +134,7 @@ class Core
end
end
# Oper commands
# Oper commands
def
op
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
op
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
arguments
==
nil
)
if
(
arguments
==
nil
)
arguments
=
""
arguments
=
""
...
@@ -161,7 +161,7 @@ class Core
...
@@ -161,7 +161,7 @@ class Core
end
end
end
end
def
deop
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
deop
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
arguments
==
nil
)
if
(
arguments
==
nil
)
arguments
=
""
arguments
=
""
...
@@ -189,7 +189,7 @@ class Core
...
@@ -189,7 +189,7 @@ class Core
end
end
# Half-oper commands
# Half-oper commands
def
hop
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
hop
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
arguments
==
nil
)
if
(
arguments
==
nil
)
arguments
=
""
arguments
=
""
...
@@ -216,7 +216,7 @@ class Core
...
@@ -216,7 +216,7 @@ class Core
end
end
end
end
def
dehop
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
dehop
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
arguments
==
nil
)
if
(
arguments
==
nil
)
arguments
=
""
arguments
=
""
...
@@ -244,7 +244,7 @@ class Core
...
@@ -244,7 +244,7 @@ class Core
end
end
# Voice commands
# Voice commands
def
voice
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
voice
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
arguments
==
nil
)
if
(
arguments
==
nil
)
arguments
=
""
arguments
=
""
...
@@ -271,7 +271,7 @@ class Core
...
@@ -271,7 +271,7 @@ class Core
end
end
end
end
def
devoice
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
devoice
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
arguments
==
nil
)
if
(
arguments
==
nil
)
arguments
=
""
arguments
=
""
...
@@ -299,7 +299,7 @@ class Core
...
@@ -299,7 +299,7 @@ class Core
end
end
# Kick commands
# Kick commands
def
kick
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
kick
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
arguments
=~
/^#/
)
if
(
arguments
=~
/^#/
)
...
@@ -325,7 +325,7 @@ class Core
...
@@ -325,7 +325,7 @@ class Core
end
end
# Banning commands
# Banning commands
def
ban
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
ban
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
chan
,
host
=
arguments
.
split
(
' '
,
2
)
chan
,
host
=
arguments
.
split
(
' '
,
2
)
...
@@ -346,7 +346,7 @@ class Core
...
@@ -346,7 +346,7 @@ class Core
end
end
end
end
def
unban
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
unban
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
chan
,
host
=
arguments
.
split
(
' '
,
2
)
chan
,
host
=
arguments
.
split
(
' '
,
2
)
...
@@ -367,7 +367,7 @@ class Core
...
@@ -367,7 +367,7 @@ class Core
end
end
end
end
def
timeban
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
timeban
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
threads
&&
@status
.
threads
)
if
(
@config
.
threads
&&
@status
.
threads
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
...
@@ -415,7 +415,7 @@ class Core
...
@@ -415,7 +415,7 @@ class Core
end
end
# Echo uptime to the user
# Echo uptime to the user
def
uptime
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
uptime
(
nick
,
_
user
,
_
host
,
_
from
,
_
msg
,
_
arguments
,
con
)
uptime
=
"Uptime: "
+
@status
.
uptime
+
"."
uptime
=
"Uptime: "
+
@status
.
uptime
+
"."
if
(
con
)
if
(
con
)
@output
.
cinfo
(
uptime
)
@output
.
cinfo
(
uptime
)
...
@@ -424,7 +424,7 @@ class Core
...
@@ -424,7 +424,7 @@ class Core
end
end
end
end
def
nick
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
nick
(
_
nick
,
_
user
,
host
,
_
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
@config
.
nick
(
arguments
)
@config
.
nick
(
arguments
)
...
...
plugins/ddg.rb
View file @
56580044
...
@@ -15,7 +15,7 @@ class Ddg
...
@@ -15,7 +15,7 @@ class Ddg
end
end
# Method that receives a notification when a user joins (optional)
# Method that receives a notification when a user joins (optional)
def
joined
(
nick
,
user
,
host
,
channel
)
def
joined
(
nick
,
_
user
,
_
host
,
channel
)
if
(
channel
==
@channel
)
if
(
channel
==
@channel
)
@irc
.
mode
(
channel
,
"+v"
,
nick
,
true
)
@irc
.
mode
(
channel
,
"+v"
,
nick
,
true
)
end
end
...
...
plugins/debug.rb
View file @
56580044
...
@@ -18,7 +18,7 @@ class Debug
...
@@ -18,7 +18,7 @@ class Debug
end
end
# Function to send help about this plugin (Can also be called by the help plugin.)
# Function to send help about this plugin (Can also be called by the help plugin.)
def
help
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
help
(
nick
,
_
user
,
_
host
,
_
from
,
_
msg
,
_
arguments
,
con
)
help
=
[
help
=
[
"Plugin to help with debugging."
,
"Plugin to help with debugging."
,
" debug threadlist - Print list of threads to console."
,
" debug threadlist - Print list of threads to console."
,
...
@@ -38,7 +38,7 @@ class Debug
...
@@ -38,7 +38,7 @@ class Debug
end
end
# Show backtrace of specific thread
# Show backtrace of specific thread
def
threadtrace
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
threadtrace
(
_
nick
,
_
user
,
_
host
,
_
from
,
_
msg
,
arguments
,
_
con
)
Thread
.
list
.
each
do
|
thr
|
Thread
.
list
.
each
do
|
thr
|
if
(
thr
.
to_s
=~
/
#{
arguments
}
/
)
if
(
thr
.
to_s
=~
/
#{
arguments
}
/
)
thr
.
backtrace
.
each
do
|
level
|
thr
.
backtrace
.
each
do
|
level
|
...
@@ -51,7 +51,7 @@ class Debug
...
@@ -51,7 +51,7 @@ class Debug
# List all threads + status
# List all threads + status
def
threadlist
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
threadlist
(
_
nick
,
_
user
,
_
host
,
_
from
,
_
msg
,
_
arguments
,
_
con
)
Thread
.
list
.
each
do
|
thr
|
Thread
.
list
.
each
do
|
thr
|
@output
.
info
(
"
#{
thr
.
inspect
}
\n
"
)
@output
.
info
(
"
#{
thr
.
inspect
}
\n
"
)
end
end
...
@@ -59,7 +59,7 @@ class Debug
...
@@ -59,7 +59,7 @@ class Debug
end
end
# Kill thread
# Kill thread
def
threadkill
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
threadkill
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
Thread
.
list
.
each
do
|
thr
|
Thread
.
list
.
each
do
|
thr
|
if
(
thr
.
to_s
=~
/
#{
arguments
}
/
)
if
(
thr
.
to_s
=~
/
#{
arguments
}
/
)
...
@@ -72,7 +72,7 @@ class Debug
...
@@ -72,7 +72,7 @@ class Debug
end
end
# Set debug level
# Set debug level
def
level
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
level
(
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
@status
.
debug
(
arguments
.
to_i
)
@status
.
debug
(
arguments
.
to_i
)
@irc
.
notice
(
nick
,
"Set debug level to
#{
arguments
}
"
)
@irc
.
notice
(
nick
,
"Set debug level to
#{
arguments
}
"
)
...
...
plugins/delay.rb
View file @
56580044
...
@@ -14,12 +14,12 @@ class Delay
...
@@ -14,12 +14,12 @@ class Delay
end
end
# Default method
# Default method
def
main
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
main
(
nick
,
_
user
,
_
host
,
_
from
,
_
msg
,
_
arguments
,
_
con
)
@irc
.
notice
(
nick
,
"Use 'ruby' or 'irc' as the method."
)
@irc
.
notice
(
nick
,
"Use 'ruby' or 'irc' as the method."
)
end
end
# Function to send help about this plugin (Can also be called by the help plugin.)
# Function to send help about this plugin (Can also be called by the help plugin.)
def
help
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
help
(
nick
,
_
user
,
_
host
,
_
from
,
_
msg
,
_
arguments
,
con
)
help
=
[
help
=
[
"This plugin to delay actions."
,
"This plugin to delay actions."
,
" delay ruby [seconds] [action] - Set ruby command to be carried out later."
" delay ruby [seconds] [action] - Set ruby command to be carried out later."
...
@@ -36,7 +36,7 @@ class Delay
...
@@ -36,7 +36,7 @@ class Delay
end
end
# Functions to do delayed actions
# Functions to do delayed actions
def
ruby
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
ruby
(
_
nick
,
_
user
,
host
,
from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
arguments
.
nil?
&&
!