Skip to content

Commit

Permalink
Merge pull request #310 from StampyAI/merge-vars
Browse files Browse the repository at this point in the history
merge ROBMILES_DEFAULTS and NOT_ROB_SERVER to IS_ROB_SERVER
  • Loading branch information
tayler6000 authored Jul 2, 2023
2 parents a10a305 + 8c7098f commit 2bcbfdc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-production-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
export WOLFRAM_TOKEN=$(cat ~/.wolframtoken);
export CODA_API_TOKEN=$(cat ~/.codatoken);
export ROBMILES_DEFAULTS="TRUE"
export IS_ROB_SERVER="TRUE"
cd ~/stampy
conda activate stampy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- '*'
env:
ENVIRONMENT_TYPE: 'development'
ROBMILES_DEFAULTS: 'TRUE'
IS_ROB_SERVER: 'TRUE'
DISCORD_TOKEN: 'testing'
DISCORD_GUILD: 'testing'
YOUTUBE_API_KEY: 'testing'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Not required:
- `STOP_ON_ERROR`: Dockerfile/`runstampy` only, unset `BOT_REBOOT` only. If defined, will only restart Stampy when he gets told to reboot, returning exit code 42. Any other exit code will cause the script to just stop.
- `BE_SHY`: Stamp won't respond when the message isn't specifically to him.
- `CHANNEL_WHITELIST`: channels Stampy is allowed to respond to messages in
- `NOT_ROB_SERVER`: If `True`, Rob Miles server-specific stuff is disabled. Servers other than Rob Miles Discord Server and Stampy Test Server should set it to `1`. Otherwise some errors are likely to occur.
- `IS_ROB_SERVER`: If defined, Rob Miles server-specific stuff is enabled. Servers other than Rob Miles Discord Server and Stampy Test Server should not enable it, Otherwise some errors are likely to occur.

Specific modules (excluding LLM stuff):

Expand Down
6 changes: 2 additions & 4 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def getenv_unique_set(var_name: str, default: T = frozenset()) -> Union[frozense
be_shy: bool
channel_whitelist: Optional[frozenset[str]]

robmiles_defaults = getenv_bool("ROBMILES_DEFAULTS")
if robmiles_defaults:
is_rob_server = getenv_bool("IS_ROB_SERVER")
if is_rob_server:
# use robmiles server defaults
print("Using settings for the Rob Miles Discord server")
discord_guild = {
Expand Down Expand Up @@ -262,8 +262,6 @@ def getenv_unique_set(var_name: str, default: T = frozenset()) -> Union[frozense
slack_app_token: Optional[str] = getenv("SLACK_APP_TOKEN", default=None)
slack_bot_token: Optional[str] = getenv("SLACK_BOT_TOKEN", default=None)

not_rob_server = getenv_bool("NOT_ROB_SERVER")
is_rob_server = not not_rob_server


# VARIABLE VALIDATION
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-stampy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export YOUTUBE_API_KEY="$(cat ~/.youtubeapikey)"
export CLIENT_SECRET_PATH="$(cat ~/.clientsecretpath)"
export WOLFRAM_TOKEN=$(cat ~/.wolframtoken);

export ROBMILES_DEFAULTS="TRUE"
export IS_ROB_SERVER="TRUE"

cd ~/stampy
conda activate stampy
Expand Down

0 comments on commit 2bcbfdc

Please sign in to comment.