#development

1 messages ยท Page 343 of 1

hidden tusk
#

.work

earnest phoenix
#

-bots

gilded plankBOT
#
Rainbowdashboygamer#2846
Bots

@edgy dew

idle mountain
#

How do I avoid "TOO MANY REQUESTS" error when my bot is on a lot of servers lirikN

umbral pelican
#

thonk does your lib not handle rate limits?

idle mountain
#

pretty sure it would

brisk notch
#

-bots

gilded plankBOT
#
Wistful__#9063
Bots

@mellow wagon

hallow nimbus
#

-bots

gilded plankBOT
#
eliteeliteSeraTT#2255
Bots

@blissful gate

slate comet
#

-bots

gilded plankBOT
#

This user has no bots

slate comet
#

ok

smoky rampart
#

-bots

gilded plankBOT
#
Jamu#2893
Bots

@keen copper

smoky rampart
#

owo

wispy jolt
#

testing channels pls

#

lol

bronze mason
#

So what are guilds used for? the coding i mean

lethal sun
#

guilds are servers

#

same thing

bronze mason
#

I mean like { "id": "41771983423143937", "guild_id": "41771983423143937", "name": "general", "type": 0, "position": 6, "permission_overwrites": [], "nsfw": true, "topic": "24/7 chat about how to gank Mike #2", "last_message_id": "155117677105512449", "parent_id": "399942396007890945" }

lethal sun
#

How to make the bot profile image to bounce?

earnest phoenix
#

Discord Nitro ๐Ÿ˜‚

#

But, how? A good question

lethal sun
#

to bounce on the bot page

umbral pelican
#

just look at the source code

earnest phoenix
#

i need some help with my discord bot

#

await channel.overwritePermissions(role, {
^^^^^

SyntaxError: await is only valid in async function
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:152:10)
at Module._compile (module.js:605:28)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3

#

it throws this error

umbral pelican
#

and tells you what the error is

#

" await is only valid in async function"

earnest phoenix
#

but how do i fix it ...

steel shoal
#

hello

#

how can i get the count from the voice channels and text channels?

#

who can help me with that

umbral pelican
#

what lib

steel shoal
#

js

umbral pelican
#

that's language, not library

steel shoal
#

discord.js

umbral pelican
#

channels.size

steel shoal
#

yea i know but is it channels.size.voice?

#

and text or ome thing else

umbral pelican
#

no, you'll have to filter the channels collection to return ones of a certain type

steel shoal
#

hmm

steel shoal
#

thx

#

i take a look

#

can you count all the category?

#

or a category

earnest phoenix
#

i have a problem again...

#

(node:15752) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'has' of undefined
(node:15752) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

rich kiln
#

Send code pls

#

@steel shoal you can. Just need to filter it

steel shoal
#

sure

#

sec

#
.addField("Channels:", guild.channels.size, true)
.addField("Voice Channels:", guild.channels.size.voice, true)
.addField("Text Channels:", guild.channels.size.text, true)
#

@rich kiln

umbral pelican
earnest phoenix
#

@steel shoal I will only spoonfeed once bloblul
msg.guild.channels.filter(c => c.type === 'voice').size

steel shoal
#

@earnest phoenix thx i test it

earnest phoenix
#

no worries mmLol

steel shoal
#

๐Ÿ‘

rich kiln
#

.size.voice wouldnt even be a thing.

junior lily
#

getting an error when trying to post guild count Thonk

#
StatusCodeError {name: "StatusCodeError", statusCode: 401, message: "401 - {"error":"Unauthorized"}", error: Object, op
smoky rampart
#

looks like you're unauthorized

thorny hinge
#

^

junior lily
#

but

#

it should be authorized

smoky rampart
#

I would check your authentication methods

junior lily
#

it should be right

smoky rampart
#

obviously not, I'm only suggesting a double check

junior lily
#

hmmm

#
function postServerCount() {
        return request.post({
            uri: `https://discordbots.org/api/bots/${client.user.id}/stats`,
            headers: {
                Authorization: "token",
            },
            json: true,
            body: {
                server_count: client.guilds.size,
            },
        });
    }
#

tonk

smoky rampart
#

why is it Authorization instead of "Authorization" Thonk

#

where's strings I want strings

#

I'm not used to this reeee

thorny hinge
#
function hi(){
let a = "1";
const db = await sql.get(`SELECT * FROM something WHERE something= ${something}`);
a = db.something;
return a;
}

How can I make the function actually return the value instead of { Promise <pending> }? GWflamesThonking

#

I can console.log a and do stuff with it fine but I cant return it

jagged plume
#

you'd need to make your own promise and then resolve it

thorny hinge
#

Reeeeee

#

H0w

#

Promises are so GWmythicalHyperREEEE

tawny lava
#

promises are sexy

thorny hinge
#

No

fervent goblet
#

thats why you don't use js

#

fuck promises

thorny hinge
#

@jagged plume but the async/await is already a promise eh? GWflamesThonking which is why it returns promise?

umbral pelican
#

the function hi() is synchronous

jagged plume
#

you need to return your own promise

#

then resolve it with your data

thorny hinge
#

Reeeeeeee

#

promises GWchadMEGATHINK

#

Promise.resolve()?

earnest phoenix
#

(node:769) ExperimentalWarning: The http2 module is an experimental API.

#

anyone knows what this issue can be?

bitter sundial
#

it's just a warning

unreal tusk
#

Hey guys! How can I get ids of reactions in discord?

pale light
#

reaction event

sinful meadow
#

i have the same issue @earnest phoenix

#

dont know why

pale light
#

same here

restive silo
#

@earnest phoenix thats from snekfetch using the "new" http2, you can completely ignore that

#

node.js is a bitch and shows that when snekfetch requires it

earnest phoenix
#

i see

restive silo
#

annoying tbh

#

but shouldn't appear that often

#

๐Ÿ‘€

earnest phoenix
#

thanks for the help :)

restive silo
elder badge
#

any1 know the fix 2 this?
code is:

const { inspect } = require('util');

exports.run = (client, message, args) => {

  const { logger } = message.client;
          snekfetch.get(`http://artii.herokuapp.com/make?text=${args.input}`)
              .then(ascii => {
                  if (ascii.text.length > 1999) return message.edit('Output too long. Try shorter text.').then(message => message.delete(2000));
                  return message.channel.send(`\`\`\`${ascii.text}\`\`\``);
      });
}
fervent goblet
#

isn't there some js module for ascii?

elder badge
#

idk never looked

#

but do you know a fix for that @fervent goblet?

fervent goblet
#

yes, move to py

elder badge
#

ew

#

py

fervent goblet
#

py better

pale light
#

yeah ok

restive silo
#

@elder badge i guessing that args is an array then args.input won't work

elder badge
#

so what do i put instead? @restive silo

restive silo
#

args is an array

elder badge
#

yep

restive silo
#

you want to get the array as string

elder badge
#

so?

restive silo
#

jeez you guys really dont know js, <Array>.join() is a thing

elder badge
#

well actually i don't really mess around with things like this

restive silo
#

then you should do that

#

because that is basic js

elder badge
#

ik i'm starting lol

restive silo
elder badge
#

k

restive silo
#

^ if you want read more

elder badge
#

ok

unreal tusk
#

Do you know why when I use links to load tracks from yputube bot sometimes can add another track?

                    sendErrorMsg(event, new             EmbedBuilder().setColor(Color.RED).setDescription("Invalid source"));
                    return;
                }

                String input = Arrays.stream(args).skip(1).map(s -> " " + s).collect(Collectors.joining()).substring(1);
                input = "ytsearch: " + input;
                loadTrack(input, event.getMember());```
inner jewel
#

you always tell it to search

mighty barn
#

This is possibly dumb but i've been trying to make something like `if (args[2] !== "x" || "y") message.channel.send("z")?

