#development

1 messages · Page 404 of 1

earnest phoenix
#

Anyone wanna help me?

frail kestrel
#

did u try doing that same thing but in ur code

earnest phoenix
#

.?

#

Void what do you mean?

floral stone
#

@earnest phoenix it needs permissions

#

chmod it

dapper olive
#

that link doesnt work

#

l0l

restive silo
#

it does

#

it takes sometimes up to 1-2 minutes

#

due caching

earnest phoenix
#

Ok.

dapper olive
#

oh now it works

dapper olive
#

Ok, so I'm trying to get my bot to DM users when they upvote

#
    if (voted) client.users.get(`${voted.user}`).send(`${voted.user} ha votado lmao!!`)
});
#

this is my code

#

but obviously it's only checking for a specific ID

gilded blaze
#

Webhooks are your answer

dapper olive
#

tru

#
 client.users.get(`${voted.user}`).send('Thanks 4 voting')
});
#

so this should work

#

amirite

gilded blaze
#

yes

dapper olive
#

k thx

glossy saddle
#

what the command to clear?

#

at visual

#

in js

dapper olive
#
    if (command === 'mohamed') {
        dbl.getVotes().then(votes => {
            if (votes.find(vote => vote.id == "388456774732349450")) {
                return msg.channel.send('test');
            } else {
                return msg.channel.send('NOPE');
            }
        });
    }
#

ok so I made this command to test this

#

even tho I voted it seems like not

#

because it always says 'nope'

#

(and that's my user ID)

earnest phoenix
#

dbl.hasVoted("388456774732349450").then(voted => {})

#

@dapper olive

dapper olive
#

oh

#

oh now it makes sense

#

ty

knotty steeple
#

how would i add a 5 second cooldown to a command

dapper olive
#
    const votacion = new Discord.RichEmbed()
        .addField("¡Gracias por votar al INDIBOT!", "¡Ahora tienes acceso al comando *españa! ¡Pruébalo tu mismo!")
        .setColor(0xf47442)
        .setThumbnail('https://discordbots.org/images/dblnew.png');
    client.users.get(`${vote.user}`).send({embed: votacion})
});
#

So I did this to DM a user when he upvotes the bot

#

but no DMs or anything

native palm
#

Why are you using a template string for that?

glossy saddle
#

?

#

that bad?

native palm
#

What's it doing? What isn't it doing?

#

I need more information!

uncut slate
#

please use hastebin/a paste service instead

spring ember
#

anyone knows a good way to check if a user has a manage server permission from his permission integer?

dapper olive
#

@native palm because if not it literally reads that as text

#

and I want the bot to dm the user with the embed

native palm
#

@spring ember What discord library are you using? It may have something that does that for you.

spring ember
#

no bot lib

dapper olive
#

oof

#

sorry

native palm
#

Manual conversion.

spring ember
#

yeah but what math property should I use?

#

it is supposed to be some kind of modulus right?

dapper olive
#

Maybe its because I tested it in my pc and not in a proper hosting?

spring ember
#

maybe the port is not open

dapper olive
#

thats what I thought

#

Can someone test it for me? I ran out of friends online to test

#

lmao

spring ember
#

test what?

dapper olive
#

upvoting the bot to see if it dms you something

spring ember
#

sure dm me the link

mental solstice
#

@dapper olive thats what the Test button on DBL is for

dapper olive
#

OH

#

i'm fucking retarded

#

wait a sec

hidden veldt
#

heh

dapper olive
#

forgot to add webhook details in bot settings

gleaming summit
#

I'll show you the result of message.guild

hidden veldt
#

wait

#

are u tryin to make a bot dm u when u react to it

#

or when u upvote it

gleaming summit
#

what?

dapper olive
#

when I upvote it

hidden veldt
#

oh...

#

ok

#

idk how to do that

dapper olive
#

now it has webhook details

#

but

#

when I click test nothing is happening

gleaming summit
#

In Discord.js defaultChannel wans't deprecated

#
Guild {
  members: [Object],
  channels: [Object],
  roles: [Object],
  presences: [Object],
  available: true,
  id: '383944425648422912',
  name: 'Seriumium',
  icon: 'b6aa7814dc1438b3ddfe4e5bf1222eca',
  splash: null,
  region: 'singapore',
  memberCount: 38,
  large: false,
  features: [],
  applicationID: null,
  afkTimeout: 300,
  afkChannelID: null,
  systemChannelID: '383947455114510336',
  embedEnabled: undefined,
  verificationLevel: 1,
  explicitContentFilter: 2,
  joinedTimestamp: 1522578768048,
  ownerID: '324541397988409355',
  _rawVoiceStates: Collection {},
  emojis: [Object] }

This is the result of message.guild

#

My server

#

and

#

You can see the systemChannelID

#

This is same

#

so

#

defaultChannel = message.guild.systemChannelID

#

You can test it

dapper olive
#
dbl.webhook.on('test', test => {
    console.log(`User with ID ${test.user} just tested!`);
});
#

should this work?

#

or "test" does already give vote type?

gleaming summit
#

I should work if that event has properties of test.user

dapper olive
#
dbl.webhook.on('test', test => {
    console.log(`User  just tested!`);
});
#

oh fucc

#

ok

#

so I just placed that bit of code

#

and clicked test

#

and nothing is actually happening

#

no logs

#

I'm using this in a VPS

quiet bobcat
#

That has nothing to do with development @glossy saddle

glossy saddle
#

corect

dapper olive
#

Ok now it works

#

s0rry

topaz fjord
#

webhooks take a while to send

dapper olive
#

it was just the url I introduced in bot settings was wrong

hidden veldt
#

probs not the best time to ask

#

but I got a prob

topaz fjord
#

show code and error

hidden veldt
#
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import time
import random
from multiprocessing import Process
import sys


#Here is the basic command:
#await client.send_message(message.channel, messsage)

Client = discord.Client()
client = commands.Bot(command_prefix = "")

@client.event
async def on_ready():
    print ("yep... it works!")

