techlift-tech / TelegramBotForPokerAnalysis

0 stars 0 forks source link

Can we have a better name than NewMessage? #5

Open palashjhabak opened 3 years ago

palashjhabak commented 3 years ago

https://github.com/techlift-tech/TelegramBotForPokerAnalysis/blob/a6dd6f1ca4078f308b353f8d688afb5d4b1e9f29/TechliftTelegramBot/Models/NewMessage.cs#L9

Something more descriptive if we are going to use multiple model classes for different messages

disha-2401 commented 3 years ago

https://github.com/techlift-tech/TelegramBotForPokerAnalysis/blob/a6dd6f1ca4078f308b353f8d688afb5d4b1e9f29/TechliftTelegramBot/Models/NewMessage.cs#L9

Something more descriptive if we are going to use multiple model classes for different messages

Yes, we can have a different name for this model such as DirectMessage, PrivateMessage, GroupMessage

palashjhabak commented 3 years ago

https://github.com/techlift-tech/TelegramBotForPokerAnalysis/blob/a6dd6f1ca4078f308b353f8d688afb5d4b1e9f29/TechliftTelegramBot/Models/NewMessage.cs#L9

Something more descriptive if we are going to use multiple model classes for different messages

Yes, we can have a different name for this model such as DirectMessage, PrivateMessage, GroupMessage

Yes that will be better and easier to understand

disha-2401 commented 3 years ago

https://github.com/techlift-tech/TelegramBotForPokerAnalysis/blob/a6dd6f1ca4078f308b353f8d688afb5d4b1e9f29/TechliftTelegramBot/Models/NewMessage.cs#L9

Something more descriptive if we are going to use multiple model classes for different messages

Yes, we can have a different name for this model such as DirectMessage, PrivateMessage, GroupMessage

Yes that will be better and easier to understand

so which one should I change to?

palashjhabak commented 3 years ago

https://github.com/techlift-tech/TelegramBotForPokerAnalysis/blob/a6dd6f1ca4078f308b353f8d688afb5d4b1e9f29/TechliftTelegramBot/Models/NewMessage.cs#L9

Something more descriptive if we are going to use multiple model classes for different messages

Yes, we can have a different name for this model such as DirectMessage, PrivateMessage, GroupMessage

Yes that will be better and easier to understand

so which one should I change to?

That you decide but for our not we want to target private message and include the both in the group. So decide accordingly and if needed have more than one models

disha-2401 commented 3 years ago

This is a sample JSON data for Group Messages:

{
    "update_id": 496196938,
    "message": {
        "message_id": 70,
        "from": {
            "id": 799660804,
            "is_bot": false,
            "first_name": "Disha",
            "last_name": "Miyani",
            "username": "Disu_2401",
            "language_code": "en"
        },
        "chat": {
            "id": -555823401,
            "title": "test",
            "type": "group",
            "all_members_are_administrators": true
        },
        "date": 1617196370,
        "text": "/hey",
        "entities": [
            {
                "offset": 0,
                "length": 4,
                "type": "bot_command"
            }
        ]
    }
}

And this is sample JSON data of Private message

{
    "update_id": 496196939,
    "message": {
        "message_id": 71,
        "from": {
            "id": 799660804,
            "is_bot": false,
            "first_name": "Disha",
            "last_name": "Miyani",
            "username": "Disu_2401",
            "language_code": "en"
        },
        "chat": {
            "id": 799660804,
            "first_name": "Disha",
            "last_name": "Miyani",
            "username": "Disu_2401",
            "type": "private"
        },
        "date": 1617197376,
        "text": "/hey",
        "entities": [
            {
                "offset": 0,
                "length": 4,
                "type": "bot_command"
            }
        ]
    }
}