Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nanobot4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
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:
-
ruby
script
:
-
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
end
# Quit command
def
quit
(
nick
,
user
,
host
,
from
,
msg
)
def
quit
(
_nick
,
_user
,
host
,
_
from
,
msg
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
con
)
@output
.
cbad
(
"This will also stop the bot, are you sure? [y/N]: "
)
...
...
@@ -153,7 +153,7 @@ class Commands
end
# 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
)
)
_cmd
,
plugin
=
msg
.
split
(
' '
,
2
)
if
(
plugin
!=
nil
)
...
...
@@ -222,7 +222,7 @@ class Commands
end
# Unload module
def
unload
(
nick
,
user
,
host
,
from
,
msg
)
def
unload
(
nick
,
_user
,
host
,
_
from
,
msg
)
if
(
@config
.
auth
(
host
,
con
)
)
_cmd
,
plugin
=
msg
.
split
(
' '
,
2
)
if
(
plugin
!=
nil
)
...
...
@@ -282,14 +282,14 @@ class Commands
end
# 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
|
load
(
nil
,
nil
,
nil
,
nil
,
"dummy "
+
mod
,
true
)
end
end
# Function to get list of loaded modules
def
loaded
(
nick
,
user
,
host
,
from
,
msg
)
def
loaded
(
nick
,
_user
,
_host
,
_from
,
_
msg
)
if
(
con
)
@output
.
c
(
"Loaded plugins: "
)
@status
.
plugins
.
each_key
do
|
plugin_name
|
...
...
@@ -308,7 +308,7 @@ class Commands
end
# Function to list available modules
def
available
(
nick
,
user
,
host
,
from
,
msg
)
def
available
(
nick
,
_user
,
_host
,
_from
,
_
msg
)
contents
=
Dir
.
entries
(
"./"
+
@config
.
plugindir
+
"/"
)
plugs
=
Array
.
new
contents
.
entries
.
each
do
|
file
|
...
...
plugins/btc.rb
View file @
56580044
...
...
@@ -22,7 +22,7 @@ class Btc
@bits_last
=
0.0
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
}
"
)
http
=
Net
::
HTTP
.
new
(
uri
.
host
,
uri
.
port
)
...
...
@@ -63,7 +63,7 @@ class Btc
end
# 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
}
"
)
http
=
Net
::
HTTP
.
new
(
uri
.
host
,
uri
.
port
)
...
...
@@ -139,7 +139,7 @@ class Btc
end
end
# 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
)
)
line
=
"
#{
result
[
'last'
]
}
"
...
...
@@ -152,7 +152,7 @@ class Btc
end
# 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
)
)
line
=
"Bitstamp will buy your bitcoins for
#{
result
[
'bid'
]
}
"
...
...
@@ -165,7 +165,7 @@ class Btc
end
# 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
)
)
line
=
"Bitstamp will sell you bitcoins for
#{
result
[
'ask'
]
}
"
...
...
@@ -178,7 +178,7 @@ class Btc
end
# 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
)
)
if
(
result
[
"result"
]
!=
"success"
)
...
...
@@ -196,7 +196,7 @@ class Btc
end
# 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
)
)
if
(
result
[
"result"
]
!=
"success"
)
...
...
@@ -214,7 +214,7 @@ class Btc
end
# 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
)
)
if
(
result
[
"result"
]
!=
"success"
)
...
...
@@ -232,7 +232,7 @@ class Btc
end
# 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
=
[
"Gets current values from mtgox"
,
" btc - Get bitstamp exchange rate (buying rate)"
,
...
...
plugins/calc.rb
View file @
56580044
...
...
@@ -13,7 +13,7 @@ class Calc
end
# 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
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
end
# 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
=
[
"This plugin allows you to do some math."
,
" calc 5*5 - Do some calculation."
,
...
...
plugins/core.rb
View file @
56580044
...
...
@@ -11,7 +11,7 @@ class Core
end
# 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
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
to
,
message
=
arguments
.
split
(
' '
,
2
)
...
...
@@ -29,7 +29,7 @@ class Core
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
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
@irc
.
raw
(
arguments
)
...
...
@@ -43,7 +43,7 @@ class Core
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
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
to
,
action
=
arguments
.
split
(
' '
,
2
)
...
...
@@ -61,7 +61,7 @@ class Core
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
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
to
,
message
=
arguments
.
split
(
' '
,
2
)
...
...
@@ -80,7 +80,7 @@ class Core
end
# 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
(
!
chan
.
nil?
&&
!
chan
.
empty?
)
@irc
.
join
(
chan
)
...
...
@@ -94,7 +94,7 @@ class Core
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
(
!
chan
.
nil?
&&
!
chan
.
empty?
)
@irc
.
part
(
chan
)
...
...
@@ -109,7 +109,7 @@ class Core
end
# 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
(
arguments
==
nil
)
arguments
=
""
...
...
@@ -134,7 +134,7 @@ class Core
end
# 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
(
arguments
==
nil
)
arguments
=
""
...
...
@@ -161,7 +161,7 @@ class Core
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
(
arguments
==
nil
)
arguments
=
""
...
...
@@ -189,7 +189,7 @@ class Core
end
# 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
(
arguments
==
nil
)
arguments
=
""
...
...
@@ -216,7 +216,7 @@ class Core
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
(
arguments
==
nil
)
arguments
=
""
...
...
@@ -244,7 +244,7 @@ class Core
end
# 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
(
arguments
==
nil
)
arguments
=
""
...
...
@@ -271,7 +271,7 @@ class Core
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
(
arguments
==
nil
)
arguments
=
""
...
...
@@ -299,7 +299,7 @@ class Core
end
# 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
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
if
(
arguments
=~
/^#/
)
...
...
@@ -325,7 +325,7 @@ class Core
end
# 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
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
chan
,
host
=
arguments
.
split
(
' '
,
2
)
...
...
@@ -346,7 +346,7 @@ class Core
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
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
chan
,
host
=
arguments
.
split
(
' '
,
2
)
...
...
@@ -367,7 +367,7 @@ class Core
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
.
threads
&&
@status
.
threads
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
...
...
@@ -415,7 +415,7 @@ class Core
end
# 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
+
"."
if
(
con
)
@output
.
cinfo
(
uptime
)
...
...
@@ -424,7 +424,7 @@ class Core
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
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
@config
.
nick
(
arguments
)
...
...
plugins/ddg.rb
View file @
56580044
...
...
@@ -15,7 +15,7 @@ class Ddg
end
# 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
)
@irc
.
mode
(
channel
,
"+v"
,
nick
,
true
)
end
...
...
plugins/debug.rb
View file @
56580044
...
...
@@ -18,7 +18,7 @@ class Debug
end
# 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
=
[
"Plugin to help with debugging."
,
" debug threadlist - Print list of threads to console."
,
...
...
@@ -38,7 +38,7 @@ class Debug
end
# 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
|
if
(
thr
.
to_s
=~
/
#{
arguments
}
/
)
thr
.
backtrace
.
each
do
|
level
|
...
...
@@ -51,7 +51,7 @@ class Debug
# 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
|
@output
.
info
(
"
#{
thr
.
inspect
}
\n
"
)
end
...
...
@@ -59,7 +59,7 @@ class Debug
end
# 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
)
)
Thread
.
list
.
each
do
|
thr
|
if
(
thr
.
to_s
=~
/
#{
arguments
}
/
)
...
...
@@ -72,7 +72,7 @@ class Debug
end
# 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
)
)
@status
.
debug
(
arguments
.
to_i
)
@irc
.
notice
(
nick
,
"Set debug level to
#{
arguments
}
"
)
...
...
plugins/delay.rb
View file @
56580044
...
...
@@ -14,12 +14,12 @@ class Delay
end
# 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."
)
end
# 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
=
[
"This plugin to delay actions."
,
" delay ruby [seconds] [action] - Set ruby command to be carried out later."
...
...
@@ -36,7 +36,7 @@ class Delay
end
# 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
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
delay
,
action
=
arguments
.
split
(
' '
,
2
)
...
...
plugins/demo.rb
View file @
56580044
...
...
@@ -20,39 +20,39 @@ class Demo
end
# 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
)
@irc
.
message
(
from
,
"This is the demo module, function, function_admin and remote are availble."
)
end
# Method that receives a notification when a user is kicked (optional)
def
kicked
(
nick
,
user
,
host
,
channel
,
kicked
,
reason
)
def
kicked
(
nick
,
_user
,
_
host
,
channel
,
kicked
,
reason
)
@irc
.
message
(
channel
,
kicked
+
" was kicked by "
+
nick
+
" for "
+
reason
+
"."
)
end
# Method that receives a notification when a notice is received (optional)
def
noticed
(
nick
,
user
,
host
,
to
,
message
)
def
noticed
(
nick
,
_user
,
_host
,
_
to
,
message
)
@irc
.
message
(
nick
,
"Received notice from: "
+
nick
+
": "
+
message
)
end
# Method that receives a notification when a message is received, that is not a command (optional)
def
messaged
(
nick
,
user
,
host
,
from
,
message
)
def
messaged
(
nick
,
_user
,
_
host
,
from
,
message
)
if
(
@config
.
nick
!=
nick
)
@irc
.
message
(
from
,
"Received message from: "
+
nick
+
": "
+
message
)
end
end
# Method that receives a notification when a user joins (optional)
def
joined
(
nick
,
user
,
host
,
channel
)
def
joined
(
nick
,
_user
,
_
host
,
channel
)
@irc
.
message
(
channel
,
nick
+
" joined "
+
channel
+
"."
)
end
# Method that receives a notification when a user parts (optional)
def
parted
(
nick
,
user
,
host
,
channel
)
def
parted
(
nick
,
_user
,
_
host
,
channel
)
@irc
.
message
(
channel
,
nick
+
" parted "
+
channel
+
"."
)
end
# Method that receives a notification when a user quits (optional)
def
quited
(
nick
,
user
,
host
,
message
)
def
quited
(
nick
,
_user
,
_
host
,
message
)
@output
.
std
(
nick
+
" quit: "
+
message
)
end
...
...
@@ -72,7 +72,7 @@ class Demo
end
# 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
=
[
"This plugin demonstrates the working of plugins."
,
" demo function - Public plugin function."
,
...
...
@@ -90,12 +90,12 @@ class Demo
end
# Generic function that can be called by any user
def
function
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
function
(
nick
,
_user
,
_host
,
from
,
_msg
,
_arguments
,
_
con
)
@irc
.
message
(
from
,
nick
+
" called
\"
function
\"
from "
+
from
+
"."
)
end
# Generic function that can only be called by an admin
def
functionadmin
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
functionadmin
(
nick
,
_user
,
host
,
from
,
_msg
,
_
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
# Admin only code goes in here
@irc
.
message
(
from
,
nick
+
" called
\"
function_admin
\"
from "
+
from
+
"."
)
...
...
plugins/dogecoin.rb
View file @
56580044
...
...
@@ -21,7 +21,7 @@ class Dogecoin
end
# Alias for last
def
main
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
main
(
_nick
,
_user
,
_host
,
from
,
_msg
,
_
arguments
,
con
)
uri
=
URI
.
parse
(
"http://
#{
@api_host
}#{
@api_path
}
"
)
http
=
Net
::
HTTP
.
new
(
uri
.
host
,
uri
.
port
)
...
...
@@ -54,7 +54,7 @@ class Dogecoin
end
# 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
=
[
"Gets current litecoin values from Btc-e"
,
" dogecoin - Get DOGE/BTC exchange rate"
...
...
plugins/git.rb
View file @
56580044
...
...
@@ -18,7 +18,7 @@ class Git
end
# 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
=
[
"This plugin allows you to pull updates from a git repo."
,
"Will only work if you cloned the bot from git."
,
...
...
@@ -37,7 +37,7 @@ class Git
end
# Pull updates from server
def
pull
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
pull
(
nick
,
_user
,
host
,
_from
,
_msg
,
_
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
res
=
%x( git pull )
.
gsub!
(
"
\n
"
,
" "
)
@irc
.
notice
(
nick
,
"
#{
res
}
"
)
...
...
@@ -45,7 +45,7 @@ class Git
end
# Show some output and status
def
status
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
status
(
nick
,
_user
,
_host
,
_from
,
_msg
,
_arguments
,
_
con
)
branch
=
%x( git branch | head -n 1 | awk '{print $2}' )
status
=
%x( git fetch -v --dry-run 2>&1 >/dev/null | grep
#{
branch
}
)
...
...
plugins/hackerthreads.rb
View file @
56580044
...
...
@@ -47,7 +47,7 @@ class Hackerthreads
end
# Default method
def
main
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
main
(
_nick
,
_user
,
_host
,
_from
,
_msg
,
_arguments
,
_
con
)
check_rss
end
private
...
...
plugins/identified.rb
View file @
56580044
...
...
@@ -15,14 +15,14 @@ class Identified
end
# 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
)
@irc
.
message
(
"NickServ"
,
"status "
+
nick
)
end
end
# Method that receives a notification when a notice is received (optional)
def
noticed
(
nick
,
user
,
host
,
to
,
message
)
def
noticed
(
nick
,
_user
,
_host
,
_
to
,
message
)
nick
.
downcase!
if
(
nick
==
"nickserv"
)
_cmd
,
subject
,
status
=
message
.
split
(
' '
,
3
)
...
...
@@ -34,7 +34,7 @@ class Identified
end
# 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
)
if
(
con
)
@output
.
c
(
"Plugin to voice users that have identified with NickServ.
\n
"
)
else
...
...
plugins/kamikaze.rb
View file @
56580044
...
...
@@ -37,7 +37,7 @@ class Kamikaze
end
# Help method
def
help
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
help
(
nick
,
_user
,
_host
,
_from
,
_msg
,
_
arguments
,
con
)
help
=
[
"This module provides the ability to kick other users, but at a terrible price!"
,
" kamikaze [user] - Kick a user."
,
...
...
plugins/login.rb
View file @
56580044
...
...
@@ -50,7 +50,7 @@ class Login
end
# Function to set password
def
set
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
set
(
_nick
,
_user
,
host
,
_from
,
_
msg
,
arguments
,
con
)
if
(
@config
.
auth
(
host
,
con
)
)
if
(
!
arguments
.
nil?
&&
!
arguments
.
empty?
)
@password
=
BCrypt
::
Password
.
create
arguments
...
...
@@ -60,7 +60,7 @@ class Login
end
# 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
=
[
"This plugin allows users to log in with a password when their hostmask is not in the oper list."
,
" login [password] - Login with password."
,
...
...
plugins/ltc.rb
View file @
56580044
...
...
@@ -20,7 +20,7 @@ class Ltc
end
# Alias for last
def
main
(
nick
,
user
,
host
,
from
,
msg
,
arguments
,
con
)
def
main
(
_nick
,
_user
,
_host
,
from
,
_msg
,
_
arguments
,
con
)