#development

1 messages · Page 498 of 1

earnest phoenix
#

run it as admin

#

im gunna go to sleep soon @paper zinc here is some usefull stuff once you install it

amber gorge
#

? what time is it in your country ?

earnest phoenix
#
sudo npm install pm2 -g
pm2 start blah.js
pm2 list
pm2 logs blah
pm2 stop blah
pm2 restart blah
#

america

amber gorge
#

ah ok

earnest phoenix
#

its 3:40 am

#

lol

amber gorge
#

yeah go to sleep

earnest phoenix
#

03:00 for our frenchie

#

encule!

#

:^)

amber gorge
#

XD

#

i speak french

earnest phoenix
#

oh

#

lol

paper zinc
#

OKAY THANKS

amber gorge
#

bonne nuit @earnest phoenix

earnest phoenix
#

bien ou bien moi sleep

#

I have a question regarding to wikipedia

#

bonne nuit!

#

should that command be NSFW since you can search for nsfw stuff?

#

if it has the possibility if outputting anything nsfw i would either filter the command or flag it as nsfw

#

check if the library you are using or api has a nsfw flag

#

if not i would mark it for nsfw

#

yea

amber gorge
#

@earnest phoenix you can use google custom search api and remove the safe search when the channel is nsfw

earnest phoenix
#

i just used the wikipedia api

#

some api's return nsfw without a flag or warning

#

/help

#

why wont this work for me

        let tobe_translated = message.content.slice(prefix.length + command.length + 1)

#

What is html and Markdown

#

...

#

im sure you can figure that out..

#

No

#

Are u tryna slice [$use] blah

#

First word?

amber gorge
#

@half star markdown is for example

#

when you use **

#

it makes your text bold

earnest phoenix
#
Test
#

Ya

amber gorge
#

you can do this
Title

earnest phoenix
#

test

amber gorge
#

for titles

#

but use html its better

earnest phoenix
#

**

=== wew lad ===

**

#

Wew

#

But what can I write?

#

this is my code, it wont work


exports.run = async(client, message, args) => {
    if (args[0]) {
        let from_language = "auto"
        let to_language = "en"
        let tobe_translated = message.content.slice(prefix.length + command.length + 1)
        if (args[0].startsWith("from:")) {
            from_language = args[0].slice(5)
            tobe_translated = tobe_translated.slice(args[0].length + 1)
            if (args[1].startsWith("to:")) {
                to_language = args[1].slice(3)
                tobe_translated = tobe_translated.slice(args[1].length + 1)
            }
        } else if (args[0].startsWith("to:")) {
            to_language = args[0].slice(3)
            tobe_translated = tobe_translated.slice(args[0].length + 1)
            if (args[1].startsWith("from:")) {
                from_language = args[1].slice(5)
                tobe_translated = tobe_translated.slice(args[1].length + 1)
            }
        }
        translate(tobe_translated, {
            from: from_language,
            to: to_language
        }).then(res => {
            from_language = res.from.language.iso
            if (res.from.text.value) tobe_translated = res.from.text.value
            final_text = res.text
            let translateembed = new Discord.RichEmbed()
                .setTitle("Translate")
                .setColor("RANDOM")
                .setDescription("Bip Bip Boop\nThe internet magic is here")
                .addField("`from: " + from_language + "`", "``" + tobe_translated + "``")
                .addField("`to: " + to_language + "`", "``" + final_text + "``")
            message.channel.send(translateembed)
        }).catch(err => {
            message.channel.send(":x: Usage: `" + prefix + "translate [from:iso] [to:iso] <some text>` )
        });
    } else {
        message.channel.send(":x: Usage: `" + prefix + "translate [from:iso] [to:iso] <some text>`")
    }
}
#

oops

amber gorge
#

tu peux ecrire <h1>Ceci est un titre</h1> par exemple

#

</br> pour sauter une ligne

#

etc...

earnest phoenix
#

Mais il demande 300

#

Yo

#

Whats problem

#

Its glitch

#

Thats why

amber gorge
#

@earnest phoenix tu dois avoir ta description en tete, ce que fait ton bot etc..
apres cherche un tutoriel sur le net pour ecrire ton texte en html

earnest phoenix
#

Whats problem?

#

then why are you asking

#

On dbl?

#

Ok

#

Ok change the backround-image css variable then

#

..

#

Et c'est obligé de mettre Markdown

amber gorge
#

non html ou markdown

earnest phoenix
#

So like

#

What are you doing making a site if you dont know how css works xF

#

Gp to your main css file

#

Go into the body

#

And chance

#

Ok so go to your primary or last lpaded css file, add background-image into the body tag

vocal meteor
#

let data = ops.active.get(message.guild.id) || {};

#

(node:6344) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined

bronze wagon
#

ooooooof

#

anyone knows why can bot lag when sending links?

#

actually gifs

tame meadow
#

help plz

earnest phoenix
#

@tame meadow with what

sage fractal
#

Bots coded in discord.js and it responds to any 2 character prefix, anyone know a fix?

#

im using a command handler btw

earnest phoenix
#

make it so it doesn't

sage fractal
#

I'm asking how to fix it?

#

so that doesn't really help?

earnest phoenix
#

uhhh

#

whats that code b

jagged plume
#

you probably arent checking if the message starts with the prefix, and instead are just trimming the first two characters off the message and getting the command name (without checking the prefix first)

#

i was stupid once and did that mmLol

west raptor
#

HahaYes same

high tinsel
#

if i get a text like:

#

{"images":[{"startdate":"20181006","fullstartdate":"201810060700","enddate":"20181007","url":"/az/hprichbg/rb/SaltApple_EN-US13056568956_1920x1080.jpg","urlbase":"/az/hprichbg/rb/SaltApple_EN-US13056568956","copyright":"Apple tree on Salt Spring Island in British Columbia, Canada (© Radius Images/Offset)","copyrightlink":"http://www.bing.com/search?q=Salt+Spring+Island&form=hpcapt&filters=HpDate:"20181006_0700"","title":"Take your pick","quiz":"/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20181006_SaltApple%22&FORM=HPQUIZ","wp":true,"hsh":"78f29b2b81afdbaa1a6527b3025bb5b4","drk":1,"top":1,"bot":1,"hs":[]}],"tooltips":{"loading":"Načítání…","previous":"Předchozí obrázek","next":"Další obrázek","walle":"Tento obrázek není dostupný ke stažení jako tapeta.","walls":"Stáhněte si tento obrázek. Můžete ho ale použít jenom jako tapetu."}}

#

How can I only get the url part?

#

language JS

earnest phoenix
#
{
  "images": [
    {
      "startdate": "20181006",
      "fullstartdate": "201810060700",
      "enddate": "20181007",
      "url": "\/az\/hprichbg\/rb\/SaltApple_EN-US13056568956_1920x1080.jpg",
      "urlbase": "\/az\/hprichbg\/rb\/SaltApple_EN-US13056568956",
      "copyright": "Apple tree on Salt Spring Island in British Columbia, Canada (\u00a9 Radius Images\/Offset)",
      "copyrightlink": "http:\/\/www.bing.com\/search?q=Salt+Spring+Island&form=hpcapt&filters=HpDate:%2220181006_0700%22%22,%22title%22:%22Take your pick",
      "quiz": "\/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20181006_SaltApple%22&FORM=HPQUIZ",
      "wp": true,
      "hsh": "78f29b2b81afdbaa1a6527b3025bb5b4",
      "drk": 1,
      "top": 1,
      "bot": 1,
      "hs": [
        
      ]
    }
  ],
  "tooltips": {
    "loading": "Na\u010d\u00edt\u00e1n\u00ed\u2026",
    "previous": "P\u0159edchoz\u00ed obr\u00e1zek",
    "next": "Dal\u0161\u00ed obr\u00e1zek",
    "walle": "Tento obr\u00e1zek nen\u00ed dostupn\u00fd ke sta\u017een\u00ed jako tapeta.",
    "walls": "St\u00e1hn\u011bte si tento obr\u00e1zek. M\u016f\u017eete ho ale pou\u017e\u00edt jenom jako tapetu."
  }
}

so .images[0].url

high tinsel
#

Cannot read property '0' of undefined

west raptor
#

code

high tinsel
earnest phoenix
#

thats invalid

#

because there is no text value

high tinsel
#

res.text returns the text I showed you

earnest phoenix
#

it'll just be res.images[0].url

#

might be res.body

#

that too

high tinsel
#

for res.images[0].url same error Cannot read property '0' of undefined

earnest phoenix
#

k

#

res.body.images[0].url

#

try that

high tinsel
#

That one works 😃 Thank you!

earnest phoenix
#

k

#

also hey tom

#

thank

rustic axle
#

@vocal meteor active is not defined

#

or ops is not defined leading to active not defined

#

make sure ops is defined as a constructor, a variable holding a json format, or is a valid node require

vocal meteor
#

at Object.module.exports.run (/app/commands/skip.js:13:18)

at Object.exports.run (/app/events/message.js:28:31)

    at <anonymous>

    at process._tickCallback (internal/process/next_tick.js:189:7)

(node:13751) 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:13751) [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.

(node:13751) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'queue' of undefined

at finish (/app/commands/play.js:77:13)

at StreamDispatcher.<anonymous> (/app/commands/play.js:68:8)

    at Object.onceWrapper (events.js:313:30)

    at emitNone (events.js:106:13)

    at StreamDispatcher.emit (events.js:208:7)

at Object.module.exports.run (/app/commands/skip.js:23:30)

at Object.exports.run (/app/events/message.js:28:31)

    at <anonymous>

    at process._tickCallback (internal/process/next_tick.js:189:7)

(node:13751) 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)```
#

what does this error means

earnest phoenix
#

code blocks pls

#

also read the error on the first line

vocal meteor
#

can you help me in fixing it

earnest phoenix
#

cannot read property 0 of undefined so probably u are trying to get [0] like an array of somethign that is undefined

i already said the issue here^

vocal meteor
#

@earnest phoenix

earnest phoenix
#

it tells you the line number in the error

vocal meteor
topaz fjord
#

queue[0] doesn't exist

vocal meteor
#

in play.js or skip.js

earnest phoenix
#

in the only one that has it

west raptor
#

check if there is a queue

#

if not return

vocal meteor
#

pls help me?

#

bit of confusion

#

what i change queue[0] to ?

earnest phoenix
#

just gonna assume that this isn't your code

rustic axle
#

^

vocal meteor
#

`(node:266) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'includes' of undefined