inner jewel
#
            String identifier;
            try {
                new URL(args[0]);
                identifier = args[0];
            } catch(MalformedURLException e) {
                if(args[0].equals("soundcloud")) {
                    if(args.length == 1) {
                        showHelp(context);
                    }
                    identifier = "scsearch:" + String.join(" ", Arrays.copyOfRange(args, 1, args.length));
                } else {
                    identifier = "ytsearch:" + String.join(" ", args);
                }
            }```
#

@unreal tusk

#

args being user input

#

@mighty barn if (args[2] !== "x" || args[2] !== "y")

mighty barn
#

mhm

#

does not seem to function properly?

#
case "test":
    if (args[2] !== "x" || args[2] !== "y") return message.channel.send("a");
    else message.channel.send("z");    
unreal tusk
#

@inner jewel can you tell me more?

inner jewel
#

that checks if the input is a valid URL

#

if it is, it gives the input to the loadItem method

#

else it prepends the search prefix

fervent goblet
#

WAIT

#

if(!args[2].equalsIgnoreCase("x"))

unreal tusk
#

If i enter valid url, jda can load some other video

fervent goblet
#

equalsIgnoreCase

unreal tusk
#

and if i enter url like www.youtube.com/... it can envoke exception
com.sedmelluq.discord.lavaplayer.tools.FriendlyException: This video is unavailable.

earnest phoenix
elder badge
#

@earnest phoenix I fixed it anyway

earnest phoenix
#

k

inner jewel
#

@earnest phoenix no

earnest phoenix
#

yes

inner jewel
#

that code was sending an ascii "undefined"

#
undefined```
earnest phoenix
#

as a string?

inner jewel
#

vs an ascii version of that

earnest phoenix
#

๐Ÿ‘

#

ah

inner jewel
#

args.input was undefined probably

earnest phoenix
#

hmm ok

unreal tusk
#

@inner jewel Jda also gives me random youtube video with your code

inner jewel
#

that code works fine for me

#

ยฏ_(ใƒ„)_/ยฏ

#

did you register the sources?

unreal tusk
#

How can I do it?

inner jewel
#

i do this

#

because i don't want the http one

unreal tusk
#

Of course, I forgot about it ๐Ÿ˜“

lethal sun
#

How i can make so the bot sends a DM to a specific user?

steel shoal
#

hi

fervent goblet
#

Pyfiglet

wispy jolt
#

what about it

fervent goblet
#

nuttin

wispy jolt
#

ok

earnest phoenix
#

need help

#

});
^

SyntaxError: Unexpected token )
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:152:10)
at Module._compile (module.js:605:28)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3
[nodemon] app crashed - waiting for file changes before starting...

quiet bobcat
#

Remove ) and try again

pale light
#

fix your brackets

earnest phoenix
#

but were

quiet bobcat
#

At line 80

#

the }); part

#

It should be line 80

earnest phoenix
#

i havent got line 80?

quiet bobcat
earnest phoenix
#

yeah

quiet bobcat
#

Try ctrl + f and then });

#

And try to remove ) on all of them

#

But one at a time

#

And then restart the bot

earnest phoenix
#

umm

#

totally not...

quiet bobcat
#

?

#

How many }); can you have

earnest phoenix
#

few

#

but i founded it

#

removed it

#

reloaded

#

C:\Users\nicolietsa personal\Desktop\security-bot\bot.js:14
};
^

SyntaxError: missing ) after argument list
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:152:10)
at Module._compile (module.js:605:28)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3

quiet bobcat
#

Hmm

#

Line 14

#

try adding )

pale light
#

๐Ÿคฆ

quiet bobcat
#

idk

#

ok

earnest phoenix
#

});
^

SyntaxError: Unexpected token )
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:152:10)
at Module._compile (module.js:605:28)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3

#

now this

quiet bobcat
#

hm

#

Can you show me the lines over 14

earnest phoenix
#

i think its this

#

bot.generateInvite(["ADMINISTRATOR"]).then(link => {
console.log(link);
}).catch(err => {
console.log(err.stack);
});

#

its 10 to 14

quiet bobcat
#

Uhm

#

just try removing the whole });

#

I dont think its needed

earnest phoenix
#

i did that alredy..

quiet bobcat
#

Hm

earnest phoenix
#

});
^

SyntaxError: Unexpected token )
at createScript (vm.js:80:10)
o at Object.runInThisContext (vm.js:152:10)
at Module._compile (module.js:605:28)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3

quiet bobcat
#

I dont know

#

Sorry

earnest phoenix
#

i did that on tutorial and all was right