@client.event
async def on_message(message):
    if message.content == "test":
        x = random.randrange(1, 2)
        if x == 1:
            msg = await client.send_message(message.channel, "hi")
            await client.add_reaction(msg, "\u0031\u20E3")
            await client.add_reaction(msg, "\u0032\u20E3")
            await client.add_reaction(msg, "\u0033\u20E3")
            await client.add_reaction(msg, "\u0034\u20E3")
    def check(reaction, user):
        e = str(reaction.emoji)
        return e.startswith(("\u0031\u20E3"))
    def check2(reaction, user):
        e2 = str(reaction.emoji)
        return e2.startswith(("\u0032\u20E3", "\u0032\u20E3", "\u0032\u20E3"))
    for p in range(0, 500):
        res = client.wait_for_reaction(message=msg, check=check)
        client.send_message(message.channel, "yay!")    
        res = client.wait_for_reaction(message=msg, check=check2)
        client.send_message(message.channel, "also yay!")
        time.sleep(0.01)
    return```
#

thats my code

#

it says this

#

my token is underneath that btw

wispy schooner
#

@gleaming summit here's a question, what I'd a guild doesn't have a system channel?

hidden veldt
#
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 38, in on_message
    res = client.wait_for_reaction(message=msg, check=check)
UnboundLocalError: local variable 'msg' referenced before assignment
#

that

#

i dont get it...

dapper olive
#

how much time does a webhook take to send?

hidden veldt
#

what do I change msg to?

topaz fjord
#

@dapper olive about 1-2 mins

dapper olive
#

oh

#

why does it take so much?

gleaming summit
#

@wispy schooner You means channel can be deleted?

topaz fjord
#

caching and stuff

wispy schooner
#

@gleaming summit yes

hidden veldt
#

I want to say something without sounding rude b/c I want to take out the new messages thing. Its triggering me for some reason

glossy saddle
#

oops

#

//poll

if (cmd === `${prefix}poll`){
let question = args.slice(0).join(" ");

if (args.length === 0)
return message.reply('**Invalid Format:** `/poll <Question>`')

const embed = new Discord.RichEmbed()
.setTitle("A Poll Has Been Started!")
.setColor("#5599ff")
.setDescription(${question})
.setFooter(Poll Started By: ${message.author.username}, ${message.author.avatarURL})

message.channel.send({embed})
message.react('נŸ‘')
.then(() => message.react('👍'))
.then(() => message.react(👎'))
.catch(() => console.error('Emoji failed to react.'));

}

//token
bot.login(process.env.BOT_TOKEN);

#

?

topaz fjord
#

show error

gleaming summit
#
Guild {
  members: [Object],
  channels: [Object],
  roles: [Object],
  presences: [Object],
  name: 'test',
  icon: null,
  splash: null,
  region: 'japan',
  memberCount: 2,
  large: false,
  features: [],
  applicationID: null,
  afkTimeout: 300,
  afkChannelID: null,
  systemChannelID: null,
  embedEnabled: false,
  verificationLevel: 0,
  explicitContentFilter: 0,
  joinedTimestamp: 1525022446268,
  id: '440200686383136778',
  available: true,
  ownerID: '324541397988409355',
  _rawVoiceStates: Collection {},
  emojis: Collection {} }

@wispy schooner
Checked. My mistake. Can you tell me what is diffrent between defaultChannel and systemChannel?
Is the diffrence between two channel is automattically modifyed?

dapper olive
#

Ok, so the bot DM'd me the first time I clicked test

#

but it doesn't dm me anymore

#

and I didn't change anything

glossy saddle
topaz fjord
#
//poll

    if (cmd === ${prefix}poll){
    let question = args.slice(0).join(" ");

    if (args.length === 0)
    return message.reply('Invalid Format: /poll <Question>')

  const embed = new Discord.RichEmbed()
    .setTitle("A Poll Has Been Started!")
    .setColor("#5599ff")
    .setDescription(${question})
    .setFooter(Poll Started By: ${message.author.username}, ${message.author.avatarURL})

    message.channel.send({embed})
    message.react('נŸ‘')
    .then(() => message.react(':thumbsup:'))
    .then(() => message.react(:thumbsdown:'))
    .catch(() => console.error('Emoji failed to react.'));

  }


  //token
  bot.login(process.env.BOT_TOKEN);
#

lets see

#

so

glossy saddle
#

try?

topaz fjord
#

no

glossy saddle
#

so....

#

@topaz fjord so

#

@topaz fjord so....

#

oh

#

he not here

topaz fjord
#

can u stop pinging me

#

also can you hastebin whole code

earnest phoenix
#

plz

topaz fjord
#

@uncut slate

earnest phoenix
#

add bot

#

in your server

topaz fjord
#

you have to wait

glossy saddle
#

kens

topaz fjord
#

did u see what i said

#

can u hastebin whole code and send me link

#

and also those errors seem pretty obvious

dapper olive
#

so this is the message it should send when someone upvotes the bot

#

this actually went ok

#

but that happened when I clicked test

#

and doesn't happen anymore

#

I mean, it doesn't care how many times I click test

#

nothing appears

#

is test fixed to only 1 try?

#

now it works magically

#

just because i added a console.log

wispy schooner
#

@gleaming summit there simply isn't a defaultChannel anymore, like at all Discord removed it.

gleaming summit
#

@wispy schooner Always thanks

topaz fjord
gleaming summit
#

😭

tulip kraken
#

How would i catch the error

#

so

#

i can send a message

#

saying to make a support role

earnest phoenix
#

do you mean if (supportrole.id === null)?

tulip kraken
#

Wait

#

i can do that?

#

omg

topaz fjord
#

yes

#

or u can check

glossy robin
#

how would I catch the error from this when the ytd.search function finds no results

topaz fjord
#

if(!supportrole)

earnest phoenix
#

if res.length == 0?

#

or results.length === 0 in ur case

tulip kraken
#

if(supportrole.id === null) return msg.channel.send('Please make a role named `Support`!');```
glossy robin
#

hmm,

earnest phoenix
#

wait

tulip kraken
#

This would be the proper way right?

earnest phoenix
#

results.items.length

#

yes @tulip kraken

tulip kraken
#

Alright

#

ill try it out

#

Thanks

