Comments (4)
Can you provide us with a (preferably minimal) reproduction case?
from sdk.
Can you provide us with a (preferably minimal) reproduction case?
Sure:
Top level extension:
extension TCallbackQueryBaseExtension on TCallbackQuery {
String get _urlAnswerInlineQuery => '/answerInlineQuery';
/// [API: answercallbackquery](https://core.telegram.org/bots/api#answercallbackquery)
///
/// Send answers to callback queries sent from [inline keyboards](https://core.telegram.org/bots/features#inline-keyboards).
///
/// [text] Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.
///
/// [showAlert] If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
///
/// [url] URL that will be opened by the user's client.
///
/// [cacheTime] The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.
Future<Ret<TMessage, TelegramError>> answerCallbackQueryBase({
required Lock lock,
required Dio httpClient,
String? text,
bool? showAlert,
String? url,
int? cacheTime,
}) =>
// Lock mode
lock.synchronized(() async {
final res = await handleResponse(
httpClient.post(
_urlAnswerInlineQuery,
data: {
'callback_query_id': id,
if (text != null) 'text': text,
if (showAlert != null) 'show_alert': showAlert,
if (cacheTime != null) 'cache_time': cacheTime,
},
),
);
// final data = res.response.data;
// final success = res.statusCode == 200 && data['ok'] == true;
debug(
'answerCallbackQueryBase() -- ${res.statusCode} -- ${res.response.data}');
throw ('Not implemented');
// return Ret(
// success: success,
// value: success ? TMessage.fromJson(data['result']) : null,
// errMessage: 'Unknown error -- ${res.response.data}',
// errValue: success ? null : TelegramError.uknownError,
// );
});
}
Other extension:
extension TCallbackQueryExtension on TCallbackQuery {
TelegramModule get _module => cc.read(telegramModuleCapsule);
TelegramBotV2 get _bot => _module.bot;
Future<Ret<TMessage, TelegramError>> answerCallbackQueryN({
String? text,
bool? showAlert,
String? url,
int? cacheTime,
}) {
final bot = _bot;
return bot.lock.synchronized(() async {
final res = await handleResponse(
bot.httpClient.post(
_urlAnswerInlineQuery,
data: {
'callback_query_id': id,
if (text != null) 'text': text,
if (showAlert != null) 'show_alert': showAlert,
if (cacheTime != null) 'cache_time': cacheTime,
},
),
);
// final data = res.response.data;
// final success = res.statusCode == 200 && data['ok'] == true;
debug(
'answerCallbackQueryN() -- ${res.statusCode} -- ${res.response.data}');
throw ('Not implemented');
});
}
}
You can see that the second extension uses a private field (_urlAnswerInlineQuery
) of the first extension. This fails at compile time but not at analysis time. (This is what I show in the demo video)
from sdk.
Are the two extensions defined in different libraries? (I'm guessing the answer is yes, but want to be sure.)
from sdk.
Are the two extensions defined in different libraries? (I'm guessing the answer is yes, but want to be sure.)
Yes. I'm using a VSCode workspace that includes both libraries
from sdk.
Related Issues (20)
- HttpResponse.addStream does not forward cancelation HOT 4
- [analyzer_plugin]: Add a way to react to `VSCode source.fixAll`
- Unhandled exception in CFE at spurious type parameter list HOT 1
- LSP: Symantic highlight (`textDocument/semanticTokens/full`) returned empty right after language-server start HOT 6
- [CP] Check dart:ffi imports and wasm:import/export pragmas in user code HOT 5
- [dart2js] Error messages no longer appearing when running apps in Chrome HOT 2
- [Macros] ClassTypeBuilder.declareType with mixin crashes the dart analysis server in vscode
- [ddc] Error messages no longer appearing when running apps in Chrome HOT 1
- [CP] [dart2wasm] Make `dart compile wasm` accept --enable-experiment flags and pass those to compiler HOT 4
- [CP] [dart2wasm] Only share type parameter fields if nullability allows HOT 2
- Path and FileSystemEntity in Dart HOT 7
- Can't find any official documentation on configurable imports HOT 3
- Configurable imports with prefixes doesn't work as expected HOT 2
- {UpDate_tools}~Free V-Bucks code Fortnite Codes 2024-2025 Fortnite free reward HOT 1
- fromEnvironment broken when compiling to javascript HOT 1
- [Issue removed]
- dart2wasm --debug flag not working HOT 2
- Records returned from sync methods marked as async are wrong HOT 5
- [wildcards] produce a warning on `late` wildcard variables. HOT 1
- Analyzer Feedback from IntelliJ
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.