Skip to content

Commit

Permalink
Deprecate communities command
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywink committed Jan 22, 2022
1 parent db0dd83 commit ce186e4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@

* Don't crash in `set_user_power` if bot not in room.

### Deprecated

* Communities support is deprecated. The `communities` command will be removed in Bubo v0.4.0.

### Removed

* Removed the `power_to_write` override in the `rooms` database table. Rooms
Expand Down
16 changes: 12 additions & 4 deletions bubo/bot_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ async def _communities(self):
params = csv.reader([' '.join(args)], delimiter=" ")
params = [param for param in params][0]
if len(params) != 3 or params[0] == "help":
text = "Wrong number of arguments. Usage:\n" \
text = "NOTE! Communities support is deprecated and will be removed in Bubo v0.4.0.\n" \
"\n" \
"Wrong number of arguments. Usage:\n" \
"\n" \
"`communities create NAME ALIAS TITLE`\n" \
"\n" \
Expand All @@ -160,18 +162,24 @@ async def _communities(self):
self.config,
)
if result == "created":
text = f"Community {params[0]} (+{params[1]}:{self.config.server_name}) " \
text = f"NOTE! Communities support is deprecated and will be removed in Bubo v0.4.0.\n" \
f"\n" \
f"Community {params[0]} (+{params[1]}:{self.config.server_name}) " \
f"created successfully."
self.store.store_community(params[0], params[1], params[2])
elif result == "exists":
text = f"Sorry! Community {params[0]} (+{params[1]}:{self.config.server_name}) " \
text = f"NOTE! Communities support is deprecated and will be removed in Bubo v0.4.0.\n" \
f"\n" \
f"Sorry! Community {params[0]} (+{params[1]}:{self.config.server_name}) " \
f"already exists."
else:
text = f"Error creating community: {error}"
else:
text = "Unknown subcommand!"
else:
text = "I currently maintain the following communities:\n\n"
text = "NOTE! Communities support is deprecated and will be removed in Bubo v0.4.0.\n" \
"\n" \
"I currently maintain the following communities:\n\n"
results = self.store.cursor.execute("""
select * from communities
""")
Expand Down

0 comments on commit ce186e4

Please sign in to comment.