#
TypeError: Cannot read property 'id' of null
    at Object.module.exports.run (C:\Users\jeffrey\Desktop\mustang\commands\ticketcreate.js:6:33)
    at Client.client.on (C:\Users\jeffrey\Desktop\mustang\index.js:126:24)
    at Client.emit (events.js:185:15)
    at MessageCreateHandler.handle (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (C:\Users\jeffrey\Desktop\mustang\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:180:13)
    at Receiver._receiver.onmessage (C:\Users\jeffrey\Desktop\mustang\node_modules\ws\lib\websocket.js:137:47)```
#

same error as before

topaz fjord
#

do if(!supportrole)

#

cus with if(supportrole.id === null)

#

you checking if the id is null, from a thing thats null

tulip kraken
#

And

#

still the same error

topaz fjord
#

show code

#

of how u did it

tulip kraken
#
const Discord = require('discord.js');

module.exports.run = async (client, msg, args) => {
    if(!args[0]) return msg.channel.send('Why are you making a ticket? supply a reason please!');
    let supportrole = msg.guild.roles.find('name', 'Support');
    if(!supportrole) return msg.channel.send('Please make a role named `Support`!');
    let supportid = supportrole.id;
    if(supportrole.id === null) return msg.channel.send('Please make a role named `Support`!');
    
    msg.guild.createChannel(`Ticket-${msg.author.username}`, 'text').then(chan => {

        chan.overwritePermissions(msg.author, { SEND_MESSAGES: true,READ_MESSAGE_HISTORY: true,READ_MESSAGES: true })
        chan.overwritePermissions(supportid, { SEND_MESSAGES: true,READ_MESSAGE_HISTORY: true,READ_MESSAGES: true })
        chan.overwritePermissions(msg.guild.id, { SEND_MESSAGES: false, READ_MESSAGE_HISTORY: false, READ_MESSAGES: false })
    })
    msg.channel.send('Ticket created succesfully!')
}
module.exports.help = {
    name: 'ticketcreate'
}```
hidden veldt
#

hi

topaz fjord
#

take out the if(supportrole.id)

glossy robin
#

@earnest phoenix thanks, that works well

hidden veldt
#

ok cya

tulip kraken
#

Doesnt change a thing

earnest phoenix
#

if(supportrole.id === null) => if(supportrole === null)

tulip kraken
#

Aight

#

lemme test again

#

with that

earnest phoenix
#

ok

tulip kraken
#

Still the same damn error

earnest phoenix
#

TypeError: Cannot read property 'id' of null this error?

#

ah ofc: let supportid = supportrole.id;

#

put that line below

#

wait it is

tulip kraken
#

?

#

and yes thats the error

earnest phoenix
#

dw

#

idk wait for someone better at this or go to d.js help server

tulip kraken
#

Aight

halcyon abyss
#

your error is that the objct supportrole is null

#

You can't access a property of null or undefined

#

And even if you're doing your test, you do nothing to prevent going beyond and executing next line

#

Change that

#

That's why nothing changed

tulip kraken
#

@halcyon abyss How would i fix this problem

#

people in the DiscordAPI discord told me to do if(!supportrole) which i told them i already tried and didnt work they told me it does work, and i proved them wrong

trim plinth
halcyon abyss
#

For example, you could do something like this

if (!supportole) {
     // Here supportrole is not defined, so something like an error msg
} else {
     // here supportole is defined, so do what you wanted  to do
}```
#

I think you should read some js tutorial, those are the basics and knowing them will be really useful later

topaz fjord
#

^

tulip kraken
#

But

#

ive tried that

#

and it didnt work

#

as i said multiple times now

#

also

#

i already know those basics

#

and have implemented them before

#

ive tried these 2!

let supportrole = msg.guild.roles.find('name', 'Support');

 if (!supportrole) return msg.channel.send('Make a role named `Support`!');
let supportid = supportrole.id;

if(!supportid) return msg.channel.send('Make a role named `Support`!');
#

And that should would perfectly

#

but it doesnt

#

instead it seems like its just being ignored

tepid laurel
#

are you checking the id before the support role

tulip kraken
#

im first finding the support role then getting the id

tepid laurel
#

okay and then

#

check if a person has it?

tulip kraken
#

and in this case the role doesnt exist, so im trying to catch the error and send a message

tepid laurel
#

I mean if its null an if(!) should work

tulip kraken
#

Thats why im asking for help and being so confused

halcyon abyss
#

oops my bad read too fast didn't see the return.
Did you try to console.log(supportrole); to see what it looks like ?

#

before crashing

tepid laurel
#

100% its null

tulip kraken
#

well

#

it simply doesnt exist

#

so

knotty steeple
tepid laurel
#

use try{} catch{}

knotty steeple
#

i did

tepid laurel
#

try{
user.send()
}catch(err){
return;
}

topaz fjord
#

show code then

tepid laurel
#

will just do nothing if it cant send

knotty steeple
#
    try {
    msg.channel.send("📨 Help coming in your DMs!")
        const embed = {
        "title": "Hey! Im Artemis!",
        "description": "Here you can learn about my commands and how to use them!",
        "color": 5315286,
        "footer": {
            "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
            "text": `© 2018 SamuraiStacks | v${package.version}`
        },
        "author": {
            "name": "Artemis by SamuraiStacks.  | Click here to join support server!",
            "url": "cant"
        },
        "fields": [
            {
                "name": "The commands",
                "value": `${commandArr.join('\n')}`
            }
        ]
    };
    msg.author.send({ embed })
    } catch (err) {
        return msg.channel.send("❌ I don't have permission to send you DM messages! Please enable `Allow direct messages from server members` in your User Settings!")
    }
halcyon abyss
#

Maybe the error was triggered in the catch

#

with the return msg.channel.send

tulip kraken
#

for me?

halcyon abyss
#

no

tulip kraken
#

lmao

#

sry

knotty steeple
#

the bot has perms to send messages in the channel

slim heart
#

``` connection.query("truncate bot.censorbot")
connection.query("ALTER TABLE bot.censorbot CHANGE COLUMN idcensorbot idcensorbot INT(11) NOT NULL ;")
connection.query("ALTER TABLE bot.censorbot CHANGE COLUMN idcensorbot idcensorbot INT(11) NOT NULL AUTO_INCREMENT ;")

    var guildList = bot.guilds.array();
        guildList.forEach(guild => {
            
            
            

            
            var servername = guild.name



            
         let on = {

"serverid": guild.id,

"censor": true,

}
connection.query("INSERT INTO censorbot SET ?", on)
console.log(inserted ${guild.name})

                if(guild.id == "428570175126634516") return;
                if(guild.id == "438881277899440168") return;
                if(guild.id == "292962760764030977") return;
                if(guild.id == "437473327062450188") return;
                
        connection.query(`UPDATE censorbot SET servername = "${guild.name}" WHERE serverid = '${guild.id}'`)
                
            
        });```

is this api spamming or is it just mysql spam cuz i dont wanna get banned lmaoo

topaz fjord
#

wtf

#

thats mysql spamming

slim heart
#

ight no api spam?

topaz fjord
#

nope

halcyon abyss
#

17
down vote

You cannot use try-catch statements to handle exceptions thrown asynchronously, as the function has "returned" before any exception is thrown. You should instead use the promise.then and promise.catch methods, which represent the asynchronous equivalent of the try-catch statement.

slim heart
#

alright thnx ver

knotty steeple
#

ok

tough trench
#

do bot Client IDs have a minimum and maximum value? I have a simple html widget that provides a link to the authorize-app-on-my-server page after a user types in the client ID, and I'd like to validate that value on more than just /\d+/

topaz fjord
#

there all 64bit intergers i believe

ruby dust
#

what happens when it reaches max 64bit int?

topaz fjord
#

um

#

discord explodes

tough trench
#

well, assuming one bot is created every second (I doubt it), we'll have to wait til the heat-death of the universe 😉

fickle hawk
#

develop a 128bit int

#

?

#

or is already created

#

just isnt in cpus

#

i dunno im dumb

#

In computer architecture, 128-bit integers, memory addresses, or other data units are those that are 128 bits (16 octets) wide. Also, 128-bit CPU and ALU architectures are those that are based on registers, address buses, or data buses of that si...

#

looks like im dumb

shy verge
#

128bit ints

#

is that even a type in most languages

inner jewel
#

complex128

glossy mason
#

If by Client ID, you mean snowflakes. They can get longer.

1: 440270039120084993
2: 99922900592660480

1 is the id of latest message in this channel from 2018. 2 is the id of a message I sent in 2015. User IDs work the same way.

#

They're secretly timestamps.

inner jewel
#

they're timestamps + some info on which node generated them

topaz fjord
#

should i use nw.js or electron.js?

uncut slate
#

electron

topaz fjord
#

ok

glass heath
#

How long does it usually take for a bot to get approved/denied?

topaz fjord
#

1 hour - 1 week

glass heath
#

oof

topaz fjord
glass heath
#

i did

#

nobody cared to reply

#

:/

hidden veldt
#

:Cry:

#

wait

#

nu

#

:cookie:

#

yay

#

💻

hidden veldt
#

hi

#

oh nobodys on

#

ok cya

floral stone
#

?

hidden veldt
#

hi

#

@pearl violet

#

u a bot

#

ok

#

heres MY FRIGGIN PROBLEM

#

im tryina make a trivia bot

#

and heres my code

#
async def on_message(message):
    if message.content == "tb!trivia" or message.content == "tb!t" or message.content == "tb!T" or message.content == "tb!Trivia":
        x = random.randrange(1, 2)
        if x == 1:
            embed = discord.Embed(title="Who was the famous monk that invented champagne?", description="", color=0xff0000)
            embed.add_field(name="", value="1) Somdej Toh", inline=False)
            embed.add_field(name="", value="2) Dom Perignon", inline=False)
            embed.add_field(name="", value="3) Mattheiu Ricard", inline=False)
            embed.add_field(name="", value="4) Anselm Hurt", inline=False)
            msg = await client.send_message(message.channel, embed = embed)
            await client.add_reaction(msg, "\u0031\u20E3")
            await client.add_reaction(msg, "\u0032\u20E3")
            await client.add_reaction(msg, "\u0033\u20E3")
            await client.add_reaction(msg, "\u0034\u20E3")

            res = await client.wait_for_reaction(message=msg, emoji=["\u0031\u20E3", "\u0032\u20E3", "\u0033\u20E3", "\u0034\u20E3"], user=message.author)
            if res.reaction.emoji == "\u0031\u20E3":
                await client.send_message(message.channel, "Dom perignon is correct! Uh... no prizes. :P")
            else:
                await client.send_message(message.channel, "Sorry, that answer is incorrect! The correct answer is Dom Perignon!")```
#

but theb bot wont add reactions to embeds

#

and im sad

#

someone help?

#

thx

#

this is python async

#

discord bot

floral stone
#

Does the bot have the proper permissions @hidden veldt

hidden veldt
#

wat

#

wait

#

maybe

#

lemme check

#

haha

#

lol

#

if its that ill be pissed

floral stone
#

You should store questions in json

hidden veldt
#

wat is that

#

nope

#

didnt work

#

gave it embeds, admin, and add reactions

#

i got this

#
Traceback (most recent call last):
  File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 28, in on_message
    msg = await client.send_message(message.channel, embed = embed)
  File "C:\Python\lib\site-packages\discord\client.py", line 1152, in send_message
    data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts, embed=embed)
  File "C:\Python\lib\site-packages\discord\http.py", line 200, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: BAD REQUEST (status code: 400)
