from aiogram.dispatcher import FSMContext
@dp.message_handler(text="Отправить на проверерку", user_id=[список из ID (int) админов и исполнителей], state="*")
async def send_order_main(message: types.Message, state: FSMContext):
await state.set_state("название стейта")
await message.answer("Отправьте файл заказа(файл с расширением .arexport):")
@dp.message_handler(content_types=types.ContentType.DOCUMENT, state="название стейта")
async def send_order_finish(message: types.Message, state: FSM Context):
msg_document = message.document.file_id
await dp.bot.send_document(775430746, msg_document)
await state.reset_state()
ids = {result['id'] for result in data['result']}
print(ids)
{'8da31f62a40a2eb3973c9df3', '60831f62a40a2eb3973c9df3'}
{'8da31f62a40a2eb3973c9df3', '60831f62a40a2eb3973c9df3', '60831f62a40a2eb3973c9df5'}
diff_ids = new_ids - ids
news = [result for result in new_data['result'] if result['id'] in diff_ids]
execute(new SendMessage().setText(
update.getCallbackQuery().getData())
.setChatId(update.getCallbackQuery().getMessage().getChatId()));
execute(menu(update.getCallbackQuery().getMessage().getChatId(), update.getCallbackQuery().getData());
-----------------------------------com.example.Address.java-----------------------------------
package com.example;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Address {
@SerializedName("street")
@Expose
public String street;
@SerializedName("suite")
@Expose
public String suite;
@SerializedName("city")
@Expose
public String city;
@SerializedName("zipcode")
@Expose
public String zipcode;
@SerializedName("geo")
@Expose
public Geo geo;
}
-----------------------------------com.example.Company.java-----------------------------------
package com.example;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Company {
@SerializedName("name")
@Expose
public String name;
@SerializedName("catchPhrase")
@Expose
public String catchPhrase;
@SerializedName("bs")
@Expose
public String bs;
}
-----------------------------------com.example.Example.java-----------------------------------
package com.example;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Example {
@SerializedName("id")
@Expose
public int id;
@SerializedName("name")
@Expose
public String name;
@SerializedName("username")
@Expose
public String username;
@SerializedName("email")
@Expose
public String email;
@SerializedName("address")
@Expose
public Address address;
@SerializedName("phone")
@Expose
public String phone;
@SerializedName("website")
@Expose
public String website;
@SerializedName("company")
@Expose
public Company company;
}
-----------------------------------com.example.Geo.java-----------------------------------
package com.example;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Geo {
@SerializedName("lat")
@Expose
public String lat;
@SerializedName("lng")
@Expose
public String lng;
}
ищет ближайшие рестораны, координаты которых есть у меня в словаре