1 | https://api.telegram.org/botp{my_bot_token}/getMe |
@Bean
@Singleton
fun defaultBotOptions( env: Environment): DefaultBotOptions {
val defaultBotOptions=if (env.activeNames.contains("prod")) DefaultBotOptions() else DefaultBotOptions().apply {
this.proxyHost="127.0.0.1"
this.proxyPort=33210
this.proxyType= DefaultBotOptions.ProxyType.HTTP
}
//允许消息更新
val allowedUpdates=listOf(AllowedUpdatesType.CHAT_MEMBER.code
,AllowedUpdatesType.MESSAGE.code
, AllowedUpdatesType.EDITED_MESSAGE.code
,AllowedUpdatesType.CALLBACK_QUERY.code
)
defaultBotOptions.allowedUpdates=allowedUpdates
return defaultBotOptions
}
— Sep 3, 2023
Made with at jiliapp. 蜀ICP备2023017116号-1