quiet bobcat
#

hmm

earnest phoenix
#

and still error...

quiet bobcat
#

I don't know

earnest phoenix
#

and i shoud get it ready for tomorrow

quiet bobcat
#

Sadly I don't understand the error myself

#

So I can't do anything to fix it

topaz fjord
earnest phoenix
#

@topaz fjord Host it on a VPS

#

then use nginx and proxy_pass to hide IP of VPS

#

on a website

topaz fjord
#

@earnest phoenix waht i mean is how to move a specific part of the json data

earnest phoenix
#

what is the point of moving it?

#

no purpose

topaz fjord
#

like if i make a header called Command Count, and move the command count number under that header

earnest phoenix
#

an HTTP header?

topaz fjord
#

putting the command count number under

#

that header

earnest phoenix
#

wtf

#

um ok

#

that is simple

topaz fjord
#

thast just a test website

#

not real

earnest phoenix
#

kk

#

make an HTTP request to the API, then set the data of the text to the command count

topaz fjord
#

does this change if im using request

earnest phoenix
#

well first

#

the image you sent

#

that is not a proper API response

#

that is using HTML

#

you can't use HTML in JSON

topaz fjord
#
var express = require('express');
var app = express();

app.get('/', function (req, res) {
  res.send({
    server_count: bot.guilds.size,
    user_count: bot.users.size,
    command_count: bot.commands.size,
    channel_count: bot.channels.size,
    uptime: moment.duration(bot.uptime/1000, "seconds").format("d [D], h [Hrs], m [Mins], s [Secs]")
});
});

var server = app.listen(3000, function () {

  var host = server.address().address;
  var port = server.address().port;

  console.log('Example app listening at http://%s:%s', host, port);

});
#

im doing it like that

earnest phoenix
#

ok then

#

nvm

#

but still, make an HTTP request to that API, then set data of the element to command count

gilded geyser
#

hi

earnest phoenix
#

hi

gilded geyser
#

pass the mayo

earnest phoenix
#

no

topaz fjord
#

how would i set the data of h1?

earnest phoenix
#

javascript

topaz fjord
#

how would i do it within node.ks

#

.js

earnest phoenix
#

well

abstract mango
#

setting a element's data using node.js

earnest phoenix
#

LOL

abstract mango
#

don't think you quite get this

earnest phoenix
#

^

#

if you used it in the back end using Node.js, then there is no point for an API

abstract mango
#

the element modification has to happen in web javascript

earnest phoenix
#

^^^^^^^^^

shy rose
#

@topaz fjord should look at a service called data dog

topaz fjord
#

do you have to have a company

#

@shy rose

shy rose
#

nope

#

just a email

#

im on free tier

#

the limit is 5 monitors and yet doing what i do doesnt even count as a monitor cause i jsut add data over api only thing i guess thats limiting is data retention is 24 hours

topaz fjord
shy rose
#

0_o

topaz fjord
#

am i on the wrong site?

shy rose
#

that de logo?

topaz fjord
#

wut is the site

#

yeah

#

that logo

shy rose
#

could do signup with google?

topaz fjord
#

yeah

#

i just put

shy rose
#

i got signed up on a promtion and got free stuff

topaz fjord
#

my company as Hobby

shy rose
#

whats your bot in? is it node?

#

it looks like node

topaz fjord
#

yeah

shy rose
#

https://www.npmjs.com/package/dogapi so this one lets you run over the api otherwise all other clients ive seen (probably more) all use the datadoglocal server which in my opionin is just luggage cause that collects stats then uses api to send :?

topaz fjord
#

you had to download the installer right?

shy rose
#

?

#

for the local server you would

pale light
earnest phoenix
#

how do you make your bot edits its own message

pale light
#

message.channel.send().then(m => {m.edit("Edited Message here")})

earnest phoenix
#

ok

#

ty

jagged plume
#

spoonfeed.exe

earnest phoenix
#

wait

#

how do you make your bot edit its own messages mutiple times?

prime cliff
#

๐Ÿคฆ does noone even read the docs for there lib

#

It solves most of the problems

earnest phoenix
#

XD

#

i jsut want to know how to make your bot edit its own messages mutiple times?

thorny hinge
#
const hi = await msg.channel.send("hi");
hi.edit()
hi.edit()
hi.edit()
#

ur msg handler will need to be async tho

earnest phoenix
#

i use command handlers

thorny hinge
#
client.on("message", async message => {
});
#

Oh

#

Then

#

Async

#

:^)

#

If u dont wanna use async/await, you can nest a bunch of .then() functions

#

Not recommended

earnest phoenix
#

idk whats wrong with this code or im jsut retarted

#
const Discord = require("discord.js");
const responses = [
    'Yes',
    'Absolutely!',
    'No',
    'Out look Good',
    'What?',
    'Hopefully',
    'Hopefully not',
    'I Dont Know',
    'Ask another question',
    'Haha, funny joke',
    'Hell No',
    'Ohhhh Yes!',
    'Certain',
    'Uncertain',
    'Yes Baby',
    'Bitch No'
];

function randomItem(array) {
    return array[Math.floor(Math.random() * array.length)];
}

exports.run = (bot, message, args) => {
    if (args.length < 1) {
        message.channel.send('**Please specify something to ask of the magic 8-ball**');
    }
    else {
    let response = randomItem(responses);

    const ball = await msg.channel.send("8ball | .");
    hi.edit("..")
    hi.edit("...")
    hi.edit(`Magic 8ball: ${responses}`)

    message.channel.send(`${ball}`)
  }
};

exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: [''],
  permLevel: 0
};

exports.help = {
  name: '8ball',
  description: "Ask a question",
  usage: '8ball'
}
#

this is right?

pale light
#

no

earnest phoenix
#

XD

#

whats wrong then XD

pale light
#