#

😦

#

what does that even mean...

#

:?

floral stone
#

It can't send the message

hidden veldt
#

I first started getting that error when I added msg = before the line

#

but I need that line

#

cuz it has to make it a variable to test the reactions and add then

floral stone
#

It's not the assignment to the variable.

#

It's a bad request

#
msg = await client.send_message(message.channel, embed=embed)```Write it exactly like that...
hidden veldt
#

hmm

#

ok

#

lemme try

floral stone
#

remove the py

#

Remove the description="", from the embed variable aswell. Don't use empty strings

#

Like in the add_field

#
q = {1: {'name': 'Question 1', 'a': 'aa', 'b': 'bb', 'c': 'cc', 'd': 'dd'}, 2: {'name': 'Question 2', 'a': 'aa', 'b': 'bb', 'c': 'cc', 'd': 'dd'}}
#

@hidden veldt

hidden veldt
#

wat

#

ok...

#

wait

#

do I change the msg = await client...

floral stone
#
            embed.add_field(name="A", value="1 Somdej Toh", inline=False)
            embed.add_field(name="B", value="2 Dom Perignon", inline=False)
            embed.add_field(name="C", value="3 Mattheiu Ricard", inline=False)
            embed.add_field(name="D", value="4 Anselm Hurt", inline=False)```
hidden veldt
#

to py then msg

#

wat...

floral stone
#

Use that

hidden veldt
#

ok

#

that it

#

ok

#

it works

#

thanks

gilded blaze
#

What's the best way to host a little http server with Java on my bot to accept POST and GET requests?

floral stone
#

It's fixed?

hidden veldt
#

yep its fixed

floral stone
#

@hidden veldt

hidden veldt
#

@gilded blaze idk

#

i dont do http or java

#

@floral stone

#

wat

#

uh... just a small thing

#

can I put A and the answer on one line?

floral stone
#

Please look over my example that I provide to you and the code your said wasn't working. See what I changed and learn from it.

hidden veldt
#

yep

#

i already ctrl c ctrl v

floral stone
#

You could do it in description

hidden veldt
#

trust

#

i dont just go here askin for spoonfeed

#

i looked this up for like 30 mins

#

i asked in other servers

#

that allow spoonfeed >:D

floral stone
#

