This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
H4X0RZ's profile picture

DisCCord | A Discord client for CC

Started by H4X0RZ, 13 January 2017 - 08:34 PM
H4X0RZ #1
Posted 13 January 2017 - 09:34 PM
Welcome to DisCCord!

What is this?
This program is using a bot I wrote for discord (currently running on my openshift account) to route messages from cc<->discord. It is possible to "connect" to every server the bot is a member of, and you can control the available channels by setting the "sendMessages" permision for specific channels (no permission -> not visible in the client).

Here's a GIF showing you how it looks like:



Installing the client
pastebin get BYf2GBWk disccord

Adding the bot to your server
just go to this link, select your server and add the bot.

Planned features
  • add (limited) support for emoji, so they are not displayed as "?"
Bugs
  • Some characters look weird.
Source
You can find everything here.

Credits
Hbomb_79 for Titanium and it's awesome packager
abalabahaha for writing Eris.js
Edited on 08 February 2017 - 09:54 PM
H4X0RZ #2
Posted 16 January 2017 - 10:11 PM
Unfortunately I have to announce that the bot is down for now. It was running on my OpenShift v3 account which expired someday ago. If anyone want's to host the bot for me, or if there is some other free option available, please inform me. (I already tried OpenShift v2, which only starts the webserver and won't connect to Discord)
SquidDev #3
Posted 16 January 2017 - 10:52 PM
Whilst I realise it would be a fair bit of work, would it be possible to use Discord's API on the Lua side instead? Though people would have to create their own OAuth2 applications as obviously you don't want to be sharing you secret with everyone. I don't know how your current implementation works, but it looks like you can also post "as" that user (instead of through a bot) which might be preferred.
H4X0RZ #4
Posted 17 January 2017 - 12:49 PM
It might be possible to use the API, I haven't tried it yet.
You can easily extract your own OAuth token from your client and then run your own "bot" instead.

The current implementation is written in NodeJS. It is a simple bot which just connects to discord and opens a webserver next to it. Then it listens for specific calls to that webserver and commands the bot to do stuff
hbomb79 #5
Posted 20 January 2017 - 07:29 AM
Awesome. I will work on alpha.7 of Titanium ASAP so you can use the new text wrapping and get rid of the horizontal scrollbars.

Nice to see someone using Titanium for something that is actually cool!
H4X0RZ #6
Posted 21 January 2017 - 12:05 AM
Awesome. I will work on alpha.7 of Titanium ASAP so you can use the new text wrapping and get rid of the horizontal scrollbars.

Nice to see someone using Titanium for something that is actually cool!

It's not usable right now though :/
The bot is down and I have to find some way to get it working somehow. If you know any free nodejs hoster I would really appreciate it :D/>
hbomb79 #7
Posted 23 January 2017 - 01:27 AM
It's not usable right now though :/
The bot is down and I have to find some way to get it working somehow. If you know any free nodejs hoster I would really appreciate it :D/>

