Why $me = %botnick? I don't think it's needed unless you want your bot to be that of a certain nickname...
You only need one check for ops, rather than using two operators. An if and then else condition will do the trick.
You can do these in a couple of ways:
on *:TEXT:!topic*:#: {
if ($nick isop $chan) {
topic # $$2-
}
else {
notice $nick You aren't an op. No topic for you.
}
}
Or:
on *:TEXT:!topic *:#: {
if ($nick !isop #) {
notice $nick You aren't an op. No topic for you.
}
else {
topic # $2-
}
}
Or:
on *:TEXT:!topic *:#: {
$iif($nick !isop #,notice $nick You aren't an op. No topic for you.,topic # $2-)
}
I'll recommend you add a flood protection to this, in case somebody tampers with the code by way of trigger flood. For instance:
on *:TEXT:!topic*:#: {
if (!%f) {
inc -u5 %f
if ($nick isop $chan) {
topic # $$2-
}
else {
notice $nick You aren't an op. No topic for you.
}
}
}