def edit(title, text, opts = {})
      opts[:bot] = opts.key?(:bot) ? opts[:bot] : true
      params = {
        action: 'edit',
        title: title,
        text: text,
        nocreate: 1,
        format: 'json',
        token: get_token
      }

      params[:summary] ||= opts[:summary]
      params[:minor] = '1' if opts[:minor]
      params[:bot] = '1' if opts[:bot]

      response = post(params)

      if response.dig('edit', 'result') == 'Success'
        return false if response.dig('edit', 'nochange')
        return response.dig('edit', 'newrevid')
      end

      raise MediaWiki::Butt::EditError.new(response.dig('error', 'code') || 'Unknown error code')
    end
def edit(title, text, opts = {})
      opts[:bot] = opts.key?(:bot) ? opts[:bot] : true
      params = {
        action: 'edit',
        title: title,
        text: text,
        nocreate: 1,
        format: 'json',
        token: get_token
      }

      params[:summary] ||= opts[:summary]
      params[:minor] = '1' if opts[:minor]
      params[:bot] = '1' if opts[:bot]

      response = post(params)

      if response.dig('edit', 'result') == 'Success'
        return false if response.dig('edit', 'nochange')
        return response.dig('edit', 'newrevid')
      end

      raise MediaWiki::Butt::EditError.new(response.dig('error', 'code') || 'Unknown error code')
    end
Performs a standard non-creation edit.
 @param title [String] The page title.
 @param text [String] The new content.
 @param opts [Hash<Symbol, Any>] The options hash for optional values in the request.
 @option opts [Boolean] :minor Will mark the edit as minor if true.
 @option opts [Boolean] :bot Will mark the edit as bot edit if true. Defaults to true.
 @option opts [String] :summary The edit summary. 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:Edit MediaWiki Edit API Docs
 @since 0.2.0
 @raise [EditError] if the edit failed somehow
 @return [String] The new revision ID
 @return [Boolean] False if there was no change in the edit.