#development

1 messages · Page 410 of 1

trim plinth
#

hmm

elder rapids
#

That actually makes sense

#

I remember fiddling with that while I was programming stuff with Vue

trim plinth
#

guess I learned something new today GWnanamiLaceShrug

quasi hearth
#

just switched to d.js I understand how the docs work now, and i agree that it is better than d.io now

knotty steeple
#

gud

#

but get ready to switch to eris soon™

floral stone
#

Is there any way to convert an adobe air (.air) app to an electron app?

topaz fjord
#

google?

trim plinth
#

thats sum hawt electron

fluid basin
#

d.io was deprecated long ago, even its stable is on Discord API v5(which is outdated, the current version is APIv6)

topaz fjord
#

theres also v7

fluid basin
#

I don't think v7 is ready yet(released)

#

Whatever, putting any version >= 6 will be using v6

topaz fjord
#

well d.js lets u use v7

shy verge
#

what's so great about v7

fluid basin
#

@topaz fjord Neh, its v6

#

Putting any version >6 will be automatically downgraded to 6

#

Cuz theres no more above 6

fluid basin
#

Yuh, using version 6/7/8/9 doesn't break the bot

#

But using 5/4/3/2/1 does

#

¯_(ツ)_/¯

topaz fjord
#

cus there discontinued

fluid basin
#

yeah but v7/8/9 theoretically doesn't exist, its just v6

topaz fjord
#

they do in my world

fluid basin
#

¯_(ツ)_/¯

shy verge
#

inb4 connects with v10

fluid basin
#

Yeah it works

raw wharf
#

Is the page falling?

quasi hearth
frail harness
#

it is indeed

loud bear
#

discord.py rewrite how to stop console getting spammed by webhook updates?

dusty shuttle
#

can someone help me to use glitch?

inland pulsar
#

This is my first time really using json for storge so i wanted to know if this is optimized enough ?