embed = discord.Embed(title="Who was the famous monk that invented champagne?", description="A. answer\nB. answer\nC. answer\nD. answer", color=0xff0000)

hidden veldt
#

ok

#

sure

#

so I can use

#

\n in embeds

#

ok

floral stone
#

It supports markdown and bolding text along with custom emojis in description.

#

\n makes a new line

hidden veldt
#

ik

floral stone
#

\n works in majority of strings

hidden veldt
#

i tried that with await client.send_message

floral stone
#

It's not different

hidden veldt
#

and it gave me like seventeen errors

floral stone
#

post it

hidden veldt
#

well it worked

floral stone
#

post your code

hidden veldt
#

nu

#

thats what I tried before this

#

i posted it here

#

nobody answered

#

😄

floral stone
#

No, the example you provide me was different.

hidden veldt
#

:D

#

yeah it was

#

I asked yesterday

floral stone
#

You had an empty string for description.

#

Wasn't aware.

hidden veldt
#

yep

floral stone
#

You should join the discord.py server if you really need help.

hidden veldt
#

it didnt work

#

hmm

#

uh...

#

ok

#

sure

#

send me link?

floral stone
#

Sure.

hidden veldt
#

#

wwo

#

"<3" turns into the hear

#

t

#

ok discord..

heady marsh
#

Hey you should add unturned to the list of supported games for PatchBot, PLEZ. 😉

topaz fjord
#

@heady marsh ask in patchbot support server

narrow flare
#

Anyone that uses .py can tell me how to do the ping command xD?

earnest phoenix
#

store the current time send a message. get the new time. find the difference. then edit the message and send the difference.

lament meteor
#

simple ping: just reply "Pong!"
the ping that u normaly c: get the time of the command and minus it to the time of the msg timestamp

low rivet
#

or use bot.latency for the ws latency

delicate zephyr
#

@lament meteor Thats the msg response time

#

do what 4JR said for WS Latency (API Response)

lament meteor
#

ik

spring ember
#

Can I use lavalink as a lavaplayer node?

steel heath
#

Which sql thingy do you prefer for 10K sharded bot mongo or mysql?

gusty topaz
#

MySQL

delicate zephyr
#

sqlite

solemn obsidian
#

postgre

solid cliff
#

mysql mm

earnest phoenix
#

hey guys, let's say I want to send multiple messages to user on specific command
For example commandWithMultipleArgs arg1 arg2 arg3 arg4 arg5
For each argument I'll respond with a message containing info for that argument.
So following example above, in response I'll send 5 messages.
The question is, how many messages can I send before I get marked as spammer/banned?
Will I get banned if I'll respond with 20/50/100 messages?

quiet bobcat
#

just stop at like 4 or 5

fervent bronze
#

I like your name cute

#

It's cute

quiet bobcat
#

thanks lol

halcyon abyss
#

iirc it's like 5msg/5s and after that it's rate limited

fleet mason
#
{ Error: ENOENT: no such file or directory, open '../../data/BOT/bots.json'
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '../../data/BOT/bots.json' }
{ Error: ENOENT: no such file or directory, open '../../data/BOT/costumer.json'
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '../../data/BOT/costumer.json' }
^C
``` code ```  var fs = require('fs');
  fs.writeFile("../../data/BOT/bots.json", JSON.stringify (botFile, null, 4), err => {
    if (err) {
      console.log(err)
    }
  });```
why dosent if find the right files?
quiet bobcat
#

because ../../data/BOT/bots.json isn't a file

fleet mason
#

it is

#
  let botFile = require("../../data/BOT/bots.json");```
#

it can read the files

halcyon abyss
#

Is it your main script ?

fleet mason
#

no its one of my commands

halcyon abyss
#

bc i've a doubt is the path used is from the path of the main script

quiet bobcat
#

You know what ../ does right?

halcyon abyss
#

for fs

quiet bobcat
fleet mason
#

yea it goes out a folder

quiet bobcat
#

so you want to go out 2 folders?

#

and then want to go into BOT and then bots.json

fleet mason
#

yea because my folders looks like this /home/ubuntu/bot/commands/BOTcommand /home/ubuntu/bot/data/BOT

halcyon abyss
#

Yeah now I'm sure, fs use the path from your main file

#

Not the current script

#

it's not like require

fleet mason
#

ok so if i do ./data/BOT/bots.json it would work?

halcyon abyss
#

try this

fleet mason
#

ok

#

@halcyon abyss it worked thanks

halcyon abyss
#

np

steel heath
#

OwO what's this, Windows Client does not support authentication protocol requested by server; consider upgrading MySQL client

solid cliff
earnest phoenix
#

Can someone explain to me the problem?

quiet bobcat
#

It can't find the file watch.json

#

you did app twice

#

btw

#

might be why

earnest phoenix
#

So how do I fix the app twice thing?

#

İnstall /watch.json

#

Ok.

#

But I already put it in winscr

#

Error e4or

#

Wait no,

#

Not that error.

#

E404

#

That,

#

When I did npm install watch.json

quiet bobcat
#

error 404 = not found

#

watch.json is a file

#

not a npm package

earnest phoenix
#

So what do I do?

quiet bobcat
#

You make it go to watch.json

earnest phoenix
#

How?

#

I did *node app/watch.json

#

And it didn’t work.

quiet bobcat
#

i'm not sure you can run json files with node

#

if you can just try node watch.json

earnest phoenix
#

Ok.

#

Made a new line.

#

With no error or anything.

quiet bobcat
#

ok it launched watch.json then

earnest phoenix
#

Ok but the bot is still offline.

quiet bobcat
#

I don't understand why you'd ever want to run a json file

#

It's a json file

#

why would it run?

earnest phoenix
#

Idk

#

I put it in js now.

#

Now it says invalid token.

quiet bobcat
#

change to a valid token then

earnest phoenix
#

Ok.

#

The bots token?

quiet bobcat
#

Yes

earnest phoenix
#

Is there a app like winscr on mobile?

#

Winscp

quiet bobcat
#

Maybe if you had a windows phone

#

idk

#

Otherwise I don't think so

#

Winscp

#

win = windows

earnest phoenix
#

Oh ok.

lament meteor
#

pls be smart

earnest phoenix
#

No.

#

I am using digitalocean.

lament meteor
#

ok

earnest phoenix
#

Why?

lament meteor
#

so u trying to run node app/watch.json

earnest phoenix
#

It anymore but I was,

#

Not

#

Not anymore.

lament meteor
#

its all gud?

earnest phoenix
#

No.

lament meteor
#

ur bot is still offline

earnest phoenix
#

