tg_flows/api/
method.rs

1// TODO: with optional params
2
3use strum::Display;
4
5#[derive(Debug, Display)]
6#[strum(serialize_all = "camelCase")]
7pub enum Method {
8    GetMe,
9    LogOut,
10    Close,
11    SendMessage,
12    ForwardMessage,
13    CopyMessage,
14    SendPhoto,
15    SendAudio,
16    SendDocument,
17    SendVideo,
18    SendAnimation,
19    SendVoice,
20    SendVideoNote,
21    SendMediaGroup,
22    SendLocation,
23    SendVenue,
24    SendContract,
25    SendPoll,
26    SendDice,
27    SendChatAction,
28    GetUserProfilePhotos,
29    GetFile,
30    BanChatMember,
31    UnbanChatMember,
32    RestrictChatMember,
33    PromoteChatMember,
34    SetChatAdministratorCustomTitle,
35    BanChatSenderChat,
36    UnbanChatSenderChat,
37    SetChatPermissions,
38    ExportChatInviteLink,
39    CreateChatInviteLink,
40    EditChatInviteLink,
41    RevokeChatInviteLink,
42    ApproveChatJoinRequest,
43    DeclineChatJoinRequest,
44    SetChatPhoto,
45    DeleteChatPhoto,
46    SetChatTitle,
47    SetChatDescription,
48    PinChatMessage,
49    UnpinChatMessage,
50    UnpinAllChatMessages,
51    LeaveChat,
52    GetChat,
53    GetChatAdministrators,
54    GetChatMemberCount,
55    GetChatMember,
56    SetChatStickerSet,
57    DeleteChatStickerSet,
58    GetForumTopicIconStickers,
59    CreateForumTopic,
60    EditForumTopic,
61    CloseForumTopic,
62    ReopenForumTopic,
63    DeleteForumTopic,
64    UnpinAllForumTopicMessages,
65    EditGeneralForumTopic,
66    CloseGeneralForumTopic,
67    ReopenGeneralForumTopic,
68    HideGeneralForumTopic,
69    UnhideGeneralForumTopic,
70    AnswerCallbackQuery,
71    SetMyCommands,
72    DeleteMyCommands,
73    GetMyCommands,
74    SetMyDescription,
75    GetMyDescription,
76    SetMyShortDescription,
77    GetMyShortDescription,
78    SetChatMenuButton,
79    GetChatMenuButton,
80    SetMyDefaultAdministratorRights,
81    GetMyDefaultAdministratorRights,
82    EditMessageText,
83    EditMessageCaption,
84    EditMessageMedia,
85    EditMessageLiveLocation,
86    StopMessageLiveLocation,
87    EditMessageReplyMarkup,
88    StopPoll,
89    DeleteMessage,
90    DeleteMessages,
91}
92
93#[cfg(test)]
94mod tests {
95    use crate::Method;
96
97    #[test]
98    fn test_display() {
99        assert_eq!(
100            String::from("sendMessage"),
101            format!("{}", Method::SendMessage)
102        );
103        assert_eq!(
104            String::from("editMessageMedia"),
105            format!("{}", Method::EditMessageMedia),
106        );
107        assert_eq!(
108            String::from("closeGeneralForumTopic"),
109            format!("{}", Method::CloseGeneralForumTopic),
110        );
111    }
112}