summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/core/utils/extends.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/rbot/core/utils/extends.rb b/lib/rbot/core/utils/extends.rb
index f3662395..11ebfc61 100644
--- a/lib/rbot/core/utils/extends.rb
+++ b/lib/rbot/core/utils/extends.rb
@@ -370,8 +370,17 @@ class ::String
"#{pre}#{self}#{post}"
end
end
-end
+ # Format a string using IRC colors
+ #
+ def colorformat
+ txt = self.dup
+
+ txt.gsub!(/\*([^\*]+)\*/, Bold + '\\1' + NormalText)
+
+ return txt
+ end
+end
# Extensions to the Regexp class, with some common and/or complex regular
# expressions.