reactiflux / discord-irc

Connects Discord and IRC channels by sending messages back and forth.
MIT License
1.2k stars 293 forks source link

Unable to create a bridge between twitch and discord #412

Closed velheimdallr closed 6 years ago

velheimdallr commented 6 years ago

{ "irc_config": { "owners": ["velheimdallr"], "nickname": "velheimdallr", "alt_nicks": ["velheimdallr", "velheimdallr"], "username": "velheimdallr", "realname": "velheimdallr", "server": "irc.chat.twitch.tv", "port": 6667, "password": "again no", "use_ssl": true, "encoding": "UTF-8", "channels": ["#velheimdallr"], "umodes": "+RB-x", "user_info": "IRC to Discord Bridge", "ping_time": 180, "ping_timeout": 10, "options": {} }, "discord_config": { "bot_token": "Lol no i'm not giving this out" }, "mapping": { "discord2irc": { "#requests-and-chat": "#velheimdallr" }, "irc2discord": { "#velheimdallr": "#requests-and-chat" } }, "filterchars": ".!" }

^ so this is my config file and my bot seems to run fine but chats don't seem to get sent to my discord

const Discord = require('discord.js'); const config = require('./config.json'); const client = new Discord.Client();

client.on('ready', () => { console.log('Ready!'); });

client.on('message', message => { if (message.content === '!ping') { message.channel.send('Pong.'); } });

client.login('hahahahahha a bot token you won't get');`

Index.js code

image

This is my current file structure if you are wondering about the batch file it's just a basic script that allows me to run my bot lazily...

Attempting to use the discord-irc --config /path/to/config.json command in powershell when directed to this file path ends up causing this error

image

{ "nickname": "TwitchUsername", "server": "irc.twitch.tv", "discordToken": "DiscordOauthToken", "channelMapping": { "#discordchannel": "#twitchchannel" }, "ircOptions": { "retryDelay": "120", "userName": "TwitchUsername", "password": "oauth:twitch-oauth-token" }, "ircNickColor": false } ]

I've also attempted to use this code as a basis and changed all the fields that were relevant but then the bot won't even start not even when i try to get discord-irc to see the config it will come up usually with

image

That's when i set the discordToken as my Bot's Token

When i set the discordToken field as the Token which displays when i inspect element on my discord program while on my server entering the local storage i get this error

image

What do?

Throne3d commented 6 years ago

The first bit of code you listed seems to be for discord.js, not discord-irc, since it's importing discord.js. We don't support bots that directly interface with discord.js and not discord-irc. Was that accidental? I'm also not sure why you would expect it to pick up the config file as you gave it, with that script, and have it do anything – that config file you have up the very top isn't a format we use, so I assume it's your own structure, but then discord-irc won't work with it.

Your second config file – as the output says, when you run discord-irc --config [etc] – has invalid JSON. If the code you gave above is copied accurately, you're just missing a start square bracket from the beginning ([).

velheimdallr commented 6 years ago

@Throne3d Well, i feel stupid lol thanks for the help it works perfectly now