MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / ShareBotGame

Function ShareBotGame

Telegram/SourceFiles/window/window_peer_menu.cpp:152–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150constexpr auto kTopicsSearchMinCount = 1;
151
152void ShareBotGame(
153 not_null<UserData*> bot,
154 not_null<Data::Thread*> thread,
155 const QString &shortName) {
156 auto &histories = thread->owner().histories();
157 const auto history = thread->owningHistory();
158 const auto randomId = base::RandomValue<uint64>();
159 const auto replyTo = thread->topicRootId();
160 const auto topicRootId = replyTo;
161 auto flags = MTPmessages_SendMedia::Flags(0);
162 if (replyTo) {
163 flags |= MTPmessages_SendMedia::Flag::f_reply_to;
164 }
165 histories.sendPreparedMessage(
166 history,
167 FullReplyTo{
168 .messageId = { replyTo ? history->peer->id : 0, replyTo },
169 .topicRootId = topicRootId,
170 },
171 randomId,
172 Data::Histories::PrepareMessage<MTPmessages_SendMedia>(
173 MTP_flags(flags),
174 history->peer->input(),
175 Data::Histories::ReplyToPlaceholder(),
176 MTP_inputMediaGame(
177 MTP_inputGameShortName(
178 bot->inputUser(),
179 MTP_string(shortName))),
180 MTP_string(),
181 MTP_long(randomId),
182 MTPReplyMarkup(),
183 MTPVector<MTPMessageEntity>(),
184 MTPint(), // schedule_date
185 MTPint(), // schedule_repeat_period
186 MTPInputPeer(), // send_as
187 MTPInputQuickReplyShortcut(),
188 MTPlong(),
189 MTPlong(),
190 MTPSuggestedPost()
191 ), [=](const MTPUpdates &, const MTP::Response &) {
192 }, [=](const MTP::Error &error, const MTP::Response &) {
193 history->session().api().sendMessageFail(error, history->peer);
194 });
195}
196
197} // namespace
198

Callers 1

ShowShareGameBoxFunction · 0.85

Calls 14

MTP_flagsFunction · 0.85
ReplyToPlaceholderClass · 0.85
MTP_stringFunction · 0.85
MTP_longFunction · 0.85
sendPreparedMessageMethod · 0.80
inputUserMethod · 0.80
sendMessageFailMethod · 0.80
apiMethod · 0.80
FlagsClass · 0.50
ownerMethod · 0.45
owningHistoryMethod · 0.45
topicRootIdMethod · 0.45

Tested by

no test coverage detected