public void removeOldStuff() {
        JSONObject file = read(dataFile);
        for (Iterator<String> it = file.keys(); it.hasNext(); ) {
            String key = it.next();
            if (file.getJSONObject(key).getLong("sentTime") < (System.currentTimeMillis() - 604_800_000L))
                file.remove(key);
            try {
                Files.write(Paths.get(dataFile.getPath()), file.toString(4).getBytes());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
abstract crystal
#

@loud bear set logging level to info or warn

dusty shuttle
#

@gilded thunder hello

gilded thunder
#

School.

#

And I have loads of homework after.

#

As well as 2 assignments.

#

Find someone else who can help you in this time frame.

fluid basin
#

Any good frameworks for Eris? Thonk

earnest phoenix
#

your own

toxic oracle
#

^ my bot has a custom framework on eris

#

Allows for more customizablity anyways

earnest phoenix
#

mine is just plain eris

gilded thunder
#

@dusty shuttle Also someone who actually knows your bot language.

dusty shuttle
#

@gilded thunder ok

#

i just need to know how to host

gilded thunder
#

Look at the pins.

#

They have hosting services.

dusty shuttle
#

okay

#

is virmach good? @gilded thunder

toxic oracle
#

Lmfao just make your own choice

#

It might be good for others bad for some

fluid basin
#

yeah

toxic oracle
#

You tell us

dusty shuttle
#

us?

fluid basin
#

Honestly the best would you try it first yourself

dusty shuttle
#

okay

dusty shuttle
#

i have coded my own bot in android.......

upper tundra
halcyon torrent
#

maybe you'll find something here

halcyon abyss
#

Is there a global rate limite for sending messages ?

#

with global, I mean not just in one channel or guild

knotty steeple
#

yes

halcyon abyss
#

What's the actual rate then ?

knotty steeple
#

i dont know

halcyon abyss
#

😦

tepid laurel
#

About 5 messages I thought

#

Wait with djs then

#

Djs does auto rate it, to prevent api spam I believe

#

Not sure about the rest

lament meteor
halcyon abyss
#

Yeah, it's 5 msg/5s

#

But isn't it for each channel ?

uncut slate
#

It is

#

the 5/5s ratelimit is per channel

#

there's a global ratelimit as well, but you are very unlikely to hit that (and if you do you can contact Discord about it)

halcyon abyss
#

Well messages are being sent sometimes really slowly while reactions are like usual

#

So i wondered if ir was that

#

Or just djs saying fuck off

halcyon torrent
#

maybe your internet becomes slow sometimes?

halcyon abyss
#

Then why emojis are still sent

floral stone
#

Have you tried tracking the speed?

earnest phoenix
#

const Discord = require("discord.js")



module.exports.run = async (client, message) => {
    const request = require('request');
    const snekfetch = require('snekfetch');
    const msg = message;

 if (!message.channel.nsfw) {
        return msg.channel.send("Oh, NO NSFW outside of NSFW channel isn't alowwed");
    } else {
    const response = await request('https://nekos.life/api/lewd/neko', (e,r,b) => {
        var imageURL = JSON.parse(b).neko;
        var embed = new Discord.RichEmbed()
        .setImage(imageURL)
        .setColor("#FFFFFF")
        .setTitle('Random Neko')
        .setURL(imageURL);
        msg.channel.send(embed);
      });
    }
}
#

can't figure out why channel isn't defined

#

wait a minute...

#

i added module for some reason

night imp
#

did you find the channel

earnest phoenix
#

BRO

#

it says its not defined

#

channel is channel as in teh message channel

#

(node:17196) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'nsfw' of undefined

austere meadow
#

@earnest phoenix are you doing this inside of a DM?

#

or a guild channel

earnest phoenix
#

guild

#

dms don't have channel ids

#

so default i ignore them

austere meadow
#

i know

#

ah okay

earnest phoenix
#

i doesnt make logical sense

#

it should work XD

prime cliff
#

Dm channels do have an id still......

earnest phoenix
#

not channel ids

austere meadow
#

they have an id but its not a proper channel id

#

its not a guild channel id

earnest phoenix
#

wait

prime cliff
#

Yea lol

earnest phoenix
#

message.guild.channel.nsfw?

halcyon torrent
#

why dont you print message in the console ?

earnest phoenix
#

no

halcyon torrent
#

bad x)

earnest phoenix
#

hmm

austere meadow
#

nah that won't work

earnest phoenix
#

its not the message.

halcyon torrent
#

I know

#

but you'll see message's attributs

earnest phoenix
#

the message works i checked via console

halcyon torrent
#

but you'll see message's attributs ^^

earnest phoenix
#

the issue is channel? isnt defined somehow

austere meadow
#

channel is undefined for some reason

#

yeah

halcyon torrent
#

so do console.log(message)

earnest phoenix
#

...

#

i just said i did that kio

#

thats not the issue either

#

hmm

halcyon torrent
#

and did you get?

earnest phoenix
#

what i got the first time i tested it

halcyon torrent
#

was there an attribut channel?

earnest phoenix
#

it didnt touch that

#

it just gave the message content

halcyon torrent
#

that's howyou start debugging

earnest phoenix
#

and whined about the image

austere meadow
#

thats the issue then

halcyon torrent
#

logging every object in which you get undefined

austere meadow
#

you need a Message object not just the content

earnest phoenix
#

but why wouldnt channel be defined?

austere meadow
#

when you are passing client and message to the command, what is message

earnest phoenix
#

message.

#

is message

austere meadow
#

just message? not message.content?

earnest phoenix
#

its run in a bot.on("message", message

#

its message

austere meadow
#

you don't have a message object so you must be getting the content not the object

#

somehow

earnest phoenix
#

hmm

#

thats weird

#

XD

halcyon torrent
#

console.log(typeof message)

earnest phoenix
#
try {
  let commandFile9 = require(`./lib/commands/NSFWCommands/${cmd}.js`); // This will assign that filename to commandFile
  commandFile9.run(client, bot, message, args, func, );
} catch(e) {
  //console.log(e.message);
} finally {
//  conso

}
#

this is how its run

#
bot.on('message', message => {
}```
#

and thats how message is defined

#

its weird really weird its not message.content

#

so one would think what worked in every other command would work here

halcyon torrent
#

log typeof messae, you'll be fixed

austere meadow
#

does msg work?

halcyon torrent
#

ah

earnest phoenix
#

object

#

nope

#

thats why i tried blank message

#

its insane

#

and doesnt make sense

#

at all

#

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


const movieInfo = require('movie-info')
 

exports.run = async (bot, message, args) => {

    let movies = args.join(" ");
   if(!movies)return message.channel.send("Oh, no please list a movie")



    
    movieInfo(`${movies}`).then(
        function (res) {
            // success

var voteEmoji = ":shrug:"

if(res.vote_average < 5){
var voteEmoji = ":thumbsdown:"
}else if(res.vote_average > 5){
    var voteEmoji = ":thumbsup: "
}

         
             
           

            let movieE = new Discord.RichEmbed()
            .addField("***Title***", res.title, true)
            .addField("***Original Title***", res.original_title,true)
            .addField("***Votes***", res.vote_count, true)
            .addField("***Id***", res.id,true)
            .addField("***Popularity***", res.popularity, true)
            .addField("***Video***", `${res.video}.` ,true)
            .addField("***Vote Average***", voteEmoji + res.vote_average,true)
            .addField("***Originail Language***", res.original_language, true)
            .addField("***Genre Id's***", res.genre_ids,true)
            .addField("***Adult***", res.adult, true)
            .addField("***Overview***", res.overview, true)
            .addField("***Release Date***", res.release_date, true)
            .setThumbnail(res.imageBase + res.poster_path)
            .setColor("#FFFFFF")
          
            message.channel.send(movieE)
            
            //=> { ... }
        },
        function (err) {
            // failed
        })
    
}```
#

like here

#

message.channel.send works

#

const Discord = require("discord.js")
exports.run = async (client, message, args) => {
    const msg = message;
    const dateFormat = require('dateformat');
    dateFormat('dddd, mmmm dS, yyyy, h:MM:ss TT');
var ch;
  if (msg.mentions.channels.first() !== undefined) {
    ch = msg.mentions.channels.first();
  } else {
    ch = msg.channel;
  }
  const millisCreated = new Date().getTime() - ch.createdAt.getTime();
  const daysCreated = millisCreated / 1000 / 60 / 60 / 24;

  const embed = new Discord.RichEmbed()
    .setTitle(ch.name)
    .setDescription(ch.topic)
    .setColor(`#FFFFFF`)
    .addField("Channel ID", ch.id)
    .addField("Created At", `${dateFormat(ch.createdAt)} That\'s ${daysCreated.toFixed(0)} days ago!`)
    .addField("Users", ch.members.size);
  msg.channel.send(embed);
};```
#

here to it works

austere meadow
#

oh

#

i see the issue

earnest phoenix
#

?

austere meadow
#

commandFile9.run(client, bot, message, args, func, );
you provide client, bot, (etc) to this command
async (client, message) but it only takes two variables

#

you are defining message as bot

#

since you pass bot on that second variable

lament meteor
#

lmao

halcyon torrent
#

:d

earnest phoenix
#

oh XD

#

thx worked

austere meadow
#

👍

earnest phoenix
#

thx alot i really couldnt figure it out XD

halcyon torrent
#

tbh, what is the advantage of using d.js? eris is more powerful I think

lament meteor
#

sharding is way better on eris

austere meadow
#

d.js is more aimed towards beginners imo

earnest phoenix
#

im more familiar with it is all

#

XD

halcyon torrent
#

hm

austere meadow
#

eris is just better in the long term

#

if you plan to have a larger bot

halcyon torrent
#

I never coded in js, and I started learning with eris, without any tutorial :x

earnest phoenix
#

Im gonna be honest the reason there is client and bot is im to lazy to switch it and im using code from my old bot with depreciation im reworking

lament meteor
#

@austere meadow do u plan to recode zbot in eris?

austere meadow
#

possibly

#

only if i really need to though and i can spare some time

lament meteor
#

or stick to internal sharding

#

and dbs may also become a problem

austere meadow
solid cliff
#

Oof

lament meteor
#

@austere meadow agrreable

earnest phoenix
#

mine looks small

#

compared to that

lament meteor
#

1 file bots are the best thats why

earnest phoenix
#

XD

#

i like it to be nice and tidy

#

XD

#

boobs

#

Xd

halcyon torrent
#

what does zbot do?

earnest phoenix
#

#1 porn bot 100% truth

gilded thunder
#

Why won't this display the image, or the embed at all for that matter. Discord.py async

import requests

# dog command
@bot.command(pass_context=True)
async def dog(ctx):
    url = 'https://random.dog/woof.json'
    response = requests.get(url, verify=True)
    embed=discord.Embed(title="Bork.", color=0x176cd5)
    embed.set_image(url=data['url'])
    await bot.say(embed=embed)```
#

Please don't bring up the fact I'm using async, I just want help.

#

I'll convert eventually.

earnest phoenix
#

error whenever i try to install canvas

#

i have node gyp installed

#

i have windows tools installed

#

it just wont install

#

i have gtk 2 install for canvas to.

lament meteor
#

¯_(ツ)_/¯

earnest phoenix
#

fixed

#

Xd

#

const Discord = require("discord.js")
const { createCanvas, loadImage } = require('canvas-prebuilt');
const snekfetch = require('snekfetch');
const path = require('path');
let canvas = require("canvas-prebuilt")
module.exports.run =   async(client, message) => {

msg = message;


    const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 });


 
        const base = await loadImage(path.join(__dirname, '..', '..', '..', 'images', 'rip.png'));
        const { body } = await snekfetch.get(avatarURL);
        const avatar = await loadImage(body);
        const canvas = createCanvas(base.width, base.height);
        const ctx = canvas.getContext('2d');
        ctx.fillStyle = 'white';
        ctx.fillRect(0, 0, base.width, base.height);
        ctx.rotate(3 * (Math.PI / 180));
        ctx.drawImage(avatar, 69, 102, 256, 256);
        ctx.rotate(-3 * (Math.PI / 180));
        ctx.drawImage(base, 0, 0);
        return message.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] });
   
}

