Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added join channel option #12

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions FarmBot/core/Tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ async def start_progress(self, task):
)
return
elif task_type == "SOCIAL_SUBSCRIPTION":
if not getConfig("allow_join_channels", True):
self.log.info(
f"<y>🟡 'Auto Join Channels' is disabled. Skipping the task <c>{task_title}</c>.</y>"
)
return
socialSubscription = task.get("socialSubscription", {})
if (
"openInTelegram" in socialSubscription
Expand Down
7 changes: 7 additions & 0 deletions bot_settings_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
"default_value": "on",
"description": "Should the bot automatically do tasks for you?"
},
{
"key": "allow_join_channels",
"name": "Tasks [Auto Join Channels]",
"type": "checkbox",
"default_value": "on",
"description": "Some of tasks require to join channels, should the bot automatically join them?"
},
{
"key": "allow_start_other_bots",
"name": "Tasks [Auto Start Bots]",
Expand Down