bot6/config.py

81 lines
3.5 KiB
Python
Raw Permalink Normal View History

import importlib, sys
# default config file, copy the contents into local_config.py and modify
if __name__ == "local_config":
config = importlib.reload(sys.modules["config"]).config
else:
class config: # dummy, so the local config can simply be a copy of this template
...
class config(config):
2021-09-16 17:35:06 +00:00
class self:
2021-10-04 12:48:10 +00:00
nick = "bot6"
username = "jan6_bot"
# you should probably indicate yourself to be the owner of the bot, in username, or realname, or both
2021-10-04 12:48:10 +00:00
realname = "jan6's bot"
source = "https://tildegit.org/jan6/bot6" # so far only used for ctcp response, perhaps we're running a fork?
gitdir = "./" # where is bot6 cloned? currently only used for version (assuming latest commit == latest version)
2021-10-04 12:48:10 +00:00
2021-09-16 17:35:06 +00:00
class server:
name = "libera"
host = "irc.libera.chat"
2021-10-04 12:48:10 +00:00
port = 6697
ssl = True
2022-02-07 16:28:19 +00:00
nickserv_auth = True
nickserv_mask = (
"NickServ!NickServ@services.libera.chat" # the mask you receive from server
)
2022-10-22 18:13:58 +00:00
nickserv_squery = True
nickserv_path = "NickServ@services." # the mask you actually send commands to
2022-02-07 16:28:19 +00:00
# get password from secret file
nickserv_pass = open("pass.txt", "r").read().strip()
nickserv_recover = "RECOVER" # I recall it being GHOST on some networks?
channel = "#bots"
autojoin = ["#some-other", "##channels"]
blacklisted_channels=[]
2021-10-04 12:48:10 +00:00
2021-09-16 17:35:06 +00:00
class admin:
# ircv3 account-tag based admin
accounts = ["jan6", "totally-not-jan6"]
# hostmask-based admin, if at all possible, you should try to use a vhost or reverse dns, to prevent fakery
hostmasks = ["jan6!jan6@mischievous.deity", "jan6!~jan6@mischievous.deity"]
2021-10-04 12:48:10 +00:00
2021-09-16 17:35:06 +00:00
class cmd:
# right now, single-character prefixes only (plus bot's own nick)
prefixes = ["'", "6"]
# disabled commands, won't run via normal means...probably
2021-10-04 12:48:10 +00:00
disabled = []
# admin-only override,
# useful for testing broken commands which should still be normal-user accessible
# commands which should only ever be used by admins, should be designated as such in code, not through here (e.g. exit)
2021-10-04 12:48:10 +00:00
admin_only = []
2022-10-05 02:24:25 +00:00
ignored_nicks = []
# try to read youtube page only up to <body> tag, maybe it's faster?
# premature optimization is the root of all evil
yt_premature_opt = True
2021-11-07 10:38:04 +00:00
capabilities = [ # what capabilities shall we request?
"message-tags", # needed for account-tag!
"account-tag", # account tag allows us to identify people without needing custom login!
"multi-prefix", # perhaps eventually useful for detecting people's status, such as +v AND +o ?
"batch", # we wouldn't want to trigger on historic message playback (only usage of it I've seen)
"away-notify", # no functionality deals with away status yet
"account-notify", # I don't remember why I try requesting this lol
"chghost", # uh, same, forgot
2021-11-07 10:38:04 +00:00
]
# you can remove the following lines if you're editing local_config.py
if __name__ == "config":
try:
config = importlib.reload(sys.modules["local_config"]).config
except ModuleNotFoundError:
print("\x1b[31m!!! you should probably set up local config !!!\x1b[0m")
except KeyError:
try:
from local_config import config
except ModuleNotFoundError:
print("\x1b[31m!!! you should probably set up local config !!!\x1b[0m")