#

now whats the issue with this their is none.

#

SO WTF

#

XD

lament meteor
#

the []??

earnest phoenix
#

OH

#

Nope

lament meteor
#

¯_(ツ)_/¯

earnest phoenix
#

The module '\?\C:\Users\fireb\Desktop\Bot&Dev\BAYMAX\node_modules\canvas-prebuilt\canvas\build\Release\canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 59. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).

#

my error

#

hmm

inland pulsar
#

can you check if someone voted for your bot ?

earnest phoenix
#

yes

inland pulsar
#

:o

lament meteor
#

...

#

reinstall ur stuff @earnest phoenix

inland pulsar
#

Oh didn't see that channel thx

hot sleet
#

Guys Guys guys guys

#

how to make my bot response when anyone mention him

#
i used 
if (message.content.startsWith(bot name and the id and even <@id>))
inner jewel
#

<@!id>

#

mentions can have the ! or not

low owl
#

if message.Mentions.Any(mention => mention.Equals(myUser.GetMention()) ..

you should write an "extension" for it

#

No idea which lib you use, but some have a member "Mentions" or a Method GetMentions etc.

hot sleet
#

i use js

inner jewel
#

prefixes = ["urprefix", "<@" + bot.user.id + ">", "<@!" + bot.user.id + ">"]
for(prefix in prefixex) {
if(message.startsWith(prefix)) {
handleCommand(message.substring(prefix.length))
break
}
}

hot sleet
#

it wont work when someone mention the bot

#

nvm i found a way

#

thanks

ruby dust
#

just add a space between the prefix and a command

floral stone
#

is adding an on server join message a bad thing

#

@uncut slate

#

can I get your opinion?

uncut slate
#

having it turned on by default is a bad thing in my eyes

#

it's fine if it's opt-in

floral stone
#

I mean when the bot joins a server, send a single message saying thank you

hallow wing
#

How do I get my bot approved?

floral stone
#

@uncut slate

#

I should stop pinging

#

sorry

#

just really need someone to discuss this with

#

Is it bad if I add an on_join message

uncut slate
#

Some people hate it, but it'll help your dumb users get started

#

I guess how complicated your bot might be is also relevant

#

I wouldn't call it a bad thing myself

floral stone
#

Thanks. People in d.py is making me half guess adding a message.

#

I'm still not sure.

tulip kraken
#

it says

#

client.user.hasPermission

#

isnt a function

toxic oracle
#

because it isnt

#

guild.me.permissions.has

#

hasPermission is deprecated

tulip kraken
#

Alrighty

#

thanks

grizzled isle
#

For which version @toxic oracle?

toxic oracle
#

iirc like 11.3 and further

#

i just remember them saying something about deprecating it

#

whether they didnt idk

#

i dont use d.js anymore anyways

grizzled isle
#

ima check the docs.

#

Yea, it is deprecated. Gotta change up me code

dusty sandal
#

yo, is it possible to code a bot with .bat?

inner depot
#

i think thats not

solid cliff
#

it is possible but idk why u would want to do it :^)

inner depot
#

wtf

dusty sandal
#

noice

low owl
#

@tulip kraken I highly recommend you to refactor your code

tulip kraken
#

wdym?

low owl
#

Well, you will have trouble reading, maintaining or debugging that.

inner jewel
#

also why require admin

tulip kraken
#

needed to setup the roles and overwrite channel permissions upon joining

inner jewel
#

use manager roles/manage channels instead

tulip kraken
#

meh

low owl
#

meh what? 👀

dusty sandal
#

i mean

tulip kraken
#

"use manager roles/manage channels instead"

#

Thats funny tho

#

i just refactored it

#

nothing changed

sage hare
#

@earnest phoenix Show me the code.

#

That triggers that error

earnest phoenix
#

@sage hare

(node:1410) UnhandledPromiseRejectionWarning: Error: read ECONNRESET
    at TLSWrap.onread (net.js:602:25)
