I Made Construct 3 Host A Discord Bot (JavaScript/Event Sheet)

0 favourites
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • I was board and made construct host a discord bot and you can send messages with it and possibly read them too

    video:

    Tagged:

  • Video:

    youtu.be/kVpXtwTKSFo

  • DrMeepso This is awesome. No idea why nobody else commented on this. Do you have time to share a little bit on how you did this? I'm currently researching the same thing.

  • just activate the webhook from the server settings and send the data you want.

    discord.com/developers/docs/resources/webhook

    an example from my code

    oyunkulturu.com/temp/webhook.webm

  • just activate the webhook from the server settings and send the data you want.

    https://discord.com/developers/docs/resources/webhook

    an example from my code

    https://oyunkulturu.com/temp/webhook.webm

    Thanks Eren but that doesn't look like it's being controlled through Construct. I'm not remotely great at coding.

    Looking at DrMeepso 's video, I see he has "Discord.js" as a separate file in his C3 project, and can post messages via a textbox. I want to be able to do the same, as well as allow my bot to change people's roles.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I see he has "Discord.js" as a separate file in his C3 project, and can post messages via a textbox.

    ohh now i realize

    I did something like this last year.

    but it was the opposite.

    I was sending command to construct from discord.

    here example video

    oyunkulturu.com/temp/discord_k.webm

    yes you need to make bot with discord.js.

    You can run the bot on the node platform and then do whatever you want.

    If you want you can look at the code of the bot I made.

    github.com/erenertugrul/construct-discord-bot

    but I think it would be better if DrMeepso shared a sample project

  • Eren Wow, that's very clever. Having Discord interact with Construct would certainly open up a few options.

    I've been working on a Twitch Bot with Construct for the past 2 years, and I'm hoping to add some Discord interactivity to it, too.

    What do you use these features for?

  • What do you use these features for?

    just for testing purposes. I didn't use it for anything.

    maybe something useful could be done for small games and twitch streamers.

  • DrMeepso This is awesome. No idea why nobody else commented on this. Do you have time to share a little bit on how you did this? I'm currently researching the same thing.

    Discord.js has deprecated the web build of there project meaning that thanks to cors this dose not work any longer. i will share the project files if i can dig them up

    I have also integrated a twitch bot with construct 3 and i think that one still works

    -DrMeepso

  • You can get the project files

    Here

  • Thanks, DrMeepso

    That's disappointing to hear. I've been trying to figure this out for a while. Maher to connect to Twitch API without too much issue, but Discord just looks complicated.

    Do you have any other tricks up your sleeves?

    I'd hate to get this close and walk away.

  • Thanks, DrMeepso

    That's disappointing to hear. I've been trying to figure this out for a while. Maher to connect to Twitch API without too much issue, but Discord just looks complicated.

    Do you have any other tricks up your sleeves?

    I'd hate to get this close and walk away.

    It seems like the webbuild may have gotten a update

    github.com/discordjs/discord.js/tree/webpack

    but that's the best I can do

  • You did all this code yourself, DrMeepso ? Wow! How on Earth did you figure this out?

    Looking at it now, I can't make head nor tails of half of it, and it also appears to be different to the video example.

    This looks like it listens to a Discord, while your video version posts to a Discord.

    Also, "SendDiscordMSGToMainChannel" never appears to be called.

    I'd love to work on this more with you if I can twist your arm? :D

    EDIT - Yeah, I seem to be hitting the CORS issue, too... The Discord API references and instructions are pretty terrible. Doesn't seem to make sense that I can connect to Twitch with relative ease, but Discord is a confusing mess.

  • You did all this code yourself, DrMeepso ? Wow! How on Earth did you figure this out?

    Looking at it now, I can't make head nor tails of half of it, and it also appears to be different to the video example.

    This looks like it listens to a Discord, while your video version posts to a Discord.

    Also, "SendDiscordMSGToMainChannel" never appears to be called.

    I'd love to work on this more with you if I can twist your arm? :D

    EDIT - Yeah, I seem to be hitting the CORS issue, too... The Discord API references and instructions are pretty terrible. Doesn't seem to make sense that I can connect to Twitch with relative ease, but Discord is a confusing mess.

    Yeah the post is quite old and the video was filmed pretty much the same day i got it to work so it has been though some changes.

    As for discord.js it has decent documentation here docs

    when i first started trying to get it to work i did have to change the endpoint. so you may have to look into that.

    but that pretty much all i can help with because i made it so long ago.

  • >

    Yeah the post is quite old and the video was filmed pretty much the same day i got it to work so it has been though some changes.

    As for discord.js it has decent documentation here docs

    when i first started trying to get it to work i did have to change the endpoint. so you may have to look into that.

    but that pretty much all i can help with because i made it so long ago.

    Darn... was gonna start throwing money at you as incentive to get it working.

    Been trying to make a Discord bot through Construct for months now. Being able to change people's roles based on a program I've been making.

    Let me know if you ever feel like coming back to this :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)