LoginSignup
3
8

More than 5 years have passed since last update.

Node.jsでDiscordのメッセージ読み上げさせる

Posted at

モジュールのdiscord.jsとchild_processのインストールが必要

ソース

const Discord = require('discord.js'),
      bot     = new Discord.Client(),
      token   = 'トークン',
      proc    = require('child_process'),
      dir     = "D:/Yuta/Desktop/BouyomiChan";// 棒読みちゃんのパス

bot.on('ready', () => {
  console.log('I am ready!');
});

bot.on('message', message => {
    proc.exec(dir+"/RemoteTalk/RemoteTalk.exe /Talk "+message.content)
});

bot.login(token);
3
8
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
8