The goal of this project is to provide a unified and easy-to-use library in order to handle communications between parties during a livestreamed collab between 2 or more AI Vtubers.
- Uses Discord as a way to exchange text messages without hosting.
- Allows sending to and receiving of messages to/from a single or multiple collab partners on the Discord text channel.
- Orchestration of the timings, the assumption is that the messages would be sent at the very end of playing the TTS.
- Javascript/TypeScript
- Python
- C#
New languages can easily be added in the future.
- Discord server with a text channel
- Discord bot with read/write permissions
- Python >=3.8
Those are only examples making use of the functions provided by the library. Your implementation will and should be specific to the architecture of the AI Vtuber.
C#:
using AiVtDiscordCollabSystem;
await AVDCS.Initialize(
token: "<TOKEN>",
channel_id: "<CHANNEL ID>",
python_path: "python",
bot_path: "lib/collabbot.py");
while (true)
{
AVDCS.IncomingMessage msg = await AVDCS.Receive();
if (msg.text.Equals("quit")) break;
Console.WriteLine(msg.sender + ": " + msg.text);
await AVDCS.Send("This is a test", "all");
}
await AVDCS.Free();
JavaScript:
const avdcs = require("./lib/avdcs");
await avdcs.initialize("<TOKEN>", "<CHANNEL ID>", {
python_path: "python",
bot_path: "lib/collabbot.py",
});
avdcs.receiveWithListener((msg, from) => {
if (msg == "quit") {
avdcs.free();
process.exit();
}
console.log(from + ":", msg);
avdcs.send("Test message", "all");
});
// or
let response = await avdcs.receiveAsync();
Python:
import lib.avdcs as avdcs
avdcs.initialize(
token="<TOKEN>",
channel_id="<CHANNEL ID>",
python_path=sys.executable,
bot_path="lib/collabbot.py")
while True:
msg = avdcs.receive_poll()
if msg == None:
time.sleep(0.1)
continue
if msg.text == "quit": break
print(msg.sender + ": " + msg.text)
avdcs.send("Test message", "all")
avdcs.free()
- Copy the right version of the library, as well as the collabbot.py script to your project.
- In the
initialize
function call, make sure to specify the path of thecollabbot.py
script within your project. - If not installed, install Python >=3.8 (in the installer, make sure to tick
add to PATH
) - Install the Python requirements using
pip install -r requirements.txt
- If using NodeJS, use
npm install ws