(node:1410) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1410) [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.```
#

This sis first time

sage hare
#

Can you show me the code that triggers that error

#

I mean your bot's code.

#
async(args) => {

}
#

you probs forgot the arrow function or something

spring ember
#

Just add a catch to the promise

sage hare
#

or that

earnest phoenix
#

Wait

#

I'm not at pc atm

earnest phoenix
#

How can I get my bot to only reply to messages sent in a channel called bots?

#
if(!(`name`, "bots")) return;
``` I tried message.channel and message.channel.sent but idk
grizzled isle
inner jewel
#

why not just message.channel.name !== "bots"

topaz fjord
#

or let thingy = message.guilds.channels.find('name', 'bots');

earnest phoenix
#

damn

#

you guys are smart

#

xD

#
            let p1 = ("Backstabbers", "Traitor", "European", "Innocent");
            let p2 = ("Backyard", "club", "Gmod");
            let p3 = ("servers");
            let responce1 = p1[Math.floor(Math.random() * p1.length)];
            let responce2 = p2[Math.floor(Math.random() * p2.length)];
``` Why does it only chose 2 random letters then from p1 and p2 ?
#

because maybe its not working

#

It works though

#
Juptian bot is in 5 servers!
e G servers
Juptian bot is in 5 servers!
c o servers
Juptian bot is in 5 servers!
omservers
coservers
uncut slate
#

arrays in javascript are with brackets

#

not parens

earnest phoenix
#

oh

topaz fjord
#

Yes what poof said

earnest phoenix
#
(node:804) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
    at item.request.gen.end (C:\Users\home\Desktop\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:71:65)
    at then (C:\Users\home\Desktop\node_modules\snekfetch\src\index.js:215:21)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:182:7)
(node:804) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:804) [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.
``` How can I fix this?
knotty steeple
#

what code is causing the error

earnest phoenix
#

Idk

knotty steeple
#

tbh looks like snekfetch is the problem

uncut slate
#

doubt it

#

you're probably trying to edit / delete a message that doesn't exist anymore

earnest phoenix
#

Idk

#

seems to happen randomly

knotty steeple
#

hmm

earnest phoenix
#

ok so im trying to get the channels of a discord server but it doesnt seem to be working thonk any ideas?

                                <?php
                                        $info_request = "https://discordapp.com/api/guilds/$server->id/channels";
                                        $info = curl_init();
                                        curl_setopt_array($info, array(
                                            CURLOPT_URL => $info_request,
                                            CURLOPT_HTTPHEADER => array(
                                                "Authorization: Bearer $access_token"
                                            ),
                                            CURLOPT_RETURNTRANSFER => true
                                        ));
                                        $channel = json_decode(curl_exec($info));
                                        curl_close($info);
                                    ?>```
```php
                                    <?php foreach ($channel as $ch){ ?>?
                                        <option value="<?php echo $ch->id; ?>"><?php echo $ch->name; ?></option>
                                    <?php } ?>```
#

o rip

spring ember
#

php omg

#

is that the oauth?

earnest phoenix
#

ye

spring ember
#

oh phew

earnest phoenix
#

xD

spring ember
#

try and debug it

#

see what it returns

knotty steeple
#

php discord bot Thonk

topaz fjord
#

doesnt seem like it

earnest phoenix
#

no its not a php discord bot lmao

knotty steeple
#

lmao

#

how do i check for DiscordAPIError in discord.js

loud bear
#

Failed to load extension info
ClientException: extension does not have a setup function


def setup(bot):
    bot.add_cog(Info(bot))```

am i missing something or did discord brake discord.py rewrite?
spring ember
#

add a setup function lol

loud bear
#

i do have it....

spring ember
#

send code

loud bear
#

oof captured both my screens

topaz fjord
#

is that mario

loud bear
#

ya

spring ember
#

send the code of the main function

#

that calls the addition of the cog

loud bear
#
for extension in startup_extensions:
            try:
                bot.load_extension(extension)
            except Exception as e:
                exc = '{}: {}'.format(type(e).__name__, e)
                print('Failed to load extension {}\n{}'.format(extension, exc))```
that?
spring ember
#

what are startup_extensions lol

loud bear
#

my other files whitch half of notx loading because this issue

spring ember
#

?

#

please send file hierarchy and startup_extensions

loud bear
#

startup_extensions = ["owner", "general", "info", "sfw_actions", "nsfw_actions", "sfw_self_actions", "nsfw_self_actions", "test"]

#

im using the came coding on my main bot @lone nymph but it seems to be having issues with my testing bot

vital bluff
#

Can someone help me with a purge command? To delete messages from chats?

spring ember
#

yes Tomas one sec

loud bear
#
def setup(bot):
    bot.add_cog(Testcommands(bot))```
is at the bottom off all thoes files
spring ember
#

@loud bear it's really weird because it looks good

loud bear
#

of course the testcommands replaced with class name

spring ember
#

check out the example bot I sent you

vital bluff
#

Ok thanks

spring ember
#

@vital bluff what lib?

vital bluff
#

Shall I DM you the discord?

loud bear
#

could it be because im using python 3.6 and not 3.5

vital bluff
#

I mean github

spring ember
#

no need to

#

type here

vital bluff
#

The github?

spring ember
#

@loud bear shouldn't make a difference

#

update the lib though

#

@vital bluff ask here

loud bear
#

ill see if that works

spring ember
#

what lib are you using Tomas

vital bluff
#

It's discord.js

loud bear
#

how would i update the lib again?

vital bluff
#

But it's set out weirdly

loud bear
#

im gonna see if its out of date

spring ember
loud bear
#

i honestly think windows f**ked me over

spring ember
#

I don't think so

#

never had any problems

loud bear
#

this problem just started today was working fine last night

#

and windows updated today

spring ember
#

yeah I saw

loud bear
#

this is 😡 me off

#

im just gonna not code rn i guess

#

thanks for the help anyways

spring ember
#

Gl

sick kraken
#

Hey I need help with .js

#

scripts

#

I have a thing so it has. "let mod_role = message.server.roles.find('name', settings.modrolename);"

earnest phoenix
#

and what’s up?

knotty steeple
#

pls

#

`code`

sick kraken
#

It has an error

#

at the r

#

for roles

#

I reinstalled discord.js

#

If it was that but no..

#

😦

knotty steeple
#

.guilds

earnest phoenix
#

it’s guild

inner jewel
#

message.guild

earnest phoenix
#

not server

sick kraken
#

00f

#

Thanks.

#

It worked before the last update xd

#

I'm kinda of a old scripter. 😃

topaz fjord
#

message.server was never a thing

sick kraken
#

Yes it was.

#

It always worked for me.

topaz fjord
#

shouldnt have

sick kraken
#

I'm since the beginning. 😃

#

No questions asked xd

topaz fjord
#

so idk wut ur talking about

sick kraken
#

?

#

It used too..

topaz fjord
#

nope

#

none of them have server

#

out of all the versions

shy verge
#

its called

#

guild

earnest phoenix
#

can anybody hmu with some jokes, I need some for my joke command

shy verge
#

i feel stupid

loud bear
#

hhm i got my test file working again had to rewrite it but what ever

#

lol

#

and as of my other files incorrect tabbing XD

#

but i just tried to use embeds for the first time and got this <discord.embeds.Embed object at 0x0000021242BD4E58>

#

@spring ember i found out why the file was not working XD

@commands.command```
is what i had
```py
@commands.command()``` is what i have now i think that was the issue
quasi hearth
#

I'm having issues sending a DM to me using a bot. (d.js) Does anyone know how?

shy verge
#

user.send()

trim plinth
#

message.author.send();

#

™™

shy verge
#

funny, a user is also a channel

trim plinth
quasi hearth
#

what does client.users.get do?

trim plinth
#

gets a user GWnanamiRoWow

knotty steeple
#

gets a user

#

¯_(ツ)_/¯

#

then whatever you want with them

#

bot.users.get('blah').avatarURL

quasi hearth
#

ok

halcyon abyss
#

Any idea about why discord would randomly close socket connexion with bots and make them crash ?

trim plinth
halcyon abyss
#

(3 / 4 bots had the same error at exactly the same time, not same connexion)

trim plinth
#

dunno

halcyon abyss
#

and the last one was happy to survive

#

yeaaa

trim plinth
#

odd GWsplHishironwhat

ruby dust
#

if I were to get a message object, how far in the channel's history can it go before it gives up to find that message?

quasi hearth
#

nvm, found the issue for why the dm wasn't working. The database I was using was not formatted correctly :p

shy verge
#

@halcyon abyss if your lib is worth anything then it should detect that and try to reconnect again

halcyon abyss
#

it's d.js

#

so

shy verge
halcyon abyss
#

And the error seems to be at a really low level

    throw err;

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
    at Client.emit (events.js:116:17)
    at WebSocketConnection.onError (/path/to/bot/node_modules/dis                                   cord.js/src/client/websocket/WebSocketConnection.js:374:17)
    at WebSocket.onError (/path/to/bot/node_modules/ws/lib/event-target.js:128:16)
    at WebSocket.emit (events.js:127:13)
    at WebSocket.finalize (/path/to/bot/node_modules/ws/lib/websocket.js:185:12)
    at ClientRequest._req.on (/path/to/bot/node_modules/ws/lib/websocket.js:641:12)
    at ClientRequest.emit (events.js:127:13)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:539:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:117:17)
    at TLSSocket.socketOnData (_http_client.js:444:20)```
shy verge
#
19:28:35 Gateway     System.Exception: WebSocket connection was closed ---> System.Net.Http.WinHttpException: The connection with the server was terminated abnormally
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at System.Net.WebSockets.WinHttpWebSocket.<ReceiveAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Discord.Net.WebSockets.DefaultWebSocketClient.<RunAsync>d__33.MoveNext()
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Discord.ConnectionManager.<>c__DisplayClass28_0.<<StartAsync>b__0>d.MoveNext()
19:28:35 Gateway     Disconnecting
19:28:35 Gateway     Disconnected
19:28:36 Gateway     Connecting
19:28:37 Gateway     Resumed previous session
19:28:37 Gateway     Connected

my websocket error

#

d.net will try to reconnect automatically

#

not sure about djs

halcyon abyss
#

Seems like I have to catch it manually

shy verge
#

lemme guess, the js error crashed the application?

#

happened to me when i was a js dev too

halcyon abyss
#

yeah

#

fatal error, exited before I could even do anything

#

and I doubt I can even catch it with promises handling

shy verge
#

maybe v12 has disconnection handling idk

#

¯_(ツ)_/¯

halcyon abyss
#

well, error were generated by npm modules so I doubt changing engine will solve anything

fluid basin
#

What version of node and d.js are you using?

lament meteor
#

1.0.0

topaz fjord
#

lmao

#

just add the error event

#

listener

loud bear
#

i got embeds working now lol

fluid basin
#

cool

halcyon abyss
#

well, i found this event in the docs and added the listener just in case, but if you say it catches it, i'll guess it's problem solved

ashen quail
#

so i am using this:
woods[wUser.id].woods++
How do I make it so that it adds 2 instead of one?
I have tried woods[wUser.id].woods+ 2 but it does not work

fluid basin
#

...

#

Either woods[wUser.id].woods += 2 or woods[wUser.id].woods = woods[wUser.id].woods + 2

quasi hearth
#

help! I was developing my bot on another computer, but I can't turn it off! (to update the code) If I run my new code, it makes the bot run twice. How do I manually shut off the bot?

fluid basin
#

Go to your previous computer and turn it off

#

¯_(ツ)_/¯

quasi hearth
#

rip, i can't access it till tomorrow

low owl
#

SSH 😄

#

Or even remote desktop would work 👀

quasi hearth
#

well... for some reason the issue fixed itself :p

elder rapids
#

Eval is nice

#

Actually the best way to make a bot shutdown is resetting the token

#

You'll instantly get logged out

quasi hearth
#

hmm... ok

#

I remember that if i get stuck again

night imp
#

or reset bot token

elder rapids
#

... I just said that

fluid basin
#

¯_(ツ)_/¯

floral stone
#

I keep on getting this error

elder rapids
#

You're doing I/O operation on a closed stream?

#

Best I can tell you

floral stone
#

await channel.send('{} **{}** - {}HP\n{} **{}** - {}HP'.format(p1, p1title, p1h, p2, p2title, p2h), file=discord.File("storage/error.png"))

#

Literally just sending a file.

#

I don't have nothing closed.

quasi hearth
#

if I use new Discord.RichEmbed, how do I send the embed? I'm getting this error: UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Cannot send an empty message

floral stone
#

Js?

quasi hearth
#

Im using this (d.js): msg.channel.send({embed:emb});

trim plinth
floral stone
#

Google

#

What a thing, right?

inner jewel
#

the embed is empty

fluid basin
#
const embed = {
  description: "test",
  title: "my embed"
}
msg.channel.send({embed: embed})```
#

¯_(ツ)_/¯

#

If you're using embed builder you can send it directly

trim plinth
#
const embed = new Discord.RichEmbed()
    .setTitle("haha yes");

msg.channel.send({embed: embed});
#

haha yes

dusty sandal
#

can anyone help me out here? for js how would i make a bot react to its own message mutliple times? This is like going to be used for pages in a big help menu

floral stone
#

You could use a for statement.

quasi hearth
#

its weird cuz this is what "emb" was:
RichEmbed {
title: 'Channel Reminders\n\nCurrent Time',
description: '1525914988820',
url: undefined,
color: undefined,
author: undefined,
timestamp: undefined,
fields:
[ { name: '[1] Reminder:', value: 'testing', inline: false },
{ name: '[1] Reminder Time...',
value: 'undefined',
inline: false } ],
thumbnail: undefined,
image: undefined,
footer: undefined,
file: undefined }

dusty sandal
#

how would i do that?

fluid basin
#

basic js tbh

dusty sandal
#

i forgot to mentoion that im bad

dusty sandal
#

thank you

topaz fjord
#

np

dusty sandal
#

wait a minute, i should have been more specific, the bot will react to its own message twice, each time with a different reaction.

topaz fjord
#

still possible with for loop

dusty sandal
#

ok

fluid basin
#
msg.react(emojiA);
msg.react(emojiB);
topaz fjord
#

or

#
const emojis = ["emojiA", "emojiB"];

for (let i = 0; i < emojis.length; i++;) [
msg.react(emojis[i])
}
dusty sandal
#

i assume the emojiA and B are ids (just the numbers)

knotty steeple
#

nope

topaz fjord
#

the unicode symbol

knotty steeple
#

unicode

dusty sandal
#

thanks yall

lament meteor
#

actually if u want custom emotes its only the id

loud bear
#
[<Role id=406278479483633665 name='@everyone'>, <Role id=423723362469019649 name='Cookie'>]``` how would i fix it so it only list the role names? discord.py rewrite
#
 embed.add_field(name="All roles:", value="{}".format(user.roles), inline=False)
``` is the line of code that its on
earnest phoenix
#

' '.join([x.name for x in user.roles])

trim saddle
#

i was gonna say use list but that doesn't work, thats correct ^

loud bear
#

where would i put it in the line?

trim saddle
#

value=''.join([x.name for x in user.roles])

quasi hearth
#

does anyone have an issue where spliceing arrays with objects in them turns it into an object?

grizzled isle
#

Why would you got from object to array back to object?

loud bear
#

ok so itll look like py embed.add_field(name="ALL Roles:", value=''.join([x.name for x in user.roles]", inline=False)

trim saddle
#

mmmm no

#

more like

embed.add_field(name="ALL Roles:", value=''.join([x.name for x in user.roles]), inline=False)
#

you had some typos

loud bear
#

ok thanks

trim saddle
#

np -w-

loud bear
#

i just learned how to do embeds today so ya....

#

now there is no responce for that command

trim saddle
#

send the traceback

loud bear
#

did not print one hhm

#

hold on let me disable my error checker

trim saddle
#

oki

loud bear
#

ok appently it did not refresh the file

#

@everyoneCookieRaspberry hmm 3 roles squached together

#

squashed

trim saddle
#

ohhh

#

then change the qoutes to ' '

loud bear
#

thanks that worked

trim saddle
#

np ^w^

loud bear
trim saddle
#

meh i'm still trash at it.. its just learning from your mistakes

loud bear
#

lol

#

all my coding experinces i have learned was whenever im coding my bot

#

so im still relativly new to coding

trim saddle
#

some times i still fuck up

loud bear
#

same

elder rapids
#

every programmer fucks up

loud bear
#

ya programing is trial and error

trim saddle
elder rapids
#

Programming requires very good problem solving skills

loud bear
#

testing server im guessing?

trim saddle
#

thats my bots support server i have a webhook handling events

#

but i fucked up the on_guild_join embed

loud bear
#

how would i add the little pictures to the embeds for user pfp or server pic?

elder rapids
#

By linking to the CDN url

loud bear
#
@commands.command()
    async def userinfo(self, ctx, user: discord.Member =None):
        """Get info on a user."""
        if user==None:
            await ctx.send("Please tag a user you want info on")
        else:
            embed=discord.Embed(Title="User Info:", description="Here is the info of {}".format(user.name), color=0xa40bdb)
            embed.add_field(name="Username:", value="{}".format(user.name), inline=False)
            embed.add_field(name="Nickname:", value="{}".format(user.nick), inline=False)
            embed.add_field(name="ID:", value="{}".format(user.id), inline=False)
            embed.add_field(name="Status:", value="{}".format(user.status), inline=False)
            embed.add_field(name="Playing:", value="{}".format(user.activity), inline=False)
            embed.add_field(name="Joined at:", value="{}".format(user.joined_at), inline=False)
            embed.add_field(name="Top Role:", value="{}".format(user.top_role), inline=False)
            embed.add_field(name="All Roles:", value=', '.join([x.name for x in user.roles]), inline=False)
            await ctx.send(embed=embed)``` how would i do that here is the code of my userinfo command
trim saddle
#

to get a users icon use user.avatar_url

loud bear
#

how would i put that in the code? can u send a example line

#

or is it more than one line

trim saddle
#

ez

elder rapids
#

don't spoon feed 👀

#

Just a tip

trim saddle
#

oh tru

loud bear
#

like i said im still new to embeds

#

sorry

elder rapids
#

Just look at the docs

loud bear
#

i am not really helping

elder rapids
#

Precisely why google and documentation exists

quasi hearth
#

lol

lament meteor
#

@elder rapids people makes discord bots before event knowing what py, js, java, etc is they dont understand docs and think that they could learn the lang while coding a discord bot which is wrong it is easier to learn the language first then coding a discord bot. thats why they google stuff(as most people copies code)

loud bear
#

embed=discord.Embed(Title="User Info:", description="Here is the info of {}".format(user.name), color=0xa40bdb, url="{}".format(user.avatar_url)) is that what itll look like?

brisk notch
#
class datadog extends Manager {
    getName() {
        return 'datadog';
    }

    init(bot) {

    function pushDataDogStats() {
        client.gauge('botmem', (process.memoryUsage().rss / 1024 / 1024).toFixed(2));
        client.gauge('botguilds', Math.floor(this.bot.guilds.size));
        client.gauge('botuser', this.bot.users.size);
        client.gauge('botUptime', this.bot.uptime);
        client.gauge('botlisteners', this.bot.getMaxListeners());
        client.gauge('botPing', Math.floor(this.bot.ping))
        client.gauge('botChannel', this.bot.channels.size)
        client.gauge('botHeap', (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2))
       };

       push = setInterval(this.pushDataDogStats(), 2000);
    }
    
    
};``` does this work?
elder rapids
#

ik telk, a discord bot is not really something anyone should be doing as a first project if they have never programmed

raw wharf
#

Hello, if esque send the request for my bot's certification, how long is the response time?

brisk notch
#

wrong channel

trim saddle
#

Raspberry, you can just use url=user.avatar_url to shorten

lament meteor
#

?

loud bear
#

ok

lament meteor
#

oh py

trim saddle
#

.py is the easiest lang to understand *imo

quasi hearth
#

not really, it depends sometimes.

loud bear
#

easy once you know what you doing

shy verge
#

the easiest lang is smallbasic

trim saddle
#

imo, idk anything easier than print("hewwo")

shy verge
#
puts "hewwo"
#

how about that

#

*ruby

trim saddle
#

owo language when

loud bear
#
embed.add_field(name="Amount of users I can see:", value="{}".format((len(list(self.bot.get_all_members())))), inline=False)``` will this work?
trim saddle
#

that could be simplified

loud bear
#

oh how so

trim saddle
#

for example >len(list

#

use len(set

loud bear
#

so py embed.add_field(name="Amount of users I can see:", value="{}".format(len(set(self.bot.get_all_members()))), inline=False)

trim saddle
#

counts parenthesis uhhhh

#

yes x3

loud bear
#

ok

#

you been a huge help today

trim saddle
#

aw sh-shucks it was nothing..

loud bear
#

that url thing does not seem to work

elder rapids
#

Hey look an everyone ping

#

Also why didn't you exclude that role

shy verge
#

do everyone mentions ping in an embed?

loud bear
#

it does not ping anyone

elder rapids
#

Pings don't happen when they are in embeds

#

Required to be in message.Content

#

The ping part isn't problem

#

Problem is you have a useless everyone role listed there

#

We all know everyone is part of the everyone role

loud bear
#

so how do i fix it so the users pfp shows up in the corner since url=user.avatar_url does not seem to be working

trim saddle
#

did you try and put it in the author bar?

loud bear
#

and how do i exclude the @everyone tag

#

embed=discord.Embed(Title="User Info:", description="Here is the info of {}".format(user.name), color=0xa40bdb, url=user.avatar_url)

trim saddle
#

ohhh

#

you have to put an image url in either a footer, image, thumbnail, or author

loud bear
#

ok so image.url=avatar_url

trim saddle
#

check the docs i don't think its image.url

raw wharf
#

@languid dragon
Hello, if esque send the request for my bot's certification, how long is the response time?

languid dragon
#

a long time

spring ember
#

was I pinged here?

toxic oracle
#

You tell us

spring ember
#

I can't see it but it had the red pingu style here

fair elk
#

my friend was trying to invite my bot to his server but he gets this error saying "sorry we tried very hard but somthing went wrong:( Forbidden 403"

earnest phoenix
#

is the application public?

fair elk
#

yes

earnest phoenix
#

on discord app site?

fair elk
#

it sure is

austere meadow
#

@fair elk did your friend just put his bot on the website recently

#

it probably hasn't been approved

lament meteor
#

^

fair elk
#

@austere meadow no hes tryna use my bot in his discord

#

i made mine like yesterday

austere meadow
#

"sorry we tried very hard but something went wrong" is a DBL error, not a discord error

fair elk
#

i gave him the link for

#

discord

#

bot

#

link

austere meadow
#

can you give me the link to it

fair elk
#

for my bot

austere meadow
fair elk
fossil portal
#

if i use if (message.content.toLowerCase().includes("no")) It accepts nothing and Eno also but i want it to only accept if "no" is present in the string .. how do I go about this?

dusty shuttle
#

no

fossil portal
#

?

#

nvm got an idea

lament meteor
#

why not split the it per space and check each word

#

ie. "hi Telk".split(" ") gives ["hi", "telk"]

floral stone
#

or if str in str

#

ie. if "word" in "bunch of words":

steel swallow
#

hey. could i get a hand from some more knowledgable devs?

floral stone
#

what language

steel swallow
#

JS

fluid basin
#

lawl

#

How knowledgable of a dev do you need? Thonk

severe socket
#

and what for 👀

steel swallow
#

it's not API abuse

#

or at least i really hope it isnt

#

basically my bot does a grand total of 1 thing right now which is send reminders to any channel that has used the here command

#

well actually i should specify that it is one channel per server and every time you use it it updates the channel that the reminders are being sent

#

i want to add an extra layer to that reminder being sent by allowing admins to set up notifs which the bot does all the work but it makes a role that it would ping with the reminders.

#

how ever right now im having a huge issue with that because i am trying to make it so it wont ping servers that dont have the role and pings the servers with the role.

i have also made it so that users are able to receive and remove the role if they do or dont want to be pinged

#

i have the reminder function working tho. so i am proud of that

lament meteor
#

I don’t rlly understand wat ur saying but I presume the problem is that it errors when there isn’t a role

steel swallow
#

mhm

#

it'll send @deleted-role [object Object]

lament meteor
#

Ah...

steel swallow
#

yeah

lament meteor
#

It means it’s an invalid role

steel swallow
#

yes i understand that part

lament meteor
#

Iirc there is like message.guild.roles.find(“name”, “Ping meh”)

#

Idk I’m on mobile

#

So make a var with that

steel swallow
#

bot.guilds.get(serverID).channels.get(channelIDs[i]).send(msg)

lament meteor
#

And if (!var) return

severe socket
#

d.js or eris?

steel swallow
#

d.js

lament meteor
#

@severe socket d.js

#

Eris doesn’t have .send() iirc

severe socket
#

indeed thereis no such thing in eris

steel swallow
#
            fs.readFile('reminder.json', 'utf8', function readFileCallback(err, data) {
                if (err) {
                } else {
                    var dict = JSON.parse(data);
                    for(var serverID in dict){
                        var channelIDs = dict[serverID];
                        for(var i in channelIDs){
                                bot.guilds.get(serverID).channels.get(channelIDs[i]).send(msg);
                        }
                    }
                }
            });
        }```

that is currently how i am doing the read through my list of servers and send
fluid basin
#

wow as expected it does send to all servers

severe socket
#

wait you are sending a message in every guild?

steel swallow
#

nope

#

hold up

#

look

#

it reads from a the file reminder.json

fluid basin
#

yeah basically it sends to every guild on the json

#

¯_(ツ)_/¯

severe socket
#

yeah

fluid basin
#

So if there is 10, it sends to 10. And if there is 100, it sends to 100. And if there is 1000, it sends to 1000

#

right?

#

¯_(ツ)_/¯

steel swallow
#

the way worded that sorta felt like you were accusing me that i was sending to every server my bot is on

severe socket
#

well since you are doing that at once

#

if there are 1000 reminder set up

#

going to spam the API

steel swallow
#

hmmmm

severe socket
#

but anyway I don't get what is your actual issue?

lament meteor
#

Same

steel swallow
#

ok so i want to add an extra layer to the reminder being sent

#

which is the option to get pinged when one of the reminders goes

severe socket
#

hm?

#

how does your reminder.json looks like?

steel swallow
#
    "serverID": {
        "ch": "channelID"
    }
}```
#

there are actual ID's

severe socket
#

hm

steel swallow
#

i just dont want to share them

severe socket
#

ok

#

just to be sure the reminder is not per user right?

steel swallow
#

nope

#

hard coded reminders

severe socket
#

it's per server

steel swallow
#

only one channel per server

severe socket
#

well

#

you could add an option there

#

like

steel swallow
#

lmao

severe socket
#
{
    "serverID": {
        "ch": "channelID",
        "ping": true,
        "roleToPing": "roleID"
    }
}
#

forexample

steel swallow
#

my friend suggest something similar

#

god dammit. puush isnt sending previews >:Y

severe socket
#

yeah so?

elder rapids
#

No that's just discord

#

Discord sometimes fails to embed

steel swallow
#

anyway.

elder rapids
#

Just resend it

steel swallow
#

i sent the image

#

anyway.

severe socket
#

yeah what is it for?

steel swallow
#

Girls Frontline

#

open beta dropped yesterday so i busted my ass to get this stupid reminder to work

#

anyway. the reminder works great

severe socket
#

no offense but I don't advice spamming all your server like that tho.
I mean whenever you get some server, i'll spam the API

steel swallow
#

sends on time and functions nicely. how ever the 2 servers that do have my bot have asked if i could make it so the bot makes a role and pings the role when the dailies reset

severe socket
#

Although I still don't get what's your issue.

#

yeah then use what I showed you

steel swallow
#

alright.

severe socket
#

just add the role id to your json DB and add the ping in the msg.content part of you msg object

#

not the msg.embed cuz it doesn't ping in embed

steel swallow
#

yeah. worked that one out

severe socket
steel swallow
#

as to your above non offense question/statement im sure there is a work around and i'll jump that when i reach that point

next hamlet
#

how do you people know if a bot belongs to the owner?

shy verge
#

are you talking about the approval process?

#

there's most likely telltale signs that a bot is an instance of red

#

Which isn't necessarily bad, but Red is under GPL i think so you can get rejected if you aren't open source and also under GPL

next hamlet
#

i ment like if i try submitting dyno bot (imagine no one knows about it and the original bot owner is not on here) how would dbl know its not my bot

shy verge
#

depends on how good a job you do of hiding it

steel swallow
#

Wait do we have to be open source?

shy verge
#

Only if your bot is a fork of another (like Red) and the original bot's license dictates you make your project open source as well

steel swallow
#

Oh cool. Glad I built mine from the ground up then

shy verge
#

for example, the GPL liscense

uncut slate
#

GPL does not dictate you make your project open source for a non-conveyed work (i.e. a bot)

low wasp
#

how do i auth my endpoint requests?

#
 
request.post('https://discordbots.org/bots/422088562586943489/check')
 .send({ 'userId': message.author.id })
 .then(r => message.channel.send(`Hi ` + r.body))
.catch(err => message.channel.send(`Oh ` + err))```
this is what ive got rn
#

@uncut slate ?

uncut slate
#

Take a look at the channel description

low wasp
#

sorry. i just saw you respond to someone recently

uncut slate
#

your req has to be a get

#

not a post

#

and userId is a query string param

#

r.body will be an object btw

low wasp
#
 
request.get('https://discordbots.org/bots/422088562586943489/check')
 .query({ 'userId': message.author.id })
 .then(r => message.channel.send(`Hi ` + r.body.voted))
.catch(err => message.channel.send(`Oh ` + err))```
uncut slate
#

userId has to be a querystring

low wasp
#

do i have to send an auth with it?

#

i get a 403 error

uncut slate
#

that's what 403 means, yes

low wasp
#
 
request.get('https://discordbots.org/bots/422088562586943489/check')
 .set({ 'authorization': '(key i set in my bot page?)' })
 .query({ 'userId': message.author.id })
 .then(r => message.channel.send(`Hi ` + r.body.voted))
.catch(err => message.channel.send(`Oh ` + err))```
inner jewel
#

authorization is the dbl token

low wasp
#

idk what im doing wrong but i still get a 403

#

honestly I'm so bad with snekfetch

low wasp
#
 
request.get('https://discordbots.org/api/bots/422088562586943489/check')
 .set({ 'Authorization': '(DBL Bot Token)' })
 .then(r => message.channel.send(`Hi `))
.catch(e => message.channel.send(`Oh ${e}`))```
still returning 403? idk what is wrong. yes the token is correct
uncut slate
#

/api doesn't have any auth

#

so you're probably changing the wrong file

low wasp
#

even this dont work

earnest phoenix
#

is check even an endpoint?

#

oh yeah

low wasp
#

like i have no idea

halcyon torrent
#

it is

low wasp
#

yeah its an endpoint

halcyon torrent
#

did you try to go to this endpoint with your browser?

earnest phoenix
#

^

low wasp
#

it works in my browser

solid cliff
#

postman angeryBOYE

halcyon torrent
#

with UserId and Authorisation keys set?

low wasp
#

no auth key set

#

https://discordbots.org/api/bots/422088562586943489/check?userId=359794248570109972

halcyon torrent
#

maybe try with the Auth too

low wasp
#

it loads in my browser tho

#

without auth key

halcyon torrent
#

maybe because you're logged in :d

#

I dont think so, lol

low wasp
#

okay yeah my servers not blocking it

halcyon torrent
#

how do you get the auth key btw?

low wasp
#

the token that dbl gives each bot

halcyon torrent
#

where it is? :x

low wasp
#

its not for vote locking

low wasp
#

i try in a non logged in browser and get Unauthorized but when using Snekfetch i get Error: 403 This host is not accessible.

toxic oracle
#

@low wasp how did u manage to get the recent logs to show up in ur eval

low wasp
#

magic

toxic oracle
#

would logs be the console logs

low wasp
#

yeah

toxic oracle
#

sharing is caring

low wasp
#

npm >>> consoled

toxic oracle
#

wot

#

lol

low wasp
#
toxic oracle
#

i c

#

ew thats gay

uncut slate
#

every npm module

#

that is a horrible idea

#

oh nvm it doesn't actually import them all in the same instance

low wasp
toxic oracle
#

lmao what about it

low wasp
#

no the issue is im getting 403

earnest phoenix
#

I see all these bots saying you must upvote the bot to use this feature

#

how do i do that?

#

link me api or some docs idk

topaz fjord
raw wharf
#

hi,
Does anyone know any way for the bot to get information about how many users are on a server and the server logo of the invitation?
[ discor.js ]

low wasp
#

read the docs

spring ember
#

server logo of the invitation is the server icon

raw wharf
#

@spring ember yup

spring ember
#

I know I am right lol

mental solstice
#

@raw wharf https://pokecord.net/webhooks if you want a quick way to link upvotes to your discord webhook. Tonkku and blake already said its ok if i share this system. Just trying to help people out, no ads, just free help for the time being.

topaz fjord
#

I see ars

#

Ads

earnest phoenix
spring ember
#

very development related 👌

quiet bobcat
#

yes

#

@uncut slate ^^^^^

earnest phoenix
#

It is

#

I am trying to make a music bot

shy verge
#

i thought ffmpeg was a virus

spring ember
#

@earnest phoenix we said that to a deleted message

#

see case 4858

#

also ffmpeg folder should be lowercase

#

and don't use ffmpeg for a music bot

#

use lavalink

earnest phoenix
#

oh

#

ok

tulip kraken
#

uhh

#

guys

#

how would i provide some sort of authentication key with superagent in node js

spring ember
#

Wdym auth to what?

tulip kraken
#

i want to add twitch announcements in my bot

#

but

#

i dont know how to use the authentication

spring ember
#

read about oauth2

#

And twitch probably has an api, try to find the website which probably has documentation

tulip kraken
#

it does

#

ive been reading it for a while now

earnest phoenix
#

Anyone code discord.js? Can you help me be able to make my bot find a channel and then message in that channel?

shy verge
#
client.channels.get("channelID").send("noot noot");
quasi hearth
#

read the docs

tulip kraken
#

i mean

#

if you cant even find a channel

#

probably learn

#

do some tutorials

#

practice js

#
earnest phoenix
#

Hey sorry this isn’t much discord related but it’s todo with a bot software called DiscodPandl. And I want know the best website software to sell software keys? Been looking at WHMCS but want to know if any of you know any good ones?

knotty steeple
sick kraken
#

idk

earnest phoenix
#

its telling me r1 isn't a function

elder rapids
#

what in the heck are all those arrays for

earnest phoenix
#

hex generator

fluid basin
#

Ofc r1 isn't a function...

elder rapids
#

Why do you have a million of them

earnest phoenix
#

Ik

elder rapids
#

Are they all the same...?

earnest phoenix
#

I only have 36 different ones

#

yes

#

each r is the same

#

just a hex generator

elder rapids
#

If they're all the same arrays why tf is there so many

#

Rather than just using the single one

earnest phoenix
#

Because its easier for me

fluid basin
#

ikr

elder rapids
#

But that's poor code

#

very poor code

earnest phoenix
#

Ok

elder rapids
#

Do not repeat your stuff in programming, it's a bad habit

earnest phoenix
#

ok

#

but how can I make it work

elder rapids
#

Try and make "repeated" code singular as much as possible

earnest phoenix
#

well, what did I screw up more acuratly

elder rapids
#

You also are trying to call the array

#

Rather than index

earnest phoenix
#

?

knotty steeple
#

your are using () then []

#

also

#

¯_(ツ)_/¯

#

for randomizing

earnest phoenix
#

am I meant to use [] instead of ()

elder rapids
#

Do you know the difference between those

earnest phoenix
#

I stewpid

#

Not really to be honest

knotty steeple
#

i dont think he does @elder rapids

earnest phoenix
#

I know one is for arrays

knotty steeple
#

nope

elder rapids
#

One is not for arrays explicitly

#

It's part of it though

earnest phoenix
#

ok

elder rapids
#

[] is an indexer

#

() is a call

earnest phoenix
#

but replace my () with []?

#

ok

#

thx

#

ye? ne?

#

Imma just crazy?

trim plinth
#

yes

earnest phoenix
#

Ok

#

It worked

#

thx guys

earnest phoenix
#

yay

#

my bots hug/punch/slap function works now

grizzled isle
#

👏

earnest phoenix
#

xD

earnest phoenix
#

yay

brisk ginkgo
#

can any please help me i am new to coding

tepid laurel
#

Help with what

brisk ginkgo
#

my bot

#

i keep getting errors in my code and i cant turn\ it on

#

can u help me @tepid laurel

topaz fjord
#

Show errors

#

And the code where it's happening

#

And someone will help you

brisk ginkgo