at Object.module.exports.run (/app/commands/skip.js:15:28)`

earnest phoenix
#

something is undefined

#

no idea what property is tickYes no idea what undefined is tickYes doesnt know how to read error tickYes cant figure out line number from error tickYes classic DBL

rustic axle
#

no tabs mmLol

obtuse wind
#

I have a question, every once in a while my bot console keeps having this error then it automatically restarts my bot
ECONNRESET, does this error mean that my internet has been reset and restarts my bot or is it something else?

rustic axle
#

replace the ( and the ) with { and }

#

you have message => ( ...)

#

replace it with message => { }

#

@obtuse wind it means there was a connection issue and your connection got interrupted

#

It doesn't mean its restarting

obtuse wind
#

oh oof

rustic axle
#

it just means you have shitty internet

#

¯_(ツ)_/¯

obtuse wind
#

@earnest phoenix paste this line instead?

bot.on('message', message => {
    if (message.content === "ping"){
    message.reply("pong");
    console.log(`ping pong`)
}

});```
#

that's how it should be done

earnest phoenix
#

Yes good

#

what

#

👌

quartz kindle
#

🥄 spoonfeed

rustic axle
#

no

#

thats

#

oh whatever

#

I am done

quartz kindle
#

not you

earnest phoenix
#

can't install snekfetch

#

probs cuz its deprecated

#

what i should do ?

#

install node-fetch

#

thats what it says

#

but

#

:yes

chrome field
#

don't look warn

#

actually downloaded.

earnest phoenix
#

Will you test my Discord botum?

#

oh ok i see the field

#

thx

#

my bot is online but dbl is showing that it's offline. what do i do?

#

wait

#

and make sure its in the server

west raptor
#

^

earnest phoenix
#

how do i add my bot to the server

#

*this server

#

t!davet

#

@earnest phoenix you fill out the form on the website

#

for adding bot?

#

i filled that one out

knotty steeple
#

read the error

earnest phoenix
#

Help me

#

Yes error

#

you can tell what's the problem

knotty steeple
#

it says that is the problem

earnest phoenix
#

how do i add my bot to this server?

#

No

knotty steeple
#

.

west raptor
#

can u not read or smth @earnest phoenix

knotty steeple
#

or something idk

