[JavaScript][Discord Bot + FiveM] IamAdren's Tweet Bot!

IamAdren's Twitter Bot

This script adds the feature of being able to do either /tweet in game which will go to Discord and FiveM Chat or in Discord being able to do !tweet and it goes to FiveM and Discord

Note from the author:
This bot/script uses Javascript and NPM Modules, I’ve been using LUA for awhile but I’ve always liked JavaScript after watching Jeva’s Video on JS in FiveM I gave it a shot! This won’t be the last JS resource you will see from me.

Download

Installation

FiveM Setup

  1. CD Into the folder Not while the FXServer is started!

  2. Type npm i

  3. Run the SQL File into your MySQL Server.

  4. Edit the config with your MySQL Details

Discord Bot Installation

  1. Clone repository

  2. Create a app bot token key at Discord Developers

  3. Edit ./config.js file with your config details

{
    anonymousAccounts: true,
    discord: {
        prefix: '!', // Prefix to be used with the Discord Bot
        token: '', // Discord Bot Token
        tweetChannel: '' // the channel ID which tweets from ingame will go to
    },
    mysql: {
        host     : 'localhost',
        user     : 'root',
        password : '',
        database : 'adren_scripts',
        table    : 'twitteraccounts'
    }
}

Screenshots

Tweet from FiveM Chat

Tweet command from Discord

6 Likes

Nice job!

1 Like

Does this really need a database? Why not just host the discord bot on the resource and send a message when /tweet is ran

Why not just use a webhook

4 Likes

To store usernames, you can do /setUsername.

Because you wouldnt be able to do !tweet from discord. You can do !tweet in a channel in Discord and it can go to FiveM, You can tweet from discord to fivem or fivem to discord

Ahhh yes yes my bad i was fucking blind when reading the post my bad.

1 Like

Haha all good buddy :slight_smile:

Looks fantastic! Amazing work :smile:

Good work, looking good

you can to be honest

Thanks g

What are you on my man?

:wave:Hey @IamAdren,
I got downloaded the resource and follow the steps and I got this errors:

image

image

And I got no server path on my personal computer. I rent my server at zaphosting. There is only a FTP.
How can I fix that?

Sincerely
Ben

Its not supported on Zap Hosting.

Okay :confused:

Hi there, I’ve been getting this issue recently not too sure why as I think I’ve followed the steps correctly. I’ve tried re-doing it few times with no success so I’m here to ask for help. This is the issue I get when starting

1 Like

This is a weird weird error. I would try re installing your default FX resources. Seems like its a yarn resource error which is built into those default resources.

Thanks for the quick reply, I’ve updated my server yesterday actually to latest artefacts version before I was setting this up. I’m going to try to run this on a clean server, to see if it’s something in my current server. :smile:

Yea that could be a possible error. Keep me updated though!