return array[Math.floor(Math.random() * array.length)

#

also

#

const ball = await msg.channel.send("8ball | ."); hi.edit("..") hi.edit("...") hi.edit(Magic 8ball: ${responses})

earnest phoenix
#

how do i fix it?

pale light
#

why are u returning an array of a random number

#

of an array

#

ah

#

I see

#

nvm

#

ok

#

next

earnest phoenix
#

?

pale light
#

this is more minor

#

but

#

when you edit the message it should really have 8ball |

#

before it

#

is there an error?

earnest phoenix
#

yes

#

SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

pale light
#

line 80

#

which line is that

earnest phoenix
#

there is not even line 80

#

XD

#

what file?

#

app.js or 8ball.js

pale light
#

vm.js

earnest phoenix
#

??

pale light
#

line 10 vm.js?

earnest phoenix
#

wtf

#

i dont even have a vm.js file

#

XD

pale light
#

uuuh

earnest phoenix
#

wait

jagged plume
#

thats an error with your catch

#

catch should have an argument

earnest phoenix
#

i jsut want to edit my bots own message mutiple times

#

how do i do that with this code?

#
const Discord = require("discord.js");

const responses = [
    'Yes',
    'Absolutely!',
    'No',
    'Out look Good',
    'What?',
    'Hopefully',
    'Hopefully not',
    'I Dont Know',
    'Ask another question',
    'Haha, funny joke',
    'Hell No',
    'Ohhhh Yes!',
    'Certain',
    'Uncertain',
    'Yes Baby',
    'Bitch No'
];

function randomItem(array) {
    return array[Math.floor(Math.random() * array.length)];
}

exports.run = (bot, message, args) => {
    if (args.length < 1) {
        message.channel.send('**Please specify something to ask of the magic 8-ball**');
    }
    else{
    let response = randomItem(responses);

    message.channel.send(`:8ball: | **${response}**`);
  }
};

exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: [''],
  permLevel: 0
};

exports.help = {
  name: '8ball',
  description: "Ask a question",
  usage: '8ball'
}
jagged plume
#

you have an error with your handler somewhere

pale light
#

I would just use .then

jagged plume
#

i literally just told you how to fix it

sinful meadow
#

lmao

earnest phoenix
#

XD

sinful meadow
#

he is using the idiots guide

jagged plume
#

everyone using discord.js seems to use it

sinful meadow
#

just letting you know that command handler is complete shit

jagged plume
#

lol

earnest phoenix
#

XD

sinful meadow
#

and doesnt work with most functions

jagged plume
#

ive made my own one using classes now and i like it

sinful meadow
#

For example

#
exports.conf = {
  enabled: true,
  guildOnly: false, <==== Does jack shit
  aliases: [''],
  permLevel: 0
};
jagged plume
#

subcommands with their own functions and stuff

earnest phoenix
#

XD

#

XD

sinful meadow
#

that guildOnly thing

#

does nothing

earnest phoenix
#

ok

jagged plume
#

what do you mean

#

it stops it from being used in dms

sinful meadow
#

No it doesnt

jagged plume
#

yes...?

sinful meadow
#

Nope

#

He is using the idiots guide handler

#

THE handler doesnt have anything for that to do

#

That option is completely useless

#

Doesnt do anything

#

@jagged plume Look at this

#

Find were it says guildOnly inside the message.js event

earnest phoenix
#

i found the issue and i fixed it

#

and i put this

#
const Discord = require("discord.js");

const responses = [
    'Yes',
    'Absolutely!',
    'No',
    'Out look Good',
    'What?',
    'Hopefully',
    'Hopefully not',
    'I Dont Know',
    'Ask another question',
    'Haha, funny joke',
    'Hell No',
    'Ohhhh Yes!',
    'Certain',
    'Uncertain',
    'Yes Baby',
    'Bitch No'
];

function randomItem(array) {
    return array[Math.floor(Math.random() * array.length)];
}

exports.run = (bot, message, args, async) => {
    if (args.length < 1) {
        message.channel.send('**Please specify something to ask of the magic 8-ball**');
    }
    else{
    let response = randomItem(responses);

    const ball = await message.channel.send("8ball | .");
    ball.edit("..")
    ball.edit("...")
    ball.edit(`Magic 8ball: ${responses}`)

    message.channel.send(`${ball}`);
  }
};

exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: [''],
  permLevel: 0
};

exports.help = {
  name: '8ball',
  description: "Ask a question",
  usage: '8ball'
}
#

and this is the error

#

const ball = await message.channel.send("8ball | .");
^^^^^^^

SyntaxError: Unexpected identifier
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at jsfiles.forEach.f (C:\Users\narnia\Desktop\Vortex test\test.js:25:17)

#

how do i fix?

pale light
#

do you have an async message evengt

earnest phoenix
#

im useing a command handler

#

how do i put a async message event in a command handler?

#

nvm

gilded geyser
#

hi

earnest phoenix
#

Hey peeps?

#

I has a quesstiioonnn

#

How can I set an interval to last only a certain amount of time?

wooden shoal
shy rose
#

like mine execpt you got round to making it look good ๐Ÿ˜›

wooden shoal
#

lol

gilded geyser
#

l

pale light
#

the animation looks off

wooden shoal
#

Yep I've redone it

pale light
#

loooks better

wooden shoal
#

cool

#

any suggestions?

pale light
#

can't think of any

wooden shoal
#

ok

earnest phoenix
#

@The Darkness Soldier#1418 do not try @shy rose's method

#

It doesn't work

#

that is not proper JS

shy rose
#

its not intended as a copy paste

earnest phoenix
#

but you provided an example

#

that is incorrect

shy rose
#

i dont know the code to put in

earnest phoenix
#

You knew it was invcorrect?

#

incorrect*

#

but you didn't bother to fix it?

#

sounds like a bad coder to me

#

:/

shy rose
#

thanks...

earnest phoenix
#

lol

shy rose
#

its called giving a gist not spoonfeeding

earnest phoenix
#

It isn't a gist

shy rose
#

not a git gist

earnest phoenix
#

then what is a gist?

shy rose
#

also whats actually wrong with that code?

earnest phoenix
#

the setTimeout thing

#

The interval would immedientally stop

#

wouldn't get time to run

shy rose
#

?

#

thats where theres a TimeHere part

earnest phoenix
#

The first argument of setTimeout is a function

#

but you're not providing one

#

you're giving it an object

#

which it can't handle

shy rose
#

0_o that persons left the server

#
var x= setInterval(stuffHere)
setTimeout(()=>{clearInterval(x)},TimeHere)
#

you happy now?

earnest phoenix
#

