import json, urllib.request
vals={}
for line in open('/opt/openclaw/ops/.env.nextcloud-bot'):
    s=line.strip()
    if s and not s.startswith('#') and '=' in s:
        k,v=s.split('=',1); vals[k]=v.strip().strip('"').strip("'")
print('keys', sorted(vals))
if vals.get('SLACK_BOT_TOKEN'):
    req=urllib.request.Request('https://slack.com/api/auth.test',data=b'',headers={'Authorization':'Bearer '+vals['SLACK_BOT_TOKEN'],'Content-Type':'application/x-www-form-urlencoded'})
    res=json.loads(urllib.request.urlopen(req,timeout=20).read().decode())
    print('auth', {k:res.get(k) for k in ['ok','user','user_id','bot_id','team','error']})