He,s

#

Yes

#

Mostly because of the token.

#

But the token is right,

lament meteor
#

ok

earnest phoenix
#

It is saying the token is wrong.

lament meteor
earnest phoenix
#

Ok.

#

But it is useless.

lament meteor
#

it can reset if ur bot has log in too many times in a time period

#

why?

earnest phoenix
#

I don’t have my pc.

#

To go on winscp and change it.

#

Ok gtg eat,

earnest phoenix
#

Back.

tulip kraken
#

Boyss

#
if (!args[0]) return msg.channel.send('Why are you making a ticket? supply a reason please!');

    let supportrole = msg.guild.roles.find('name', 'Support');

    if (!supportrole) return msg.channel.send('Make a role named `Support`!');

    let supportid = supportrole.id;

    if(!supportid) return msg.channel.send('Make a role named `Support`!');```
#

Thats still erroring

#
 TypeError: Cannot read property 'id' of null
    at Object.module.exports.run (C:\Users\jeffrey\Desktop\mustang\commands\ticketcreate.js:6:33)
    at Client.client.on (C:\Users\jeffrey\Desktop\mustang\index.js:126:24)
    at Client.emit (events.js:185:15)
    at MessageCreateHandler.handle (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (C:\Users\jeffrey\Desktop\mustang\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:180:13)
    at Receiver._receiver.onmessage (C:\Users\jeffrey\Desktop\mustang\node_modules\ws\lib\websocket.js:137:47)```
#

That error should be handled by the if(!supportrole) return; & if(!supportid) return; check

#

but it isnt

#

everytime i go to try again

#

i make sure my node process is properly shutdown

lament meteor
#

supportrole value is null

tulip kraken
#

yea i know

#

Thats why there is an if(!supportrole) return;

#

which should work

#

but doesnt

lament meteor
#

try to do console.log(supportrole) and send me what u got

tulip kraken
#

Problem solved

#

Im the biggest idiot in the world

#

Was editing my beta/dev bot

#

and running normal bot

#

SORRY for wasting time

#

😂

ruby dust
#

haha nice one

tulip kraken
#

XD

knotty steeple
#

XD

tulip kraken
#

it works fine now

halcyon abyss
#

lol

#

wp

#

at least fixed

tulip kraken
#

yea

earnest phoenix
#

.

earnest phoenix
#

How can i add something like !guilds that tells the guilds bot is in via DM or message.channel.send

#

tells the guild names"

topaz fjord
#

You can do

#

message.channel.send(bot.guilds.map(u => u.name).join('\n'))

earnest phoenix
#

^thanks

dapper olive
earnest phoenix
#

is theres a way to get all invite links of guilds with bot ?

spring ember
#

Language?

earnest phoenix
#

or send announcement to all guilds

#

node.js

spring ember
#

Send announcement is against discord ToS afaik

austere meadow
#

@earnest phoenix what lib are you using

earnest phoenix
#

ohh

austere meadow
#

it is against TOS

earnest phoenix
#

then fuck it

austere meadow
#

despite the fact that it is surprisingly easy zoomeyes

#

if you need to supply information to all people quickly, creating a support guild for your bot would be the best bet

earnest phoenix
#

something is wrong with my bot its going off and on

austere meadow
#

or putting the information in your bots presence

earnest phoenix
#

^gotcha

#

thanks

dim grove
#

That's a problem... Syntax error?

#

What language/library are you using?

earnest phoenix
#

@dim grove it was because of a wrong comma lol

#

fixed it

dim grove
#

XD

spring mesa
#

hey, i'd need some help with a JS thing

#

guild.modroles = [];
  
  guild.modroles = sql.prepare('SELECT role FROM modroles WHERE guild2 = ?').all(guildid);
  console.log(guild.modroles);```
#

this returns an array of object. how can i make it return an array of strings?

#

current output: ```[ { role: '415602802300289026' },

{ role: '314124770302230528' } ]```

inner jewel
#

.map(x=>x.role)

spring mesa
#

thank you

#
if(!message.member.roles.some(r=>guild.modroles.includes(r.name)) ) return message.reply("You need a mod role to use this command!");``` this actually seem to return true even if teh user has a mod role
#

anyone'

#

?

inner jewel
#

you save ids but compare to names

spring mesa
#

aaaah

#

right

bronze musk
spring ember
#

Webhooks should not interest you

earnest phoenix
#

I didn't understand a thing

spring ember
#

You can check if someone specific voted read the API fully

#

Use the /bots/id/check

dapper olive
#

@bronze musk use dbl.hasVoted

tender vigil
#

++

gilded blaze
#

Anyone know why when I package my java project into a jar it can’t find a lib, but in my IDE it can? (Using Maven)

glossy sand
#

are you packaging the lib with the jar or adding the lib to the classpath?

gilded blaze
#

Packaging

glossy sand
#

doing that with the shade plugin?

gilded blaze
#

Not sure about that

#

I use some plugin

#

I think I do use shade

earnest phoenix
#

Does anyone here that uses rethinkdb could help me with getting a list of values from all the documents in a table

#

so far this is all I tried:

#

Cursor<Feed> feeds = r.table("guilds").map(d -> d.g("feeds")).run(conn(), Feed.class);

#

it doesn't work but gives no error

knotty steeple
#

the .361 seconds

#

am using humanize-duration btw

solid cliff
#

Turn it into an int not a float

coral lichen
#

fetch.post(`https://discordbots.org/api/bots/431748301839400961/stats`) 2018-04-30T22:03:28.875605+00:00 app[worker.1]: ^^^^^ 2018-04-30T22:03:28.875607+00:00 app[worker.1]: 2018-04-30T22:03:28.875609+00:00 app[worker.1]: SyntaxError: Unexpected identifier

#

Why do I keep getting this error

#

fetch.post(`https://discordbots.org/api/bots/431748301839400961/stats`) .set("Authorization", "token.DBL") .send({ server_count: emoji.guilds.size })

earnest phoenix
#

finally did it

#

gaud this shit messy

knotty steeple
#

Java?

elder rapids
#

Well did you put a hash map in a list

#

That's automatic for loop twice

inner jewel
#

rethinkdb driver is shit

earnest phoenix
#

hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

low owl
#

@uncut slate Technically you could remove the cake now 😭

#

Thanks for all your congratulations 😄

uncut slate
#

have a nice birthday?

low owl
#

I had one. I'm not celebrating birthdays a lot. It's the small things that make the day great 😉

#

Oh damn, accidentally used the wrong channel. Sorry.

gilded blaze
#

