 
 DPASTE_API_URL = "http://dpaste.com/api/v2/"
 PASTEBIN_API_URL = "http://pastebin.com/api/api_post.php"
-SERVER_ERROR = "We are unable to process your request at this time due to a server error. Please try again later."
+
+DEF_SERVER_ERROR = "We are unable to process your request at this time due to a server error. Please try again later."
+DEF_CREDIT = "Generated by ClaudeBot's hubot-paste"
 
 class Paste
     constructor: (@msg) ->
 
     create: (err, link) ->
         if err
-            @msg.reply SERVER_ERROR
+            @msg.reply DEF_SERVER_ERROR
             return @msg.robot.logger.error err
         @msg.reply link
 
 class Dpaste extends Paste
     create: (text, expire = 1) ->
         data = "content=#{encodeURI(text)}&expiry_days=#{expire}"
-        data += "&poster=#{robot.name}&title=Generated%20by%20ClaudeBot%27s%20hubot-paste"
+        data += "&poster=#{@msg.robot.name}&title=#{encodeURI(DEF_CREDIT)}"
 
         @msg.http(DPASTE_API_URL)
             .header("content-type", "application/x-www-form-urlencoded")

#   Universal Paste API (Dpaste.com and Pastebin.com)
#
# Configuration:
#   
#
# Commands:
#   hubot dpaste <content> - Creates a new paste with <content> on Dpaste.com

        robot.respond /pastebin (.+)/i, (msg) ->
            service = new Pastebin msg
            service.create msg.match[1]
    else
        robot.logger.warning "Missing PASTEBIN_API_KEY in environment. Pastebin services will not be available."
