2 # Someone's Mattermost scripts.
 
   3 #   Copyright (c) 2016-2025 by Someone <someone@somenet.org> (aka. Jan Vales <jan@jvales.net>)
 
   4 #   published under MIT-License
 
   7 #   mv to config.py.examle config.py + edit.
 
   9 # consider running as cronjob
 
  10 #   0 0 * * MON  (cd /home/someone/mattermost/priviledged/profile_badges; python3 -u main.py)
 
  14 # Needed priviledges: mm-sysadmin.
 
  15 mm_api_url = "http://localhost:8065/api"
 
  19 ####################################
 
  20 # mark these users + myself as bot #
 
  21 ####################################
 
  25 ######################################
 
  26 # post-based badges + 2k+posts club #
 
  27 ######################################
 
  28 # Mattermost Postgres-DB-Connect string. (comment out to disable)
 
  29 # Needed priviledges: read only.
 
  30 # dbconnstring = "host=... dbname=... user=... password=..."
 
  32 # 2k+posts club team and channel id (comment out to disable)
 
  36 # people, who dont want to be in the 2k+posts club - or people we do not want to be in the 2k+posts club.
 
  42 ##########################################################
 
  43 # uid based badges (pre channel-membership based badges) #
 
  44 ##########################################################
 
  45 uid_based_bagdes_pre = [
 
  46 #    ["badge text as displayed", ["userid1", "userid2"]],
 
  50 ###################################
 
  51 # channel-membership based badges #
 
  52 ###################################
 
  53 channel_membership_based_bagdes = [
 
  54 #    ["badge text as displayed",   "apply to uids in this channel_id", None, []],
 
  55 #    ["supports markdown + emoji", "apply to uids in this channel_id", "minus uids in this channel_id", ["list of", "ignored uids"]],
 
  59 ################################
 
  60 # uid based badges (post cmbb) #
 
  61 ################################
 
  62 uid_based_bagdes_post = [
 
  63 #    ["badge text as displayed", ["userid1", "userid2"]],