MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / _op

Method _op

astrbot/core/db/sqlite.py:1390–1425  ·  view source on GitHub ↗
(session: AsyncSession)

Source from the content-addressed store, hash-verified

1388 auto_managed: bool | None = None,
1389 ) -> CommandConfig:
1390 async def _op(session: AsyncSession) -> CommandConfig:
1391 config = await session.get(CommandConfig, handler_full_name)
1392 if not config:
1393 config = self._new_command_config(
1394 handler_full_name,
1395 plugin_name,
1396 module_path,
1397 original_command,
1398 resolved_command=resolved_command,
1399 enabled=enabled,
1400 keep_original_alias=keep_original_alias,
1401 conflict_key=conflict_key,
1402 resolution_strategy=resolution_strategy,
1403 note=note,
1404 extra_data=extra_data,
1405 auto_managed=auto_managed,
1406 )
1407 session.add(config)
1408 else:
1409 self._apply_updates(
1410 config,
1411 plugin_name=plugin_name,
1412 module_path=module_path,
1413 original_command=original_command,
1414 resolved_command=resolved_command,
1415 enabled=enabled,
1416 keep_original_alias=keep_original_alias,
1417 conflict_key=conflict_key,
1418 resolution_strategy=resolution_strategy,
1419 note=note,
1420 extra_data=extra_data,
1421 auto_managed=auto_managed,
1422 )
1423 await session.flush()
1424 await session.refresh(config)
1425 return config
1426
1427 return await self._run_in_tx(_op)
1428

Callers

nothing calls this directly

Calls 8

_new_command_configMethod · 0.95
_apply_updatesMethod · 0.95
_new_command_conflictMethod · 0.95
deleteFunction · 0.85
addMethod · 0.80
getMethod · 0.45
flushMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected