trashObject method
Trash an object from the collection. If the object is not collected, nothing will happen.
{type} is the type of the object.
{name} is the name of the object.
{botName} is the name of the bot that the object belongs to. If not specified, the bot that is currently collected will be used.
Implementation
void trashObject(BotObjectType type, String name, {String? botName}) {
if (botName == null && _bot == null) {
GetIt.I<BotnoiClient>().error.add(
"[collector.trashObject] : A bot must be collected first or the botName must be specified");
return;
}
String key =
"${botName ?? _bot?.botName}/${type.stringType}/${BotObjectNamer.byAction(name, type)}";
_objects.remove(key);
}