earnest phoenix
#

i read .-.

west raptor
#

ok if you can read

earnest phoenix
#

@knotty steeple that link ain't working

west raptor
#

fix the error ur self, its pretty self explanatory

earnest phoenix
#

"404 not found"

west raptor
#

oops

#

wrong ping

knotty steeple
#

also wrong channel

earnest phoenix
#

i already made the bot smh

knotty steeple
#

what

earnest phoenix
#

YES

#

I said earlier aswell.

knotty steeple
#

wtf are you talking about

earnest phoenix
#

@earnest phoenix wait for it to get approved

#

-bots @earnest phoenix

gilded plankBOT
#
CaptainChubz#1122
Bots

@obsidian canopy

earnest phoenix
#

smh im so dumb

#

thx

whole plume
#

Anyone know why this code doesn't add the role to the user who runs it? (Node.js btw)

module.exports.execute = (msg, bot) => {
    let args = msg.content.split(' ').splice(1)
    let role_name = args.join(' ')
    if(args.length <= 0){msg.reply('invalid usage'); return}
    if(msg.guild.roles.find('name', `${role_name}`)) return msg.channel.send('That gang already exists! Whachu doin homie?');
    
    msg.guild.createRole({
        name: `${role_name}`,
        color: `white`,
        permissions: []
    })
    msg.channel.send(`Yo the ${role_name} gang has established themselves.`)
    msg.member.addRole(msg.member.guild.roles.find('name', `${role_name}`))
}```
bright spear
#

lib?

whole plume
#

discord.js?

bright spear
#

try awaiting the createrole

#

so it'll complete before it tries to add the role

whole plume
#

i only know how to use await in python so could you give an example?

#

or is it the same

#

just adding await before it

steel drum
#

just write "await bleh bleh bleh"

earnest phoenix
#

the same

steel drum
#

oOR

earnest phoenix
#

except

#

you have to add the async

steel drum
#

you can do createRole({}).then(role => stuff);

#

bc createRole

#

returns a promise

bright spear
#

but await is easier

steel drum
#

yea it is

#

just an alternative way

whole plume
#

im not too worried about the easier way tbh

bright spear
#

just add await before it, and add async before the (msg, bot) at the start of the function

whole plume
#

thanks

bright spear
#

yw

whole plume
#

now to figure out json storage and how to store the creator of the role

astral quail
#

@whole plume if I was you, I would use a database instead of saving your data in json.

whole plume
#

dont feel like creating a database right now

#

simply because I dont have a way of doing so efficiently

bright spear
astral quail
#

@whole plume you use JavaScript right?

whole plume
#

cant access it cause "google.com's ip address cannot be found"

#

and that'd be correct jeff

astral quail
#

You can take a look at SQLite

#

It's a simple SQL database

whole plume
#

but my thing is I dont really have a good way to host it

#

both of my bots are running of the machine im on right now

bright spear
#

thats a bad idea

#

a free host would be better than that

#

like glitch or heroku

whole plume
#

I mean

ruby dust
#

or buy a vps

whole plume
#

gigabit connection on an ssd with plenty of cpu and ram to go around

#

I do eventually plan on buying a vps or something but right now i'd rather just keep it as is

urban jay
#

JSON is fine as long as you use the write-file-atomic package

inner jewel
#

regardless of writing the file properly or not, there's a point where json can't handle it anymore

#

and you're just wasting cpu with (de)serialization

astral quail
#

@whole plume you can use OVH, their first plan is just $3/month

west raptor
#

no ovh is shit from what ive heard

urban jay
#

I use VPS cheap

earnest phoenix
#

!user

earnest phoenix
#

!p

#

+k

#

+help

west raptor
topaz fjord
west raptor
#

not common prefixs tho pls

vagrant kernel
#

hey, can somebody say to me, why I can't klick on 'Generate token'. on the API Page?

earnest phoenix
#

klick

crisp pendant
#

lmao

earnest phoenix
#

@vagrant kernel "why I can't klick on 'Generate token'. on the API Page?" - Simon | Player_Schark

vagrant kernel
#

If i hover with the mouse over the text it does not change its shape as it should normally do or?

bright spear
#

@vagrant kernel try going to your bots edit page

vagrant kernel
#

I'm there

#

Ah found

#

ty @bright spear

bright spear
#

Yw

earnest phoenix
#

my description is becoming a mile long and i dont know how i should format it to clean it up

#

any ideas?

quartz kindle
#

you can simply use markdown

#

copy some template from github

earnest phoenix
#

no im not talking about problems with writing css and html

#

im talking about the amount of stuff needing to be written

#

oh wait

#

i didnt read link ignore me

#

mk ill just use better markdowns

whole plume
#

<br>

languid dragon
#

Could someone list like 10 internet browsers here

#

doesn't have to be best - worst or fastest - slowest

#

just 10 different

#

would appreciate, anyone who does it gets a big star from me

#

this does not include browsers based on other browsers

whole plume
#

Chrome
Opera
FireFox
Internet Explorer
Edge
Safari (Mac)
Tor
Maxthon
Netscape
and Slim

languid dragon
#

thanks @whole plume xo

whole plume
#

np

earnest phoenix
#

chromium

languid dragon
#

this does not include browsers based on other browsers

#

i mean it's not really based on Chrome

#

but essentially it's the same thing

#

but thanks

earnest phoenix
#

so like

heady zinc
#

chromium is just the hipsters's chrome

earnest phoenix
#

if i make my bot fetch screenshot of webpages

#

technically

heady zinc
#

tho edge is kinda based on IE too

languid dragon
#

yeah but it's become more of it's own browser

earnest phoenix
#

i use ie6

languid dragon
#

so like i can open IE and Edge on the same page but IE is fucked and edge displays it like chrome but with fancy scrolling

#

ive been web testing and my site looks trash on IE lmfao

earnest phoenix
#

lol

heady zinc
#

well

#

IE has been deprecated for 2-3 years now iirc?

#

so who cares

#

¯_(ツ)_/¯

earnest phoenix
#

my website runs on modern frameworks not very compatible with ie :c

#

but whos uses ie

languid dragon
#

lul i agree

bright spear
#

@languid dragon that list has at least 2 browsers based on other browsers

languid dragon
#

i wouldn't have a clue FeelsDabMan

bright spear
#

opera is based on chrome and tor is based on firefox

languid dragon
#

lul

#

are you on mobile? / what kind of mobile do you have?

bright spear
#

i have an iphone

languid dragon
#

oooo

bright spear
#

k

languid dragon
#

thnx

bright spear
languid dragon
#

iPhone 5?

bright spear
#

yup

languid dragon
#

ok thank

bright spear
#

yw

#

btw @languid dragon u might wanna make a seperate section for top discord servers since now only 2 show in the section lol

languid dragon
#

ill take it as a suggestion, thanks <3

vocal meteor
#

Hey anyone knows channelUpdate event in discord.js how to use

languid dragon
#
<client>.on('channelUpdate', (oldChannel, newChannel) => {

})
vocal meteor
#

ooh thanks @languid dragon

vocal meteor
#
      var channel = member.guild.channels.find(c => c.name === "logs")
         const canvas = new Canvas(700, 250);
    const ctx = canvas.getContext('2d');

    const background = await Canvas.loadImage('https://discordjs.guide/assets/img/8CQvVRV.png');
    ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

    ctx.strokeStyle = '#74037b';
    ctx.strokeRect(0, 0, canvas.width, canvas.height);

    // Slightly smaller text placed above the member's display name
    ctx.font = '28px sans-serif';
    ctx.fillStyle = '#ffffff';
    ctx.fillText('Welcome to the server,', canvas.width / 2.5, canvas.height / 3.5);

    // Add an exclamation point here and below
    ctx.font = applyText(canvas, `${member.displayName}!`);
    ctx.fillStyle = '#ffffff';
    ctx.fillText(`${member.displayName}!`, canvas.width / 2.5, canvas.height / 1.8);

    ctx.beginPath();
    ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
    ctx.closePath();
    ctx.clip();

    const { body: buffer } = await snekfetch.get(member.user.displayAvatarURL);
    const avatar = await Canvas.loadImage(buffer);
    ctx.drawImage(avatar, 25, 25, 200, 200);

    const attachment = new Discord.Attachment(canvas.toBuffer(), 'Welcome.png');

    channel.send(`Welcome to the server, ${member}!`, attachment);
    });
#

(node:6669) UnhandledPromiseRejectionWarning: TypeError: Canvas.loadImage is not a function

#

pls help me

waxen quest
vocal meteor
#

i am using glitch but i never got this error

austere sedge
astral quail
austere sedge
#

ohhh

#

i see

#

tnx

#

@astral quail

#

could you do a example

astral quail
#

I almost never use Python, so please give me a minute or 2.

austere sedge
#

Alright

#

take your time.

vocal meteor
#

is this correct

#

how do i install packages from github in glitch

astral quail
#

@austere sedge

if message.channel.is_nsfw():
  print('true')
else:
  print('false')
austere sedge
#

i see

astral quail
#

@austere sedge that helped you?

austere sedge
#

yes

waxen quest
vocal meteor
#

no i mean somethimg else to add package from github

#

i got it

spring ember
inner jewel
#

why do you make an array?

#

you don't need one for mkString

spring ember
#

yeah I found the issue

earnest phoenix
#

9!help

#

1!help

spring ember
#

I needed to put brackets on the relations map...

earnest phoenix
#

I!help

spring ember
earnest phoenix
#

l!help

spring ember
#

doc

#

@inner jewel I had a map

earnest phoenix
#

Deso

spring ember
#

@inner jewel just realized what I did was stupid and I can just do this

.append(relations map {case (col, value) => s"$col = $value"} mkString ",")```
vocal meteor
#