my pom.xml seems fine

shy verge
#

cause ur using java

inner jewel
#

send the pom

#

and the command you're using to build

gilded blaze
#

command?

inner jewel
gilded blaze
#

hmm

#

@inner jewel still having the problem above

#

also if it matters I have to manually say what the main class is when i execute the command

inner jewel
#

how are you running it?

gilded blaze
#

java -cp DankBot.jar discord.bot.Main

mild garnet
#

Does cp stand for child pornography 🤔

inner jewel
#

you could just do java -jar DankBot.jar

knotty steeple
#

no

mild garnet
#

gets insta banned

inner jewel
#

and no

#

it's classpath

gilded blaze
#

but when i do that

#

it says:

knotty steeple
#

wrong channel

gilded blaze
#

no main manifest attribute, in DankBot.jar

inner jewel
#

then that's a broken jar

#

that configuration should build a working one

gilded blaze
#

wat

#

omg

inner jewel
#

what files are in target?

#

PROJECT_ROOT/target

gilded blaze
#

OMHG

#

OMG

#

I GOT IT WORKING

#

I JUST HAD TO DELETE IT AND REDO

#

i don't need to specify main class either

#

👍

floral stone
#

Anyone want to try my python test?

#

It's just 5 questions I gave someone.

hidden veldt
#

hi what up

#

anyone heen some help

#

I feel like helpin someone

low rivet
#

@floral stone me 😳

dull mica
#

Hello?

#

How do you prevent a d.py (async) bot from responding to other bots?

low rivet
#

modify on_message

dull mica
#

What if the normal command isn’t on_mesage

#

e.g: async def hi etc etc

#

@whatever.command()
async def test():
await whatever.say('!say help')

#

I mean I prevented others from using $say.

earnest phoenix
#

Help me out here.

modest schooner
#

the owner of this bot was banned, but it was really popular. i cant figureo ut how to get it running again from the stuff on github, but hey, if anyone else can figure it out, you'll have a popular bot.

spring ember
#

Hehe don't ask that here

glossy sand
#

lol I wouldn't run notsobot if i were you

#

unless you feel like also getting banned

toxic oracle
#

@modest schooner i doubt its really on github to be ran

#

hence the "you will have to reverse or replace the enviormental variables in the code for proper results." in the readme aswell

modest schooner
#

i couldnt even figure out what to replace ngl. i just miss notsobot...

#

i suppose if its doable some1 might do it. afaik that bot was quite popular

austere meadow
#

@modest schooner if i may just ask, what is it that is so amazing about the bot that everyone wants it back
existing features in NSB are already present/have been present for a long time in other bots, and i feel like there is plenty of ways to replace it, without the racist jokes and shit

#

image manipulation commands aren't hard to add if you have an API for it

toxic oracle
#

big words from blake

#

@earnest phoenix has image shit!!

austere meadow
#

lots of bots have it GWchadMEGATHINK

toxic oracle
#

no u

earnest phoenix
#

Putty is pissing me off.

#

I just fixed the damn token.

#

Now it is saying invalid token.

toxic oracle
#

putty as in the ssh client?

earnest phoenix
#

Yes.

toxic oracle
#

what token exactly

earnest phoenix
#

Bot token.

toxic oracle
#

how is that puttys fault

earnest phoenix
#

Idk.

toxic oracle
earnest phoenix
#

I just fixed the bot token though.

#

Ima do it again then.

#

and try node app/bot.js again.

toxic oracle
#

ok

earnest phoenix
#

Still saying token invalid.

toxic oracle
#

try and hard code it in

#

see if its wrong then

modest schooner
#

@austere meadow its image manip.

#

i know iti sp ossible to do that, its not revolutionary

earnest phoenix
#

?

modest schooner
#

i just dont know of any other bots that do that

earnest phoenix
#

hard code?

toxic oracle
#

there is literally a tag for that in the search

modest schooner
#

scroll up, im replying to an @ savitar

austere meadow
#

lets move to shitpost so we don't disturb these guys

modest schooner
#

sorry

austere meadow
#

all good

earnest phoenix
#

What do you mean?

toxic oracle
#

@earnest phoenix just literally do like client.login('token') rather than client.login(getConfigVar('token')) for example

earnest phoenix
#

Oh ok.

#
client.login('token')
#

Do I do that or the real token there?

toxic oracle
#

the real token there

earnest phoenix
#

OK.

#

Thanks.

toxic oracle
#

np

#

gotta go to school now so replies will be slow

earnest phoenix
#

Oh ok.

#

Umm I can't put my token there.

toxic oracle
#

wdym

earnest phoenix
#

It isn't letting me paste.

glossy sand
#

have you tried shift+insert

toxic oracle
#

are you using nano?

#

^

earnest phoenix
#

No.

#

puTTy

#

shift instert?

#

shift insert?

glossy sand
#

shift+insert is the standard key combo for paste in most terminal emulators

#

only exception i can think of is windows cmd

earnest phoenix
#

Erm where is insert?

glossy sand
#

top-right of most keyboards

earnest phoenix
#

esc?

#

escape?

glossy sand
#

that would be the left

toxic oracle
#

other side

earnest phoenix
#

end?

toxic oracle
#

above it to the left aswell

glossy sand
#

surely you have a key somewhere labeled "ins" or similar

toxic oracle
#

diagonal to your F12 key

glossy sand
#

i've never seen a keyboard without an insert key

earnest phoenix
#

Nope.

glossy sand
#

take a photo lol

#

i wanna see this

waxen quest
#

I have Insert near my delete button

earnest phoenix
#

How??

glossy sand
#

using a cell phone or something?

earnest phoenix
#

How do I get a photo?

#

Nope.

#

My phone is dead.

glossy sand
#

lol ok

earnest phoenix
#

Wait found it.

#

It is on my 0

toxic oracle
#

thats so weird

#

thats my )

earnest phoenix
#

insert/Defil

glossy sand
#

you probably have to press a function-lock key of some kind to switch it to insert

earnest phoenix
#

That doesn't work either.

#

Wait nvm

#

Found it.

toxic oracle
earnest phoenix
glossy sand
#

what in the world are you trying to do

earnest phoenix
#

Get my damn bot on.

toxic oracle
#

cant get his token to work i told him to hard code it into the bot and this happened

glossy sand
#

....ah

toxic oracle
#

anyways gotta go school now peace

earnest phoenix
#

I have been transferring the host.

#

From glitch to digitalocean.

glossy sand
#

i see

#

and you have no experience with unix-like systems, i suppose?

earnest phoenix
#

Yup 0 experience.