yes there you go

#

also you don't really need the { around clearInterval

#

lol

shy rose
#

?

earnest phoenix
#

How about you make sense of what I said lol

#

I couldn't say it any better

#

You don't need the { and } around the clearInterval part

shy rose
#

i know what you mean but whats the point even the person has left the server

earnest phoenix
#

What if he comes back?

#

idk

#

I'm tired gn

shy rose
#

if they come back then by the moring there will be like another 6 million messages here

#

and cause ive said that there will only be like 5 messages....

earnest phoenix
#

Probably not many messages yes

unreal tusk
#

Do you know why JDA gives me exception when I try load music track by youtube link?

com.sedmelluq.discord.lavaplayer.tools.FriendlyException: This video is unavailable.

slate comet
#

@unreal tusk Video could be blocked in country?

#

or lavaplayer is being an ass

sinful meadow
#

@earnest phoenix mass spamming edits can be api abuse

winged vapor
#

Can someone help me with getting a username with oAuth2

merry yoke
#

yay its downloaded

thorny hinge
#

Show us how it works

merry yoke
thorny hinge
#

Try making a ping pong bot

merry yoke
#

discord bot maker UI is better than steam's

sinful meadow
#

Tbh it kinda is

fervent goblet
#

discord bot maker is shit

#

takes the fun out of develpoing

#

developing*

lethal sun
#

^

merry yoke
#

this program bugged

quasi halo
#

tbh discord bot maker is shite

#

the audio tools are fucking awful

#

and makes everything 10x harder somebhow

fervent goblet
#

its nothing but a super customisable bot

#

it would be easy to create something like this without the ui

#

in any language

wooden shoal
#

Can anybody help me? I am trying to figure out ow to send a user's profile image with discord.js, but cannot figure out how

fervent goblet
#

user.avatarURL?

#

smth like tha

wooden shoal
#

Ok but how does it work? I already tried this message.channel.sendMessage({file: user.avatarURL});

fervent goblet
#

message.channel.sendMessage(user.avatarURL);

wooden shoal
#

No it's not working

#

user.avatarURL is undefined actually...

#

wait

#

ok I got it thanks

quiet bobcat
#

This is going to sound dumb but how do I make my bot respond to mentions?

wooden shoal
#

you can check if any user's first mention is the bot's

#

or just check if a message begins with the mention

quiet bobcat
#

ok

#

Thanks

wooden shoal
#

np

quiet bobcat
#

Wait

#

How do I add multiple prefixes

#

So like eg a. and A. I'm using node.js

thorny hinge
#

Node.js

fervent goblet
#

Hey, is there any python developer in here who could help me develop a new project I'm working on? Please DM me for more information!

#

@thorny hinge

thorny hinge
#

No

#

I validate my links ๐Ÿ‘€

quiet bobcat
#

Validate?

thorny hinge
#

yes ._.

quiet bobcat
#

nice

thorny hinge
#

I check if the d.gg link is valid

#

So I need to get the redirect links of the d.io d.me d.li links

#

So I can validate those

#

๐Ÿ‘€

quiet bobcat
#

Hmm

thorny hinge
#

So many bots just check if it includes something but I validate them GWbinMmlol

quiet bobcat
#

cus your bot is so much better GWbinMmlol

fervent goblet
#

should be pretty easy

#

make a request

thorny hinge
#

Found a redirect npm module ๐Ÿ‘Œ

quiet bobcat
#

๐Ÿ‘Œ

fervent goblet
#

lol

earnest phoenix
#

not***

wooden shoal
#

npm is pretty much an easier and lazier alternitive to ctrl-c and ctrl-v

fervent goblet
#

lol

#

holy fuck 2k festival coins in pokemon ultra sumo

#

for global event

#

lets participate

winged vapor
#

i need sum help

thorny hinge
#

With

merry yoke
#
public static void postRequest(String url, JsonObject jo, String auth){
        try {
            HttpsURLConnection con = (HttpsURLConnection) new URL(url).openConnection();
            con.setRequestMethod("POST");
            con.addRequestProperty("Content-Type", "application/json");
            con.setRequestProperty("Authorization", auth);
            con.setDoOutput(true);
            con.getOutputStream().write(
                    jo.toString().getBytes());
            

        } catch (IOException e) {
            e.printStackTrace();
        }
    }```
#

this code doesn't work for posting stats

#
public static void postStats(){
        try {

            JsonObject jo = new JsonObject();
            jo.addProperty("server_count", Cuberz.getBot().getGuilds().size());
            postRequest("https://discordbots.org/api/bots/364678314108911616/stats", jo, TOKEN);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }```
thorny hinge
#

Is that java GWchadMEGATHINK

merry yoke
#

yes

thorny hinge
#

aaaaaaaa

fervent goblet
#

REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

merry yoke
#

@thorny hinge know why it doesn't work ?

thorny hinge
#

Idk exactly, I dont do java

#

But

#

Whats the error?

quasi sandal
#

@merry yoke use okhttp

#

It comes with jda

unreal tusk
#

how can I add reactions using JDA?

languid dragon
#

is "message" defined in the same scope

#

ok

#

yeah

#

put args and command

#

inside the message event ๐Ÿ˜†

tight rock
#

hi

fervent goblet
#

Hey, is there any python developer in here who could help me develop a new project I'm working on? Please DM me for more information!

unreal tusk
#

Hey gyus! How can I add reactions using JDA?

tawny lava
#

reading the docs usually helps Thonk

unreal tusk
#

nope ))

fervent goblet
#

oh my goodness

#

lmfao

#

ik

#

lol

#

didn't u already define it?

#

lmfao

midnight fern
#

I have a question
How do the other bots have an organized command list
like each command has a separate file
Any idea how thats done?

#

JavaScript

earnest phoenix
#

Wdym?

midnight fern
#

In the sense

#

I want to keep the commands organized

earnest phoenix
#

Okay

midnight fern
#

I want to make each command a different file

earnest phoenix
#

Alright

midnight fern
#

Except I don't know how they will be linked.

earnest phoenix
#

Oh!

#

Use this code

midnight fern
#

Okay thanks

earnest phoenix
#
global.client = client
require('./Folder_Name_Here/file_name_here.js');
#

