diff --git a/lib/discordrb/errors.rb b/lib/discordrb/errors.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/errors.rb
+++ b/lib/discordrb/errors.rb
@@ -32,6 +32,11 @@ module Discordrb
       def initialize(message)
         @message = message
       end
+
+      # @return [Integer] The error code represented by this error.
+      def code
+        self.class.code
+      end
     end
 
     # Create a new code error class
Add a code reader to CodeError itself to be called on its subclasses' instances