glossy sand
#

right uhh

#

does digitalocean grant you ftp access?

earnest phoenix
#

Permission to download stuff like sudp?

#

sudo?

#

If that is what you are talking about no.

glossy sand
#

i mean do you have a means of transferring files between your own computer and the vm?

earnest phoenix
#

I think so yes.

halcyon abyss
#

sudo is a command to run another command with full perms

earnest phoenix
#

digital ocean should grant sftp access

glossy sand
#

right, so here's my proposal

#

set up an instance of the bot on your own machine and ensure that it runs properly

#

then transfer the entire install to your vm

earnest phoenix
#

(use pm2)

glossy sand
#

that way, you forego having to learn how to manage unix-like systems for the time being

earnest phoenix
#

Will that get my bot online?

glossy sand
#

you should eventually learn at some point in the future since it's an essential skill but for now, we just want to get the bot running

earnest phoenix
#

it should

#

Ok.

#

at least try to get it running locally

#

Instance?

#

What does it mean by instance?

#

it means the bot

#

like an install of the bot ig?

#

Oh ok.

#

Oh I already did that.

#

does it run

limber depot
#

Wassup

earnest phoenix
#

If you mean gets online then no.

lament meteor
#

talk dev related stuff here.

earnest phoenix
#

ok why not

#

Idk

#

run it and screenshot the error

#

When ever I type ```code
node app/bot.js

#

A error shows up.

#

show me the error

#

Ok.

lament meteor
#

Error: Token is invalid

earnest phoenix
limber depot
#

Was going on

earnest phoenix
#

u didn’t

lament meteor
earnest phoenix
#

I did.

#

I have the tab open.

lament meteor
#

do it again

earnest phoenix
#

Ok.

#

how does ur bot grab the token

#

don’t show me the token

lament meteor
#

check if your running the correct file

earnest phoenix
#

Umm I made a file in winscp named .env and put the token.

lament meteor
#

ok

earnest phoenix
#

uH

#

is the bot grabbing that file?

lament meteor
#

and in ur <CLIENT>.login(process.env.token) or something like that

earnest phoenix
#

depends what wrapper he’s using

#

?

lament meteor
#

using d.js

#

everyone uses d.js

earnest phoenix
#

i use eris

toxic oracle
#

I don't

earnest phoenix
#

it’s better

toxic oracle
#

Ye same

#

I like nice ram usage ty

earnest phoenix
#

yes

#

me 2

lament meteor
#

eris is nice

#

but custom lib is the best

#

discord.nou best js lib

earnest phoenix
#

eris best period

lament meteor
#

eris is gud at X but bad at Y and..... d.js is gud at Y but bad at X so just shatp complaining

#

they are the only 2 gud js libs

earnest phoenix
#

good point

lament meteor
toxic oracle
#

Isn't ie lua

earnest phoenix
#

So umm how do I fix my bot???

lament meteor
#

@toxic oracle discordia is lua discordie is a rlly old lib

halcyon abyss
#

I'm wondering, what are the defaults about d.js ?

lament meteor
#

wat u mean?

toxic oracle
#

Ah

lament meteor
#

it hasnt been updated for a year

earnest phoenix
#

d.js?

lament meteor
#

iirc the endpoint is still like 1-5

earnest phoenix
#

d.js was updated a couple months ago I believe.

halcyon abyss
#

2 days ago on github

#

I'm just curious

lament meteor
#

@earnest phoenix

  1. check if your running the correct file
  2. check the file you are running is the <CLIENT>.login(process.env.token)
  3. try and c if your loading the wrong file and stuff
#

i was talking about discordie not d.js

#

d.js is using gateway v6

#

aka the lasted

earnest phoenix
#

?

#

I am confused.

#

What do you mean running the correct file??

lament meteor
#

node server.js and node app.js are you sure that app.js is the correct file not server.js

earnest phoenix
#

??

#

I don't use that.

toxic oracle
#

Show us bot.js

#

The contents of it

earnest phoenix
#

Ok.

lament meteor
#

i was gonna say that

earnest phoenix
toxic oracle
#

All of it

lament meteor
#

glitch yay best host

earnest phoenix
toxic oracle
#

Show the bottom of the file

earnest phoenix
lament meteor
#

where is the token

earnest phoenix
#

in .env.

toxic oracle
#

Run npm i dotenv

earnest phoenix
#
[Command("adduser", RunMode = RunMode.Async)]
        public async Task AddUserAsync()
        {
            var user = Context.Message.Author;
            await UserExtensions.SendMessageAsync(user, "To Continue, Please Enter Your Platform *[ pc | xbl | psn]*");
            var response = await NextMessageAsync();
            if (response != null)
                await ReplyAsync($"You replied: {response.Content}");
            else
                await ReplyAsync("You did not reply before the timeout");
        }

#

im trying to make it so that it gets the users pm response to the bot, but its not working.

toxic oracle
#

And in the top of the file, add require('dotenv').config()

earnest phoenix
lament meteor
#

@toxic oracle thats not .env works

earnest phoenix
#

?

lament meteor
#

in ur .env do you have
TOKEN=ODYxNzE4Nzc0NTEyNDUwMTQ4.N8lYVM.vytTJTXtRyqO8VfwefGD2UqHZLO

toxic oracle
#

Inb4 real toke

#

n

earnest phoenix
#

Yes but different token.

lament meteor
#

are you sure the token is right

#

show me the token

earnest phoenix
#

Yes it is right.

#

I checked it over and over again.

toxic oracle
#

We honestly can't help at this point because we don't know your infrastructure/code in and out

halcyon abyss
#

how does .env work ? don't see any line of code where it is get and read

lament meteor
#

.env loads itself

earnest phoenix
#

..

solid cliff
#

@austere meadow

#

lmao

lament meteor
#

also @earnest phoenix do you have "" around your token?

earnest phoenix
#

No

#

I have '

#

''

lament meteor
#

remove the ''

#

just have it has TOKEN=token

earnest phoenix
#

Ok.

#

There.

lament meteor
#

does it work?

earnest phoenix
#

Still not working.

lament meteor
#

u have a watch.json?

earnest phoenix
#

Yes.

lament meteor
#

you c where it says "throttle": 90000

earnest phoenix
#

Yes.

lament meteor
#

add a number then remove the number

earnest phoenix
#

Delete one 0 and add it back?

lament meteor
#

ya

earnest phoenix
#

Ok now?

#

Save?

#

What now??

lament meteor
#

does it work

earnest phoenix
#

No.

royal plover
#

.ping

earnest phoenix