You can keep adding requires for all the files

#

You dont need to keep adding a global client

#

And if its in multiple folders

#

Just keep going down a layer

#

If you get what I mean

midnight fern
#

I do

earnest phoenix
#

๐Ÿ‘Œ

midnight fern
#

It should work I guess, thanks, I forgot to add a global var

earnest phoenix
#

Np and rip

#

Hey guys?

#

I have a question

#

How do I assign a global variable to use accross all files

midnight fern
#

EH, in my defence, I thought there could be a better way

#

๐Ÿคท

quiet bobcat
#

How do I make the bot respond to mentions?

neon pasture
#

Jack?

quiet bobcat
#

Can someone help me?

lethal sun
#

?

earnest phoenix
#

Inb4 this is the new dapi

quiet bobcat
#

Im trying to make so my bot doesnt respond to dms

#

Like command wise

earnest phoenix
#

wut lang

lethal sun
#

thonk

#

js

#

djs

quiet bobcat
#

But it should still send a message

#

ye djs

#
        if(!message.guild)then => {
            (message.channel.send("This command does not work in DM's!"))
            return;
        }```
#

Thats what I got so far

#

It works in a guild but I get ```
if (nowplaying[message.guild.id]) {
^

TypeError: Cannot read property 'id' of null```

#

if its not in a guild

glossy sand
#

what the hell is that first snippet

#

that's not valid js syntax as far as I know

quiet bobcat
#

I dont know anything at this point

glossy sand
#

do you come from vb?

quiet bobcat
#

vb?

glossy sand
#

visual basic

#

or perhaps lua?

quiet bobcat
#

what?

#

No?

glossy sand
#

just curious about your use of then

quiet bobcat
#

I dont know how to use then

glossy sand
#

then isn't a keyword in javascript

#

conditionals are just

if (/* condition */) {
  //action
}
quiet bobcat
#

Ok

glossy sand
#
if (!message.guild) {
  message.channel.send('foobar');
}
#

for example

quiet bobcat
#

I tried that

#

But after the message.channel.send a return;

#

But it didnt return

glossy sand
#

but did the message send?

quiet bobcat
#

no

#

it just skipped over that part

glossy sand
#

can we get some more context?

#

perhaps you aren't registering the listener properly or something

quiet bobcat
#

Sure

#
        case "queue":
        if(!message.guild)then => {
            (message.channel.send("This command does not work in DM's!"))
            return;
        }
        
        var iconurl = bot.user.avatarURL;
        if (nowplaying[message.guild.id]) {
            var video = nowplaying[message.guild.id];
            var server = servers[message.guild.id];
            var desc = `**Currently Playing:**\n${video.title}\n\n`;
            for (var i = 0; i < server.queue.length; i++) {
                if (i == 0) {
                    desc = desc + "**Queue:**\n";
                    desc = desc + `**${i + 1}.** ${server.queue[i].title}\n`;
                }
                else {
                    desc = desc + `**${i + 1}.** ${server.queue[i].title}\n`;
                }
            }
            var embed = new Discord.RichEmbed()
                .setAuthor("Queue", iconurl)
                .setColor(0x7289da)
                .setDescription(desc)
            message.channel.send(embed);
        }
        else {
            var embed = new Discord.RichEmbed()
                .setAuthor("Queue", iconurl)
                .setColor(0x7278da)
                .setDescription("No music is currently playing.")
            message.channel.send(embed);
        }
        break;```
#

Thats the entire command

mighty barn
#
    if (message.channel.equals(Discord.DMChannel)) return (message.channel.send("This command does not work in DM's!"));
#

That shall work shouldn't it?

quiet bobcat
#

I can try it

glossy sand
#

but why bother

#

checking for the existence of message.guild should be enough

#

navigating up the prototype tree is just wasting cycles

mighty barn
#

mhm probably, just giving some other ways it could work with

quiet bobcat
#

That didnt work

glossy sand
#

@quiet bobcat are your other commands working?

quiet bobcat
#

The ones that arent based around guild actions are

glossy sand
#

remove the then => and see if it works

#

there's absolutely no reason it shouldn't

#

I hardly understand why that doesn't throw syntaxerror in the first place

quiet bobcat
#

You're a genious

#

I cant spell

#

Thank you so much @glossy sand

neon pasture
#

Is there a RPC extension for Eris?

glossy sand
#

no

neon pasture
#

for real :(

lethal sun
#

How to make so the bot sends a DM to a specific user (not the message author)?

glossy sand
#

well what specific user is that

lethal sun
#

me

glossy sand
#

oh

#

use your user id

lethal sun
#

like so for example: someone does <!report haha

#

then the bot dms me with: haha

glossy sand
#

on startup, retrieve and store a reference to your own user

#

then just use that to send dms

prime cliff
#

Why is general locked?

glossy sand
#

spam

prime cliff
#

Oh

earnest phoenix
#

@lethal sun js bot.users.get(userID).send("blah");

earnest phoenix
#

how do you download ffmpeg?

glossy sand
#

go to the ffmpeg website and hit the big download button

earnest phoenix
#

then

#

i downloaded it

glossy sand
#

...what else do you want to do?

#

you just asked how to download it lol

earnest phoenix
#

like how to set it up and all that

cosmic plover
#

lol

glossy sand
#

uh run the installer?

#

that's it

earnest phoenix
#

ok

blazing star
#

k

earnest phoenix
#

but

#

when i downloaded it

#

it says it cant fined ffmpeg as an error

#

nvm

#

nvm

#

wait

#

XD

#

yea

#

ut says it cant fine ffmpeg

#

y?

glossy sand
#

you're running a *nix os?

earnest phoenix
#

no

#

im on windows

glossy sand
#

are you running the bot on your windows machine then?

earnest phoenix
#

what?

glossy sand
#

like, where are you running your bot

earnest phoenix
#

on my computer XD

glossy sand
#

...your windows computer?

earnest phoenix
#

yep

glossy sand
#

so open command prompt and run ffmpeg -version

earnest phoenix
#

ffmpeg version 3.2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --e
e-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --e
e-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm -
ble-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-l
enh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-l
xr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-lib
is --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-
vid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.100 / 57. 64.100
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100

glossy sand
#

well obviously ffmpeg is on your path

#

how does your bot try to detect ffmpeg?

blazing star
#

rip ffmpeg

earnest phoenix
#

no

#

it says it cant fine ffmpeg

blazing star
#

all i would do is download ffpeg

earnest phoenix
blazing star
#

from the site

glossy sand
#

so obviously you wrote some code that throws the error "FFMPEG not found"

#

we want to see that code

earnest phoenix
#

ok

blazing star
#

imma let u explain @glossy sand

#

im lazy

#

lel

earnest phoenix
#
client.on('message', async msg => {
  if (msg.author.bot) return undefined;
  if (!msg.content.startsWith(prefix)) return undefined;
  const args = msg.content.split(' ');

  if (msg.content.startsWith(`${prefix}play`)) {
    const voiceChannel = msg.member.voiceChannel;
    if (!voiceChannel) return msg.channel.send('You need to be in a voice channel!');
    const permissions = voiceChannel.permissionsFor(msg.client.user);
    if (!permissions.has('CONNECT')) {
      return msg.channel.send('I can not connect to your voice channel!');
    }
    if (!permissions.has('SPEAK')) {
      return msg.channel.send('I can not speak in this voice channel!');
    }

    try {
      var connection = await voiceChannel.join();
    } catch (error) {
      console.error(`I could not join the voice channel: ${error}`);
      return msg.channel.send(`I could not join the voice channnel: ${error}`);
    }

    const dispatcher = connection.playStream(ytdl(args[1]))
      .on('end', () => {
        console.log('song ended!');
        voiceChannel.leave();
      })
      .on('error', error => {
        console.error(error);
      });
    dispatcher.setVolumeLogarithmic(5 / 5);
  }
});
blazing star
#

b

#

that looks fine

#

like rlly fine

earnest phoenix
#

bro it took you like 3 sec to look at it XDD

blazing star
#

so

#

i dont see no errors

#

so thats good

earnest phoenix
#

then y doe it say

blazing star
#

ok

fervent goblet
#

Any python developer interested in working with me on a new project? DM me if you are interested!

glossy sand
#

you're using ytdl-core, I assume?

blazing star
#

yeah

earnest phoenix
blazing star
#

he is

earnest phoenix
#

yesim using ytdl-core

blazing star
#

ytdl-core

#

has nothing too do with ffmpeg

#

well mabye idk

earnest phoenix
#

thne y does it sayyyyyyy ffffmmmpeeeeeggg notttt foooouuunnnndddd

blazing star
#

ok

#

do

#

npm i ffmpeg-bianaries

fervent goblet
#

cuz u haven't installed ffmpeg

#

my god

blazing star
#

lol

earnest phoenix
#

i did that dosent work

blazing star
#

u have to be kidding

earnest phoenix
#

@fervent goblet

#

wanna see something

fervent goblet
#

?

earnest phoenix
#

ffmpeg version 3.2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --en
e-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --en
e-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --
ble-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-li
enh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-li
xr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libv
is --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-l
vid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.100 / 57. 64.100
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100

blazing star
#

npm i -g ffmpeg-binaries

#

do that

earnest phoenix
#

i did ffmpeg -v

blazing star
#
npm i -g ffmpeg-binaries
earnest phoenix
#

@blazing star did that doesnt worrrrk

blazing star
#

just do it

earnest phoenix
#

i already told you

blazing star
#

IT WORKS

earnest phoenix
#

omfg

blazing star
#

soz im getting triggered

earnest phoenix
#

im telling you

#

it doesnt work

#

i jsut did it

blazing star
#

uGH

#

i quit

#

dies

glossy sand
#

I don't get it

earnest phoenix
#

dont say something if you know it doesnt work for me cuz i said "It doesnt work"

glossy sand
#

neither d.js nor ytdl depends on ffmpeg

blazing star
#

yeah

earnest phoenix
#

im saying that to @blazing star

glossy sand
#

where is your error coming from

blazing star
#

FFMPEG not found

#

he hasnt installed it

earnest phoenix
#

stfu @blazing star

#

you siad you quit

blazing star
#

hey

#

thats mean

fervent goblet
#

Any python developer interested in working with me on a new project? DM me if you are interested!

blazing star
#

le

#

l

#

i no use py

earnest phoenix
#

grammer

#

its im not using py

glossy sand
#

@earnest phoenix seriously nothing in that code can ever throw FFMPEG not found

#

aren't you logging the error or something

earnest phoenix
#

come on my server let me show you

#

i did it on my test bot

glossy sand
#

no

#

do you log errors to console?

earnest phoenix
#

omg nvm i dont even know wtf you guys are saying

young cradle
#

"[...] seriously nothing in that code can ever throw FFMPEG not found"

#

It can

restive olive
#

fuu fuu

earnest phoenix
tawny lava
#

same tbh

low niche
#

how would you set a mention prefix in discord.js?

languid dragon
restive silo
#

@low niche use a RegExp

low niche
#

ok

fading grotto
#

How to add Servercount?

stone kiln
#

READ!

fading grotto
#

Ok ty

floral stump
#

so uh

#

ill ask here

#

need to make a mute command

#

ive created a mute role but im not sure how to change channel permissions using js

sinful meadow
#

@floral stump something like this

#
message.guild.channels.map(e =>{
   message.guild.members.map(f =>{
   e.overwritePermissions(f, {
           SEND_MESSAGES: false
       })
   })
});
earnest phoenix
#

@low niche don't use @languid dragon's example, it is broken

languid dragon
#

what

#

what example

earnest phoenix
#

that would see "settings list @Bot" as a command

#

and not the proper way

languid dragon
#

then do .startsWith(client.user.toString())

#

?

#

or just client.user

earnest phoenix
#

that won't work either

languid dragon
#

honestly its untested and im not 100% sure

floral stump
#

@sinful meadow can you explain what map does

languid dragon
#

so imma continue doin my thing ๐Ÿ‘€

floral stump
#

im dumb

#

:c

earnest phoenix
#

map iterates over an array

#

And sets the values to the result for the function of the map argument

floral stump
#

im actually having a hard time understanding the code he sent me

earnest phoenix
floral stump
#

you know im on it

earnest phoenix
#

look at MDN

floral stump
#

no i get the code

#

but im trynna change perms for a role and he didnt define it in the code which is why im havin a ahrd time

earnest phoenix
#

Look at the docs for your lib

#

We're not gonna spoonfeed

#

Find it yourself

floral stump
#

never asked ๐Ÿคท

#

anyway thank

sinful meadow
#

@floral stump

#

Map is like forEach

#

But faster

golden terrace
#

a!invite

earnest phoenix
#

@sinful meadow not true

#

yes it's faster but it's different

#

It can fuck up your whole array if used incorrectly

sinful meadow
#

See incorrectly

#

I dont lmao

earnest phoenix
#

how do I make this work?

if variable in (list or list or list):
    print("hi")
fervent goblet
#

so, you want to iterate through 3 lists at once?

earnest phoenix
#

yeah kinda

fervent goblet
#

what you could do is list1.extend(list2)

#

and then list1.extend(list3)

earnest phoenix
#

ah I see, thanks

sinful meadow
#

Lib? @earnest phoenix

fervent goblet
#

that has nothing to do with lib

sinful meadow
#

Im asking because i could of help lmfao @fervent goblet

fervent goblet
#

the lib has nothing to do with this

earnest phoenix
#

eh

fervent goblet
#

you won't be able to support more if u know the lib

earnest phoenix
#

it's just on the programming language side of things

fervent goblet
#

btw gijs

#

je kan ook zip() proberen

#

zip(list1, list2, list3)

earnest phoenix
#

oh ja tuurlijk, vergeten ๐Ÿ˜ฆ

glossy sand
#
if thing in (list1 + list2 + list3):
  pass
#

90% sure you can concatenate lists with +

fervent goblet
#

yes you can

#

just tested

earnest phoenix
#

thank you all!

glossy sand
#

actually that's a really bad solution

fervent goblet
#

?

glossy sand
#

you should just do

if thing in list1 or thing in list2 or thing in list3:
  pass
sinful meadow
#

If it was js i woulf say use switch

#

Would*

glossy sand
#

concatenating the lists is inefficient

earnest phoenix
#

But that's a messy "if" statement, I'd rather go with zip

#

looks cleaner, is cleaner

glossy sand
#

but in the end, it's less efficient and it's not idiomatic

#

it's up to you I suppose

wanton nova
#

How do I get my bot back onto this server?
It got kicked for a token leak, which got fixed (weird cause we didnt see any token on our github)

fervent goblet
#

DM mods

wanton nova
#

ah okay

earnest phoenix
#

I fixed sniperbot. How do add it back?

weak parrot
#

By going to the website and re adding it?

earnest phoenix
inner jewel
#

just wait

#

there's a queue

earnest phoenix
#

ok

umbral pelican
#

back of the queue kiddo

earnest phoenix
#

lol

fervent goblet
#

oh my goodness

#

fifth time u ask for attention lol

wispy jolt
#

use any

#

oh nvm i was late

low niche
inner jewel
#
 let ids = client.config.bot.ownerids
        for(var id in ids) {
            if(msg.author !== id) return;```
scenic crest
#

should be continue

low niche
#

lmao

crystal burrow
#

Support server for Aeiou bot?

#

Forget it...

rich kiln
#

uh...cant ppl read? this is a channel for development not a bot-support channel Thonk

smoky rampart
#

๐Ÿค”

earnest phoenix
#

@low niche oml

#

that eval is cancer

#

You dont even hide any sensitive information

low niche
#

Not yet

#

@rich kiln nobody reads channel topics

rich kiln
#

neither i

prime cliff
#

No people cant read at all welcome to Discord

shy rose
#

wait where the topics?

#

is that new?

rich kiln
#

lol

earnest phoenix
#

@shy rose umm wut

#

do you even Discord

#

look up

shy rose
#

i mean who really every reads them theve been around for ages

earnest phoenix
#

oi, ik this isnt related to any topic but how do I create a request api? Thonk

shy rose
#

request what?

#

request that latest cat gifs?

glossy sand
#

@earnest phoenix you mean you want to make a restful server?

shy rose
#

oh restful that makes more sense

earnest phoenix
#

Yeah well sort of

#

An api that you can post to and also get information from

#

sort of like DBL's api

glossy sand
#

yes that would be a restful server

shy rose
#

thats a resful one then?

earnest phoenix
#

except think of it as a blocked list

glossy sand
#

what language do you plan on using for it?

earnest phoenix
#

Hmm

#

JS?

glossy sand
#

try express

shy rose
#

ay know that

earnest phoenix
#

Ok

shy rose
#

yeah express is good

earnest phoenix
#

xD

#

I've used express before but not for apis tbh xd

glossy sand
#

there's also restify

shy rose
#

jsut like running it as a website except you jsut change what it repls

#

express that is

glossy sand
#

i think it's meant to be more lightweight than express

shy rose
#

whats the diff in output?

glossy sand
#

but i've never done a comparison personally

shy rose
#

(ive never looked at or heard of restify)

earnest phoenix
#

Is there any way to store a php api in a json based bot?

inner jewel
#

"json based bot"

#

wat

glossy sand
#

what does "store a php api" mean anyways

uncut slate
#

who here knows bulma

earnest phoenix
uncut slate
earnest phoenix
#

Yup

#

they have docs

#

๐Ÿ˜‰

uncut slate
#

mhm, I know

earnest phoenix
#

Mhm

#

What are you stuck on?

uncut slate
#

trying to find the right item for something that will eventually be a soundbar (e.g. play/pause buttons, volume slider)

earnest phoenix
#

I mean, is there any way i can use a php api with json discord.js based system?

uncut slate
#

looked at columns, but those auto-center

#

@earnest phoenix what kind of storage format does your PHP API return

#

is it XML, is it JSON

earnest phoenix
#

/index.php?page=help&topic=dapi

#

don't want to link as it it'll embed

uncut slate
#

they return in JSON IIRC

earnest phoenix
#

ic

#

thank you

uncut slate
#

so the fact that it's a "php api" doesn't matter

earnest phoenix
#

@uncut slate don't know without looking for that sorry

#

I mean columns could work

#

Make the progress bar have flex grow

#

So everything else is at the edges