That sucks. Titanium alpha 7 is out, providing the text wrapping you wanted. Although, I cannot help with the hosting issue - sorry.
Edited on 23 January 2017 - 12:28 AM
LoganDark2 #8
Posted 02 February 2017 - 07:49 AM
Awwwww I wanted to make a discord client. I make bots for a living anyway lmao
H4X0RZ #9
Posted 06 February 2017 - 07:59 PM
DisCCord is back! I finally managed to renew my Openshift account. The bot is back up, and I fixed some problem with the DisCCord package which made it unable to run on other cc machines (it tries to run "titanium", which is a link to the titanium package, but the Titanium Packager doesn't account for these links, so I had to use the absolute path)

Also, the bot has some small commands built-in which you can use when you are not using it through DisCCord. Just say "+miso help" at any time and let the magic happen.
hbomb79 #10
Posted 07 February 2017 - 02:14 AM
but the Titanium Packager doesn't account for these links, so I had to use the absolute path)

Not sure what you mean. The Titanium Packager will automatically generate a link to the absolute path that is used by the Titanium Package Manager (TPM). See line 627 of your pastebin, you will notice the Titanium installation being started. Ensure Titanium is not loaded before though, if it is the package won't reload it.

Depending on how you package the application, you won't have to load Titanium yourself, it will be loaded into the programs environment automatically.

(This line shouldn't be needed if you use it properly.)
Edited on 07 February 2017 - 02:03 AM
H4X0RZ #11
Posted 07 February 2017 - 08:05 AM
Oh, it loads it automatically? That makes way too much sense.

I'll update my codev ASAP.
H4X0RZ #12
Posted 08 February 2017 - 10:35 PM
Just a small update. I rewrote DisCCord in Moonscript. Here's the source.

Installing still works the same.

I'm not sure if that increases or decreases the speed though.
Edited on 08 February 2017 - 09:55 PM
hbomb79 #13
Posted 09 February 2017 - 07:09 AM
I really like the new look, awesome work as always.
MattieBit #14
Posted 02 December 2017 - 03:17 PM
Unfortunately I have to announce that the bot is down for now. It was running on my OpenShift v3 account which expired someday ago. If anyone want's to host the bot for me, or if there is some other free option available, please inform me. (I already tried OpenShift v2, which only starts the webserver and won't connect to Discord)
i can host your bot for ye
SchnitzeltoastMC #15
Posted 07 December 2017 - 02:01 PM
Seems to be a very cool Feature. To use it on our Server, I would like to invite you, hosting your bot on my vServer.
LoganDark2 #16
Posted 15 January 2018 - 07:29 PM
I could let you host your bot on my (dedicated) server.
That's different than having me host it for you, because you'd be in full control of it (user account on my server)

Here's the specs:


And I think the uptime shows why this server can be trusted to keep services online 24/7.
Edited on 25 January 2018 - 08:10 PM
jaredallard #17
Posted 09 February 2018 - 03:31 AM
I could let you host your bot on my (dedicated) server.
That's different than having me host it for you, because you'd be in full control of it (user account on my server)

Here's the specs:


And I think the uptime shows why this server can be trusted to keep services online 24/7.

Not very secure though… then again, it *is* someone else's bot. I'd be much more interested in seeing this be able to be deployed per user. Make a Dockerfile for this and let users deploy their own bot on their own server / even heroku! Wouldn't trust using someone's random bot… but maybe that's just me.

Whilst I realise it would be a fair bit of work, would it be possible to use Discord's API on the Lua side instead? Though people would have to create their own OAuth2 applications as obviously you don't want to be sharing you secret with everyone. I don't know how your current implementation works, but it looks like you can also post "as" that user (instead of through a bot) which might be preferred.

That'd be even better, OAuth2 would totally work with the HTTP api as well. Sidenote, (insert wave emoji here) @SquidDev. Been a few years ;)/>
Edited on 09 February 2018 - 02:31 AM
LoganDark2 #18
Posted 09 February 2018 - 03:34 AM
-snip-

Not very secure though… then again, it *is* someone else's bot. I'd be much more interested in seeing this be able to be deployed per user. Make a Dockerfile for this and let users deploy their own bot on their own server / even heroku! Wouldn't trust using someone's random bot… but maybe that's just me.

What's not secure, the bot, my server, what? And why would "it" being "someone else's bot" be significant?
SquidDev #19
Posted 09 February 2018 - 09:14 AM
That'd be even better, OAuth2 would totally work with the HTTP api as well. Sidenote, (insert wave emoji here) @SquidDev. Been a few years ;)/>
It might even be possible to use CC(Tweaks|: Tweaked)'s websockets, though that's less portable than normal HTTP. Hello again! Wow, it really has been a long time :)/>. Good to see you!
Edited on 09 February 2018 - 08:14 AM
H4X0RZ #20
Posted 09 February 2018 - 12:31 PM
That'd be even better, OAuth2 would totally work with the HTTP api as well. Sidenote, (insert wave emoji here) @SquidDev. Been a few years ;)/>/>/>
It might even be possible to use CC(Tweaks|: Tweaked)'s websockets, though that's less portable than normal HTTP. Hello again! Wow, it really has been a long time :)/>/>/>. Good to see you!

I actually once wrote a partial lib using urn and CC:T websockets.

The problem with only using the HTTP API would be that you get ratelimited really fast; using the HTTP API in order to continuously fetch messages counts as abusing the API AFAIK.

Posting _as_ the user is also something I would rather not do. That counts as userbot which are being hunted right now.
Edited on 09 February 2018 - 11:33 AM
LoganDark2 #21
Posted 14 March 2018 - 12:42 AM
[…] That counts as userbot which are being hunted right now.

No. If you have a bot running on an account that responds to others invoking commands, sure. But if you have your own service connecting to an account and sending messages from your own input only, that's fine as long as it isn't abused.
H4X0RZ #22
Posted 15 March 2018 - 09:23 PM
[…] That counts as userbot which are being hunted right now.

No. If you have a bot running on an account that responds to others invoking commands, sure. But if you have your own service connecting to an account and sending messages from your own input only, that's fine as long as it isn't abused.

Unfortunately this isn't true :/
https://support.discordapp.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-

One thing I could do is use a webhook though. With that I can change the name with every message sent.
LoganDark2 #23
Posted 15 March 2018 - 10:28 PM
[…] That counts as userbot which are being hunted right now.

No. If you have a bot running on an account that responds to others invoking commands, sure. But if you have your own service connecting to an account and sending messages from your own input only, that's fine as long as it isn't abused.

Unfortunately this isn't true :/
https://support.disc...unts-self-bots-

One thing I could do is use a webhook though. With that I can change the name with every message sent.

Look closer.

"Automating normal user accounts is forbidden"

"Automating normal user accounds is forbidden"

Automation = doing things without user input. Therefore, simply creating a client that lets you send messages and nothing else is not automating and does not fall under that… maybe they might do something if you rub it in their face, but this does no harm, so they won't mind.

Believe me, I know how much Discord is willing to tolerate. It took a botnet of over 75 bots raiding a large server to actually get a ban.

Not saying I do that anymore, but I used to be a very horrible person.
H4X0RZ #24
Posted 31 May 2018 - 11:04 PM
I've also seen cases of running a selfbot (that only responds to commands issued by the user) and the act of logging in to your account using something other than the official client getting banned.
AyScorch #25
Posted 10 June 2018 - 06:28 PM
Strange Error https://imgur.com/a/br14Oxf
H4X0RZ #26
Posted 16 June 2018 - 05:59 PM

I believe this is a problem with Titanium. Not sure though.

Also… DisCCord won't work because the bot is gone.