def delete(title, reason = nil)
      params = {
        action: 'delete',
        title: title,
        token: get_token
      }

      params[:reason] = reason unless reason.nil?

      response = post(params)
      return true if response['delete']
      raise MediaWiki::Butt::EditError.new(response.dig('error', 'code') || 'Unknown error code')
    end
def delete(title, reason = nil)
      params = {
        action: 'delete',
        title: title,
        token: get_token
      }

      params[:reason] = reason unless reason.nil?

      response = post(params)
      return true if response['delete']
      raise MediaWiki::Butt::EditError.new(response.dig('error', 'code') || 'Unknown error code')
    end
Deletes a page.
 @param title [String] The page to delete.
 @param reason [String] The reason to be displayed in logs. Optional.
 @see https://www.mediawiki.org/wiki/API:Changing_wiki_content Changing wiki content on the MediaWiki API
   documentation
 @see https://www.mediawiki.org/wiki/API:Delete MediaWiki Delete API Docs
 @since 0.5.0
 @raise [EditError]
 @return [Boolean] True if successful.