anyone here use canvas-constructor

stable tide
vocal meteor
#

Hello Iona Boy

stable tide
#

You are a 8th std student ryt? Whom i saw being a help vampire in D.js n some server

#

Yes

#

Who Dosent accept to learn js

vocal meteor
#

-bots @stable tide

gilded plankBOT
#
iona Dev#8394
Bots

@olive barn

earnest phoenix
#

-bots @earnest phoenix

gilded plankBOT
#
🔥ImDiogo912🔥#0001
Bots

@native fulcrum

final remnant
#

My bot just reached 2,500 servers and I need to start sharding, however I keep getting the error
UnhandledPromiseRejectionWarning: Error: Shard 1's process exited before its Client became ready.

tepid laurel
#

So anyone knows if its possible with nodejs+discord.js to export your full client with exports.client = client and require that on a different file thus having the full client there useable

#

Or does that break anything etc im not sure

#

Thought I'd just ask🤷🏼‍♂️

earnest phoenix
#

It does, but I wouldnt recommend that

#

I'd actually export a function in the desired file which takes a client as a parameter

tepid laurel
#

I see alright thanks

tepid laurel
#

@earnest phoenix you still here? If so I think I got it however..

#

When requiring the file containing the export for the client, it actually starts running the script aswell

#

Meaning for a moment you'd have two instances of the same client

#

Is there a fix for that?

earnest phoenix
#

Two instances of the same client?

tepid laurel
#

Yeah

earnest phoenix
#

How are you applying this?

tepid laurel
#

Well on the index file of the bot I just added a function that returns the client from there

earnest phoenix
#

Well I'll need more thatn this

tepid laurel
#
exports.sendClient = function() {
  return client;
};
#

My export function

#

Aaand

#
addUserBot(filename) {
    console.log(filename);
    const file = require(path.resolve('../'+filename));
    console.log(file);
  }
#

My function on a class that attempts to just require the file but automatically starts running it

earnest phoenix
#

That's exactly what I didn't want you to do :(

tepid laurel
#

What do you mean?

#

Thought you intended to use an function on export

#

Lmfao my bad😂

earnest phoenix
#

Not in the main file. In the file that needs the client.

tepid laurel
#

Oh and then require that function on the main file

#

And pass the client in it

#

OH lmaaoooo

#

Life struck me hard

#

But does that automatically give the input to the file it needs to be?

#

As far as I know it shouldnt..

#

Lets say I use that same function give it a param, and then require it on my bot file

#

Execute it pass the client to that function and make it return it

#

I still dont have it on my file I need it I believe then

#

And even then, the file im using it on is not constantly alive, so how would I do this?

unborn estuary
#

i need help with my Bot (discord.ph)

The bot should only choose a person of a certain role.
Scaffolding is already standing but unfortunately I can not get the rest

Can someone help me?

earnest phoenix
#

What is discord ph?

ruby dust
#

php maybe?

lucid iris
#

JS question: any way to optimise this?

'help': (message: Message, input: string, parameters: string[]) => {
  this.displayHelp(message, input, parameters)
},

If i pass the function as is:

'help': this.displayHelp

...the scope of this is not the proper one.
I tried setting const self: any = this and passing self.displayHelp instead but it still had the same scope.

earnest phoenix
#

t!ascii sa

topaz fjord
earnest phoenix
#

ok

#

sorry

topaz fjord
#

its fine

inner jewel
#

@lucid iris this.displayHelp.bind(this)

unborn estuary
#

i mean python

earnest phoenix
#
(node:7844) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established
    at TLSSocket.onConnectEnd (_tls_wrap.js:1086:19)
    at Object.onceWrapper (events.js:273:13)
    at TLSSocket.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1092:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)```
#

Wots this

worthy roost
#

Not sure. you mightve have wrote something wrong in the startup of your bot

knotty steeple
#

not related to code

#

what im getting from the error is that the client got disconnected before it could connect but idk

earnest phoenix
#

and Im getting this error too (node:1128) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 104.16.58.5:443

lucid iris
#

.bind(this) works wonders; thanks, @inner jewel

buoyant sky
#

-bots

gilded plankBOT
#

This user has no bots

buoyant sky
#

XD

unique sleet
#

help?

#

i'm trying to make a bot

harsh musk
#

Ask your question

unborn estuary
#

i need help with my Bot (python)

The bot should only choose a person of a certain role.
Scaffolding is already standing but unfortunately I can not get the rest

Can someone help me?

unique sleet
#

how do you make a bot account?

ruby dust
unique sleet
#

yeah the client id apparently is wrong

west raptor
#

what

#

ok so

#

are you logging into the Bot

#

With the client id?

#

cause

#

if u are

#

bad

unique sleet
#

Unable to fetch application. Make sure you've provided the correct Client ID and that the application has a bot account.

#

this is what i got

desert bough
ruby dust
#

I think you forgot to create a bot user

unique sleet
#

how do you do that?

ruby dust
#

there's a Bot tab on the left

unique sleet
#

where at?

desert bough
#

the developers website

ruby dust
#

in your application page

unique sleet
#

the developer portal?

ruby dust
#

yes

desert bough
#

yes

unique sleet
#

how do i create a bot user?

ruby dust
unique sleet
#

aha!

earnest phoenix
#

can anyone make a html code that makes my discord bot page backround a dark red?

#
body {
    background-color: crimson;
}```
mint cradle
#

Dear ppl, I have python and I copy pasted the example.

#

I have my bot running for 2 days with it now.

#

But it doesn't update.

#

Is there something else I have to do? Except copy paste the example to update the server count (it now is NA)

#

Almost

#

For that html code

#

Use

#

<html>
<head>
<style>
background-color: crimson;
</style>
</head>
<body>
</body>
<html>

quartz kindle
#

no

mint cradle
#

Yes

quartz kindle
#

dont use html and head

mint cradle
#

This is html

#

Why not, works

#

So shut up xD

quartz kindle
#

because the html is being injected into an existing page

#

it already has its own html and head

#

adding more html and head tags is wrong

topaz fjord
#

telling Tim to shut up Thonk

#

also tim wheres ur cert zoomeyes

earnest phoenix
#

SO LIKE

#

WHAT EVEN

quartz kindle
#

my cert?

topaz fjord
#

ye

quartz kindle
#

what do you mean

topaz fjord
#

oh

#

nvm

quartz kindle
#

lmao

topaz fjord
#

the discord overlay is broken for colors

mint cradle
#

So very nice

earnest phoenix
#

?

mint cradle
#

But not the answer

earnest phoenix
#

what are you sayin?

topaz fjord
#

you only need <body> and <style> afaik for dbl long desc

earnest phoenix
#

^

quartz kindle
#

you dont need body

#

only style

mint cradle
#

You used css

earnest phoenix
#

yes

mint cradle
#

Instead of <style>

earnest phoenix
#

style is inline css

mint cradle
#

Yes I know

earnest phoenix
#

so just put my css

#

in a style tag

#

nerd

mint cradle
#

I KNOW BUT THATS NOT THE FUCKING ANSWER

earnest phoenix
#

dont use html tag

quartz kindle
#

it is if you know how to use inline css

west raptor
#

Chill

earnest phoenix
#

lol

west raptor
#

Jesus fuck

earnest phoenix
#

i love when people ask for me to write code

#

then get mad

#

when they cant use it

#

propperly

#

wew

quartz kindle
#

thats their problem, and they will figure it out eventually, or ask again for help

mint cradle
#

So I solved problem

#

By spoonfeeding

#

Yeay

quartz kindle
#

technically, you presented a solution, yes, but a bad one

topaz fjord
#

lmfao

earnest phoenix
#

lol

mint cradle
#

But okay I had question to

#

Spammed away

#

Dear ppl, I have python and I copy pasted the example.
I have my bot running for 2 days with it now.
But it doesn't update.
Is there something else I have to do? Except copy paste the example to update the server count (it now is NA)

earnest phoenix
#

are you talking about the dbl api?

mint cradle
#

Yes

#

I do.

quartz kindle
#

yes, you need to post the server count

mint cradle
#

Yes, but idk how.

#

I copied that example

#

But that didn't did anything

#

I have it running for 2 days with that now

#

And still didn't updated.

quartz kindle
#

then you did something wrong. if it works, it takes 5 seconds to update

mint cradle
#

I just copied that code right...

#

And added my personal bot token

quartz kindle
#

well, if you want help, you can post your code

#

although im not a python developer

earnest phoenix
#

420

mint cradle
#

Yeah it's the example hold on

#

Token is hidden

#

I don't need it, I need it to post

#

I do know I am in 700+ servers

earnest phoenix
#

are you now?

mint cradle
#

Hold on searching the code

#

Yes I do

earnest phoenix
#

lol

#

👍

#

good job

mint cradle
#

Yhay

west raptor
#

wait you are in 700 severs?

mint cradle
#

Over

earnest phoenix
#

shhh

mint cradle
#

Yes

west raptor
#

I thought the limit was 100

mint cradle
#

Well my bot

#

But fine

quartz kindle
#

wat

west raptor
#

ok

quartz kindle
#

what limit?

earnest phoenix
#

?limit

#

what

west raptor
#

user

#

Account

#

Limit

quartz kindle
#

oh lmao

earnest phoenix
#

xD

quartz kindle
#

hes talking about his bot

earnest phoenix
#

gotem

west raptor
#

I know

quartz kindle
#

did we just get bamboozled

earnest phoenix
#

ye

#

wait

#

no

#

you dont just not know how to write css and python and be in 700 servers with your bot

#

unless its not his

mint cradle
#
#Importing libraries 
import discord
from discord.ext import commands

import dbl
import time
import random
import pickle
import re

import aiohttp
import asyncio
import logging

class DiscordBotsOrgAPI:
    """Handles interactions with the discordbots.org API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'HIDDEN NOW'  #  set this to your DBL token
        self.dblpy = dbl.Client(self.bot, self.token)
        self.bot.loop.create_task(self.update_stats())

    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count"""

        while True:
            logger.info('attempting to post server count')
            try:
                await self.dblpy.post_server_count()
                logger.info('posted server count ({})'.format(len(self.bot.guilds)))
            except Exception as e:
                logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
            print("updated")
            await asyncio.sleep(300)


def setup(bot):
    global logger
    logger = logging.getLogger('bot')
    bot.add_cog(DiscordBotsOrgAPI(bot))
#

I do know how to write CSS, but he asked for html not css

#

I am not perfect

#

I am human

#

So yes I can have questions

earnest phoenix
#

not saying that you cant

#

by any means

mint cradle
#

"ye
wait
no
you dont just not know how to write css and python and be in 700 servers with your bot
unless its not his"

earnest phoenix
#

im just relatively shocked its in 700

#

feel free to ignore my ramblings

mint cradle
#

Nah

#

I had +100 servers each day

earnest phoenix
#

so the bot has only been up for 7 days?

#

and its in 700?

mint cradle
#

Yes

#

That's correct lol

earnest phoenix
#

ok

#

nice

quartz kindle
#

well, im not a python dev. but does it have any error? does it show "attempting to post server count" in the logs?

mint cradle
#

No.

#

Not at the shell

#

Do I have to call the function?

#

Or does it execute itself

earnest phoenix
#

so if you define a function

#

and dont call it

#

it wont run

mint cradle
#

Ah

earnest phoenix
#

im no pro at python so i couldnt tell you whats wrong with what you have but that idea is pretty universal

quartz kindle
#

i think the function is already being called at the end of the code

#

but its using bot as input

earnest phoenix
#

do you set your client to bot

#

?

quartz kindle
#

if your instance is called something else, like client instead

#

it wont work

mint cradle
#

Yes but now I had it reffered

#

I know

#

But I didn't reffered

#

But how to refer a class

quartz kindle
#

well im not a python dev so idk]

#

but if all else fails

mint cradle
#

And what should be "self"

quartz kindle
#

you can always POST it yourself

#

without the library

#

do you know how to create an http POST request?

#

its just like using a REST API

#

thats what i do

mint cradle
#

"Failed to post server count
Forbidden: Forbidden (status code: 403): {"error":"Forbidden"}
Traceback (most recent call last):
File "/Users/Zl109819/Documents/PythonBot/Bot.py", line 167, in update_stats
await self.dblpy.post_server_count()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dbl/client.py", line 100, in post_server_count
await self.http.post_server_count(self.bot_id, self.guild_count(), shard_count, shard_no)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dbl/http.py", line 189, in post_server_count
await self.request('POST', '{}/bots/{}/stats'.format(self.BASE, bot_id), json=payload)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dbl/http.py", line 160, in request
raise Forbidden(resp, data)
dbl.errors.Forbidden: Forbidden (status code: 403): {"error":"Forbidden"}"

#

Well it least it says something now

#

Before I didn't said something

quartz kindle
#

good, now you're getting somewhere

mint cradle
#

Errorsolving is hard

quartz kindle
#

status code 403 is access forbidden

mint cradle
#

IDK what that does mean

quartz kindle
#

the js library had the same problem some time ago, thats why i used a manual post request instead

#

post it in the #topgg-api channel, maybe someone knows how to fix

mint cradle
#

I did, thnx

daring vine
#

hi

#

where do i go for bot help

west raptor
#

hi

#

uh

#

here

daring vine
#

or errors

#

bugs

#

i mean

earnest phoenix
daring vine
#

this is the discord for poke plug right?

mint cradle
#

It does say exactly

#

Just remove it

#

It is already declared

earnest phoenix
#

im going to go ahead and say

#

you already declare bot

mint cradle
#

Or remove var

daring vine
#

nvm wrong

earnest phoenix
#

who uses var nowadays

#

in js

#

let and const

quartz kindle
#

i do

#

lul

earnest phoenix
#

I have a problem in my code

    var msgauthor = message.author.id;
    
    if(message.author.bot)return;
    
    if(!db.get("xp").find({user: msgauthor}).value()){
        db.get("xp").push({user: msgauthor, xp: 1})write();
    }else{
        var userxpdb = db.get("xp").filter(user: msgauthor}).find('xp').value();
        console.log(userxpdb);
        var user = Object.values(userxpdb)
        console.log(userxpdb);
        console.log(`Nombre d'xb: ${userxpdb[1]}`)
        
        db.get("xp").find({user: msgauthor}).assign({user: msgauthor, xp: userxp[1] += 1}).write();

if (message.content === prefix + "xp"){
    var xp = db.get("xp").filter({user: msgauthor}).find('xp').value()
    var xpfinal = Object.values(xp);
    var xp_embed = new Discord.RichEmbed()
        .setTitle(`Stat des XP de ${message.author.username}`)
        .setColor('#013ADF')
        .setDescription("Affichage des XP")
        .addField("XP:", `${xpfinal[1]} xp`)
        .setFooter("Enjoy :p")
message.channel.send({embed: xp-embed});
quartz kindle
#

code block please

#

also your error is probably not there

#

it says bot has already been declared

earnest phoenix
quartz kindle
#

that means somewhere in your code you have const bot = something twice

#

its in line 11

earnest phoenix
#

Good

quartz kindle
#

it says what the error is

#

doc.js line 29, missing a )

#

but in your case, it doesnt find the ) because there is a } in front of it without a { existing

mild quarry
#

Using Python

async def googlesearch(args):
    try: 
        from googlesearch import search 
    except ImportError:  
        print("No module named 'google' found") 


    stringnumber = (args.split(", ")[1])
    

    stringquery = (args.split(", ")[0])
     

      
    # to search 
    query = str(stringquery)
      
    for j in search(query, tld="co.in", num=float(stringnumber), stop=1, pause=2): 
      await client.say(j) ``` gives me this error: ```Ignoring exception in command googlesearch
Traceback (most recent call last):
  File "/home/runner/.site-packages/discord/ext/commands/core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "main.py", line 82, in googlesearch
    stringnumber = (args.split(", ")[1])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/.site-packages/discord/ext/commands/bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "/home/runner/.site-packages/discord/ext/commands/core.py", line 374, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "/home/runner/.site-packages/discord/ext/commands/core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: list index out of range```
#

what it basically does

#

I type in the command along with what i want to search

#

and then a comma followed by a number

earnest phoenix
#

How would I get the key with the highest value in an object..? I'm guessing using filter but I'm not sure

quartz kindle
#

is the value a number?

#

you can use Object.entries(yourobject) and then filter

earnest phoenix
#

Yeah the value is a number and what does entries give you

quartz kindle
#

entries gives you an array of key,value arrays

#

[[key,value],[key,value]]

#

etc

earnest phoenix
#

Could I do something like this..?

#
Object.keys(obj).reduce((a, b) => obj[a] > obj[b] ? a : b);```
quartz kindle
#

i dont have much experience with reduce, but i believe so yes. idk if its better than filter tho

inner jewel
#

reduce((a, b) => a[1] > b[1] ? a : b)[0] on the entries

quartz kindle
#

and if you use entries instead of keys, you dont need to access the main object on every loop

earnest phoenix
#

True

inner jewel
#

doing this with filter would be... painful

quartz kindle
#

is filter more expensive?

inner jewel
#

you'd need to iterate at least twice

quartz kindle
#

what about sort?

inner jewel
#

sort could work

#

but reduce might be better in this case

earnest phoenix
#

I barely know thse functions

#

lol

#

(node:7744) UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object

#

Does this happen if the object is empty?

quartz kindle
#

hmm i dont think so

worthy roost
#

What is the install command for ms? npm i ms?

#

i forgot

quartz kindle
#

then yes

worthy roost
#

yup

earnest phoenix
#

so like

#

instead of using that

#

i recommend moment.js

wheat marten
#

I have a bot using Discord.js-commando where can I change the prefix

earnest phoenix
#

never have used command but that was in the docs

wheat marten
#

What is a good prefix to use?

#

! is the most common one

earnest phoenix
#

so dont use common ones

#

use somewhat specific ones

wheat marten
#

and I don't want to use ! because it can interfere with other bots if you use it with multiple bot

#

s

earnest phoenix
#

what is your bots name?

wheat marten
#

Discord Upgraded

earnest phoenix
#

DU! may be a good one

#

DU!help

#

etc etc

wheat marten
#

I was just thinking about that!

earnest phoenix
#

du.help also would work

wheat marten
#

or maybe just DU

earnest phoenix
#

yea if you want

#

just dont make it an obvious one like ! or $

wheat marten
#

yeah

#

or ?

earnest phoenix
#

yea

#

any single character prefix

#

is generally nogo

wheat marten
#

should I delete discord.js?

earnest phoenix
#

so your putting a space between your prefix and command

#

dont pu ta space

#

unless you have a space specified

#

in your prefix

wheat marten
#

I have a space is my prefix

#
        if(typeof options.selfbot === 'undefined') options.selfbot = false;
        if(typeof options.commandPrefix === 'undefined') options.commandPrefix = 'DU ';
        if(options.commandPrefix === null) options.commandPrefix = '';
        if(typeof options.commandEditableDuration === 'undefined') options.commandEditableDuration = 30;
        if(typeof options.nonCommandEditable === 'undefined') options.nonCommandEditable = true;
        if(typeof options.unknownCommandResponse === 'undefined') options.unknownCommandResponse = true; ```
#

see

#

there's a space in DU

earnest phoenix
#

it may be a problem with how it parses it

#

like if it splits it into an array and selects the first element to determine command

#

like i do

#

then space would not work

#

try removing the space

#

use the bot, and if it works

wheat marten
earnest phoenix
#

hrm ok

wheat marten
#

that was when I had ! as my prefix

earnest phoenix
#

i dont know dj commando well enough on how it functions to help you futhur with that

#

i would check hot it parses the message to determine the command being used

#

or if its loading the commands propperly

#

also make sure you define the commands correctly etc

wheat marten
#

ok

#

also this is somehow not working

#

class CoinFlipCommand extends commando.Command
{
    constructor(client)
    {
        super(client,{
            name: 'flip',
            group: 'simple',
            memberName: 'flip',
            description: 'Flips a coin, landing on either Heads or Tails'
        });
    }

    async run(message, args)
    {
        var chance = Math.floor(Math.random() * 2);
        if(chance == 0)
        {
            message.reply("Your coin landed on Heads!");
        }
        else
        {
            message.reply("Your coin landed on Tails!");
        }
    }
}

module.exports = CoinFlipCommand; ```
#

I don't know what I did wrong

wheat marten
summer escarp
#

Anyone have a bot with economy and mod

bright spear
#

@limber sphinx

summer escarp
#

What is its prefix xd

bright spear
#

! by default

summer escarp
#

Ok

bright spear
#

but you can change it

#

LMAO DID YOU RUN !HELP

summer escarp
#

Ye

#

What is the name

#

(Dm me the lin plz)

bright spear
#

also

#

this channel is for coding help

summer escarp
#

Nvm

#

@bright spear what is the prefix

bright spear
#

i already told you

#

the default is !

summer escarp
#

Lol

#

Oof

wheat marten
#

going to make a command for my bot

#

🍻 CHEERS It's Oktoberfest! 🍻

bright spear
#

wot

#

hacktoberfest?

thin fern
#

Hi I'm looking for a game of thrones conquest bot

lusty dew
#

Nice.

#

Make it yourself then.

kind nexus
#

Yo homies

#

I'm coding In C#,
How would I find the current voice channel of the user who did the command?

wheat marten
#

I made a coin flip command, fortune, random number, and dice roll

bright spear
#

lmao commando

#

commando is a meme

sick cloud
#

why post here though

#

also kinda, commando has it's uses

#

somewhere

native geode
#

xD

wheat marten
#

What is wrong with commando? @bright spear

bright spear
#

well

#

people pretty much only talk about commando to say its bad

#

ive never really tried it

#

i use Spark

wheat marten
#

oh

#

commando is basically a library that acts as a template

#

I use both discord.js and I also have discord.js-commando in node_modules

bright spear
#

yes ik

#

commando is a framework for discord.js

wheat marten
bright spear
#

spark is also a framework for discord.js

wheat marten
#

never tried spark

#

I love commando

#

it is very useful

#

Well, I am going to go, I have school in the morning.

#

:kotlin:

potent frost
#

hi

#

im back

#

discord deleted me for making the google bot

#

i was really annoyed

wheat marten
#

How was the google bot violating tos? @potent frost

potent frost
#

@wheat marten privacy invasion

wheat marten
#

Oh

earnest phoenix
bright spear
#

What's iyour code

earnest phoenix
#

});

here is the mistake. I use google translation I am french
@bright spear

bright spear
#

That just means there's a mistake somewhere before that

steel drum
#

running code on your phone

lofty abyss
#

const dbl = new DBL(config.dblToken, { webhookPort: 5000, webhookAuth: 'password' });

#

do i put my auth code in the password bit?

bright spear
#

Yes

#

It's whatever you set as the auth in your edit page

lofty abyss
#

oh ok i just got an error since it cant send a message to that user

#

which is a bit gey

restive silo
#

you used a variable whats not defined

#

thats the error

lofty abyss
#

oh

#

oh shit yeh

stone scroll
#

guys how do I send contents of an ascii file for ga!help command

#

or just a txt file

lament meteor
#

iirc he is asking about asciidoc

#

¯_(ツ)_/¯

bitter sundial
#

ascii file is just an ascii encoded txt file

lament meteor
#

ik but i showed him asciidoc but he taught it was a file

bitter sundial
#

isnt an asciidoc file still a plain text file

potent frost
#

yes

#

isnt every file a text file though

#

they all contain text

#

:>

warm bronze
#

If anyone knows how to make (Or knows of an existing bot) some version of a Support bot that can PM users with a role (Like admin/moderator) when someone enters a Voice channel like a Helpdesk, please feel free to PM me sometime. Thanks.

sick cloud
#

this isnt #request-a-bot @warm bronze

stone scroll
#

help

#

the bulkDelete command is a thing

#

but it's saying it's not now

#

it was working before

astral quail
#

You have to use it on a channel object instead of a message object.

stone scroll
#

oh ok thanks

stone scroll
#

HELP ME

#

I'VE RESET TOKEN LIKE 5 TIMES ALREADY

#

AND PUT NEW TOKEN IN

#

IT AIN'T WORKING ;-;

#

nvm realized I was tryna put in my bot secret instead of my token lmao

ruby dust
#

why does it print bot online if it didn't connect to discord cause of incorrect token

stone scroll
#

I just did console.log bot online cuz I'm dum

#

kbye

ruby dust
#

do it in connect event Thonk

stone scroll
#

ye I will

west raptor
#

Make sure it isn't the client secret

wheat marten
#

How would I make a bot like MEE6?

#

like users being able to customize commands

lament meteor
#

make a db and make custom settings

wheat marten
#

@lament meteor If I were to make a database should I use Firebase?

lament meteor
#

idk

quartz kindle
#

there are many databases you can chose from

#

simple ones like sqlite and leveldb, or more complex ones like mysql, postgre, rethink, mongo

#

it depends on your needs, and how big your bot will get

#

if your bot gets over 2500 servers and you start sharding, you will need a database that accepts multiple connections

gleaming glen
#

is there anyone that knows the code of setting slowmode with discord.js

smoky spire
gleaming glen
#

thank you

gleaming glen
#

but it doesnt seem to work even if i uptade to master

smoky spire
#

Doing it wrong then

gleaming glen
#

isnt it like js msg.channel.setRateLimitPerUser(1)

#

um @smoky spire

smoky spire
#

Does it give an error?

earnest phoenix
#

You should add a .catch, it's a promise

gleaming glen
#

like this? js msg.channel.setRateLimitPerUser('1').catch(console.error);

earnest phoenix
#

Try it?

gleaming glen
#

its still not working

#
TypeError: channel.setRateLimitPerUser is not a function``` @earnest phoenix
earnest phoenix
harsh musk
#

check if a author of message is a bot

#

using code

#

yes

smoky spire
#

No

#

What lib?

#

Discord.js?

#

if(message.author.bot) return;

fickle ibex
#

@glacial sentinel You can use one of the handy libraries on NPM for that ^^

glacial sentinel
#

why would I need it tho?

#

I just check if they voted when they do the command

fickle ibex
#

Add rewards for the votes for example

glacial sentinel
#

not a big deal

#

I do it

fickle ibex
#

Automating it would be a better deal pUwu

glacial sentinel
#

Well not a big deal you just gotta run the command again

fickle ibex
earnest phoenix
#

.

west raptor
#

@gleaming glen I'll try when I get home since i use master

#

See if I get the same thing

gleaming glen
#

okay, thx mmLol

west raptor
#

@earnest phoenix minutes is undefined

earnest phoenix
west raptor
#

#topgg-api would be a more appropriate channel for that

mint cradle
#

He posted that in api already

west raptor
earnest phoenix
west raptor
#

u on master?

earnest phoenix
#

yep

#

i got it to work

west raptor
#

how

earnest phoenix
#

run npm i hydrabolt/discord.js again

#

then restart bot completely

west raptor
#

oh that worked

#

thanks

earnest phoenix
#

yeet

#

no problem

lean jasper
#

hi

earnest phoenix
#

🖕

west raptor
#

oh

earnest phoenix
#

@west raptor

west raptor
#

huh

earnest phoenix
#

Tu parle francais

west raptor
#

no

hollow dawn
#

Abadakor

#

Moi je parle français

zealous veldt
sick cloud
#

how do i get the name of meaning[0]

wheat marten
#

Is NSFW commands against discord ToS?

sick cloud
#

@wheat marten as long as it is in an nsfw channel, no

wheat marten
#

ok

#

Thanks

#

I am just making sure that I don't break Discord's ToS because I am planning on adding NSFW commands to my bot

pearl mirage
#

glitch flipped the switch on my bot, blew it all away

#

I have it up on github so it's not a total loss, kinda sucks though

west raptor
#

dont use glitch then

pearl mirage
#

granted that's what I'd do if I were them

bright spear
#

i heard it should be fixed now

wheat marten
#

What would I have to do to make economy commands for my bot

#

should I use discord-eco?

bright spear
#

@wheat marten why dont you just code it yourself instead of using a package that does it for you