Skip to content

Conversation

@KMohZaid
Copy link

By datatype issue i mean error occurs when we fetch int TelegramId column value into long variable of C#. C# long is equivalent to database bigint

And here is commit message dump that gets added to PR by default :-

add(topic support) && update(sql schema)

1. changes TelegramId datatype in `werewolf.sql` to `bigint` to fix issue
2. added `/setgrouptopic` command which admin can use to set group for werewolf bot
3. added new column in `dbo.Group` table : `GroupTopicId` to store topic id

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

TODOs :
1. maybe ignore command in other topics when topic id is set
2. add command to unset topic id, if group admin want to disable topics in group and use in normaly way
3. 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]`
4. A database migrator system, so we can avoid manual database backup and restore

This PR resolves :
#649

1. changes TelegramId datatype in `werewolf.sql` to `bigint` to fix
issue
2. added `/setgrouptopic` command which admin can use to set group for
werewolf bot
3. added new column in `dbo.Group` table : `GroupTopicId` to store topic
id

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

TODOs :
1. maybe ignore command in other topics when topic id is set
2. add command to unset topic id, if group admin want to disable topics
in group and use in normaly way
3. 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]`
4. A database migrator system, so we can avoid manual database backup
and restore
@KMohZaid
Copy link
Author

i will add few commits later, specially commit that complete TODO 1 and 2

@KMohZaid
Copy link
Author

added 4 new commit

commit 1 : Completes TODO 1 and 2

commit 2 : resolve this issue #661

commit 3 : clean up error spam that node process throws when it's unable to communicate with controller process port

commit 4 : just git config, fixes line ending problem when commit are made from different operating system (i use linux also, so line ending were changed to LF from CRLF)

@KMohZaid KMohZaid changed the title Adds Support for Telegram Topics and fix sql script datatype issue Adds Support for Telegram Topics and fix sql script datatype issue, also resolve #661 and little more improved code Jun 18, 2025
@KMohZaid
Copy link
Author

NOTE :

  1. There are places where i used english string, which i thing we can move to .xml file and add support for translation
  2. For testing player name validator, uncomment function call in Werewolf Control/Program.cs Main method

name validator working screenshots are sent in "Grey Wolf Support" group : https://t.me/c/1060486754/788569

New TODO to look out for :-

  1. Move hardcoded message to XML file for translation support
  2. 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]
  3. A database migrator system, so we can avoid manual database backup and restore

@KMohZaid
Copy link
Author

CLOSING THIS MESSED UP PR

After some rebasing and cherry picking, splitted this into 3 PR

#662
#663
#664

NOTE : removed sql schema update and .gitattribute commit, they are unneccessary at a moment

@KMohZaid KMohZaid closed this Jun 19, 2025
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.

1 participant