Skip to content

Conversation

@KMohZaid
Copy link

  1. added /setgrouptopic command which admin can use to set/unset group topic for werewolf bot
  2. added new column in dbo.Group table : GroupTopicId to store topic id
  3. restricts bot command to specified topic only, except admin command and manually allowed command with Attribute AllowOutsideConfiguredTopic

Note : I may have forget some places to update and make topic support

This PR resolves :
#649

1. added `/setgrouptopic` command which admin can use to set/unset group topic for werewolf bot
2. added new column in `dbo.Group` table : `GroupTopicId` to store topic id
3. restricts bot command to specified topic only, except admin command and manually allowed command with Attribute `AllowOutsideConfiguredTopic`

Note : I may have forget some places to update and make topic support
@KMohZaid
Copy link
Author

KMohZaid commented Jun 19, 2025

this is new PR, as i messed up old one

old PR : #660 (comment)

note that i have squashed those 2 commit :

8abf556f fix(/setgrouptopic): complete  TODO 1 and 2, used button for set and unset.
b0ec8681 add(topic support) && update(sql schema)...
  • removed TODO description as they are done.
  • removed database schema update commit line, i think it can be directly done by someone or a separate PR for schema update

@KMohZaid
Copy link
Author

KMohZaid commented Jun 19, 2025

Those 2 TODO are left(but planned, unrelated to this PR) :

  1. Remove redundant direct call to Telegram send API and make single method that send normal message or document based on flag parameter such as msg_type: [TEXT,DOC,GIF]
  2. A database migrator system, so we can avoid manual database backup and restore

Copy link
Collaborator

@Olgabrezel Olgabrezel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thank you for the pull request!
I left some review comments, I think some parts of the design should be improved before we merge this.
If you could take a look at this, it would be highly appreciated!
In case of questions, just comment here, or ask on Support, whichever seems more appropriate!

@Olgabrezel
Copy link
Collaborator

(I should note, I have not tried to execute the code to test its functional correctness so far. These are all just my thoughts based on reading it.)

@Olgabrezel Olgabrezel changed the title Topic Support for Bot for #649 Topic Support for Bot, resolves #649 Jun 23, 2025
@KMohZaid
Copy link
Author

I will work on reviews when I get time. Thank you for feedback

@KMohZaid
Copy link
Author

KMohZaid commented Jun 26, 2025

@Olgabrezel check new commit and tell me if there is anything needed to be done

Comment on lines +2272 to +2285

<string key="SetTopicCmdNotInGeneral">
<value>❌ You must run this command inside a topic/thread (not the general topic).</value>
</string>
<string key="SetTopicSuccess">
<value>✅ Group topic has been set successfully.</value>
</string>
<string key="UnsetTopicSuccess">
<value>🗑️ Group topic has been unset.</value>
</string>

<string key="MustRunInConfiguredTopic">
<value>This command can only be used in the configured topic/thread. (Topic id : {0})</value>
</string>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, forget to format it to proper indentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants