1
0
mirror of https://github.com/janvarev/Irene-Voice-Assistant.git synced 2025-11-23 22:45:08 +02:00
Files
Irene-Voice-Assistant/plugins/plugin_greetings.py

30 lines
803 B
Python
Raw Normal View History

2021-12-14 12:51:47 +03:00
# Приветствие (и демо-плагин)
# author: Vladislav Janvarev (inspired by EnjiRouz)
import random
from voiceasscore import VoiceAssCore
# функция на старте
def start(core:VoiceAssCore):
manifest = {
"name": "Привет",
"version": "1.0",
"require_online": False,
"commands": {
"привет|доброе утро": play_greetings,
}
}
return manifest
def play_greetings(core:VoiceAssCore, phrase: str):
"""
Проигрывание случайной приветственной речи
"""
greetings = [
"И тебе привет!",
"Рада тебя видеть!",
]
core.play_voice_assistant_speech(greetings[random.randint(0, len(greetings) - 1)])