conversations_response = await bot.api.messages.getConversations(filter='all')
conversations = conversations_response.items
for conversation in conversations:
peer_id = conversation.peer.id
try:
await bot.api.messages.send(
peer_id=peer_id,
message='Новый пост!',
random_id=0,
attachment=f'wall-{event.group_id}_{event.object.id}'
)
except Exception as ex:
print(f'error: {ex}')
import vk_api
# авторизация бота
vk_session = vk_api.VkApi(token='токен_бота')
vk = vk_session.get_api()
# получение списка всех бесед бота
conversations = vk.messages.getConversations(peer_type='chat')['items']
# отправка сообщения в каждую беседу
for conv in conversations:
peer_id = conv['peer']['id']
try:
vk.messages.send(peer_id=peer_id, message='Новый пост!', random_id=0, attachment=f'wall-{event.group_id}_{event.object.id}')
except Exception as ex:
print(f'error: {ex}')
response = await pool.query('INSERT INTO users (name,password,token,reg_time) VALUES($1,$2,$3,$4) RETURNING id', [p_name,p_password,p_token,p_time])
await pool.query('INSERT INTO items (id_user) VALUES($1)', [response.rows[0].id])
await pool.query('INSERT INTO stats (id_user) VALUES($1)', [response.rows[0].id])
const editor = new Rete.NodeEditor('demo@0.1.0', container, {
// Включаем масштабирование
minimap: {
enabled: true
},
// Другие настройки...
});
let format = 'ogg'
let codec = 'opus'
if (navigator.userAgent.indexOf('Firefox') != -1) {
codec = 'vorbis'
}
blob = new Blob(chunks, {'type': 'audio/'+format+'; codecs='+codec});
pip install learning_log.