Autocommand: callback function with if statement

I am trying to create an auto command that works for all filetypes but markdown. I know that gives me the filetype, so I have created this:

-- autocmd WinEnter,BufEnter * if &ft != "md" | do things
vim.api.nvim_create_autocmd("ModeChanged", {
    pattern = { "*:i*", "i*:*" },
    group = group,
    callback = function()
        if not == "markdown" then
            vim.o.relativenumber = vim.v.event.new_mode:match("^i") == nil

It is not working properly for markdown, it keeps changing something on this filetype. If I remove the if it will work for all filetypes but I have this on my ~/.config/nvim/after/markdown.lua:

vim.opt_local.number = false
vim.opt_local.relativenumber = false

That’s why I am trying to use an if statement inside my callback function