#development

1 messages · Page 419 of 1

low wasp
frail kestrel
slim heart
#

Yes ik how to iframe, but it's specifically with dbl

frail kestrel
#

ok

#

iframe height width site to embed

#

in ur long desc

earnest phoenix
#

@earnest phoenix are you handling the error? if no then you should so at least it won’t crash. either-way have you installed uws module? if not you can install it like npm install uws and see if you’ll get the error again

frail kestrel
#

.catch();

#

doesn't need an extra module?!

earnest phoenix
#

you’re out of context

frail kestrel
#

ok

slim heart
#

it just doesnt even frame anything

#

it wont load the frame no matter width and height

frail kestrel
#

o

#

correct syntax?

earnest phoenix
#

@earnest phoenix is getting a websocket error, in d.js you can handle those using client.on(“error”, console.error) - now uws is an improved websocket module that’s more performant and sometimes also solves such issues, all you have to do is to install it and d.js will use it

slim heart
#

I tested the exact same code in a normal scenario and it's fine

frail kestrel
#

i wonder if its a site bug

earnest phoenix
#

does your iframe appear in the view link source

slim heart
#

ohohoho does it have to be ssl Thonk

frail kestrel
#

does the site ur embedding exist

slim heart
#

yeees

frail kestrel
slim heart
#

But when i embed my main website it works

frail kestrel
#

o

earnest phoenix
#

check chrome console

#

its possible your server is sending deny frame header

slim heart
#

no

earnest phoenix
#

so what does console say

slim heart
#

name not resolved thonkku

earnest phoenix
#

send bot page link mmLol

slim heart
earnest phoenix
#

typo in src?

topaz fjord
#

@slim heart the site needs to be ssl to work with dbl

slim heart
#

ight

#

Imma just iframe it on some random file on my ssl site and just iframe an iframe LMAO

earnest phoenix
#

not sure if that's gonna work

#

just use cloudflare

#

free

slim heart
#

oki lmao

sick cloud
#

hey guys, random question here. how do you setup vsc github integration? i've seen my friends do it. they make a quick change to their bots code, click the tab on the side, commit and it pushes it to the repo, then they run a cmd in there bot and it updates the code. i want to know how to do the push new code only, thanks! :D

#

(like, i know its possible but i have no idea how :P)

shy verge
#

command line > gui

#

there's probably an extension for VSCode so just look around

sick cloud
#

its built into vsc though

#

i just don't know how to setup my repo to it

shy verge
#

oh that thing?

earnest phoenix
#

you can clone a repo

sick cloud
earnest phoenix
#

and then start pushing to it

shy verge
#

VSC just needs to detect a git folder in the working directory

#

and it handles the rest for you afaik

sick cloud
#

oh

earnest phoenix
#

open command palette

sick cloud
#

so do git clone?

earnest phoenix
#

and search clone

sick cloud
#

okay

#

then it'll work right?

earnest phoenix
#

yea you should be able to commit from within vsc after you clone

sick cloud
#

alright, thanks!

earnest phoenix
#

method on hiding bot token, rip

gilded blaze
#

What are good maintained libraries for C#

frail harness
shy verge
#

but expect slow changes to the latter

#

it takes fucking ages for pull requests to be processed

#

also if discord makes a sweeping api change you're fucked with d.net

#

the dev team move extremely slow

#

still no channel categories iirc

verbal night
#

@earnest phoenix When it comes to hiding a token, i literally just use a .properties file and do testing outside of the project directory >.>

gilded blaze
#

Lol

verbal night
#

@shy verge I assume they are lazy devs?

shy verge
#

I guess?

verbal night
#

seems like it >.>

#

though, i'm lazy and procrastinating as well so 🤷 now back to still not redoing my entire API ._.

tardy hatch
#

Hello there

#

Is possible to make autorole on python? Or no

ruby dust
#

everything is possible

#

if you look at the docs, there is an event called on_member_join, now I hope you know what to do with it

toxic oracle
#

No sir

earnest phoenix
#

@tardy hatch Sky is the limit :P
Yes it is, like Deivedux said, you need to use the event on_member_join and assign a role there to the member (argument that comes with the event)

tardy hatch
#

Okay, i ll try to make it))

#

But, i want to make as a command..

earnest phoenix
#

@tardy hatch What do you mean? a config command?

slender thistle
#

@tardy hatch What languages do you speak?

#

And what "auto-role" are you talking about? Assign a certain role to every member of the server?

ruby dust
#

well technically he first needs to have more of python knowledge, additionally a database language to store roles in guilds that will be used to auto assign

slender thistle
#

Define the role in code.

ruby dust
#

no, just no

slender thistle
earnest phoenix
#

your bot is going out of memory

tardy hatch
#

Ffs

#

I try to make autorole command for python

#

@earnest phoenix for example: &&autorole @Role

earnest phoenix
#

Well you can make a command for that. and store it in a database.
Then recall it when on_member_join is triggered to assign that role

#

Can anyone help me setup heroku via pms pls?

frail kestrel
#

@earnest phoenix

#

here pls

earnest phoenix
#

yes, sorry

#

^^'

#

C:\Users\silly>git push heroku master
error: src refspec master does not match any.
error: failed to push some refs to 'heroku'
``` what's wrong with my code?
frail kestrel
#

whats ur code

#

would be a more appropriate q

earnest phoenix
#

Its not even launching anything

#

Hes git pushing

tardy hatch
#

Lmao

earnest phoenix
#

How do I stock my canvas? @halcyon torrent pleaaaase

halcyon torrent
#
var canvas = new Canvas(...)```
frail kestrel
#

yes

#

but not var

#

no var

halcyon torrent
earnest phoenix
#

O

#

I'm idiot

#

@earnest phoenix

fs.writeFileSync("test.png", Canvas);
#

If im not mistaken

frail kestrel
#

y don't u just do

#
const { writeFileSync } = require('fs');
writeFileSync("test.png", Canvas);
halcyon torrent
#

why do you need a file? è_e

earnest phoenix
#

You can't send a Canvas as file in discord

#

:O

#

Canvas is a object.

#

:OOOO

#

:OOOOOOO

halcyon torrent
#

spam tbh :x

frail kestrel
#

ok stop spam lol

halcyon torrent
#

I know, but there is canvas.buffer() xD

earnest phoenix
#

it created the image! thanks thanks thanks

halcyon torrent
#

ofc it did

earnest phoenix
#

Now insert that Image in your file send command

#

file : 'test.png'

tardy hatch
#

Guys

halcyon torrent
#

huh

tardy hatch
#

I have one question at this code:

earnest phoenix
#

To send it without saving it, how do I do it?

tardy hatch
#
```async def hug(ctx, *, member: discord.Member=None):
    await bot.say("X hugged u")```
halcyon torrent
#

idk how discord.js works, wait x)

tardy hatch
#

How can i add random commands?

#

No commands

#

Ffs

#

Umm, random responses

earnest phoenix
#

Make an array and random pick one

ruby dust
#

make a list of responses then choose a random one

#

damnit

tardy hatch
#

Okay, i ll try))

earnest phoenix
#
import random
myList = [2, 109, False, 10, "Lorem", 482, "Ipsum"]
random.choice(myList)
ruby dust
#

I'm afraid that is a bit misleading, they barelly know python :/

earnest phoenix
#

¯_(ツ)_/¯

#

Its the most basic script i could give them

halcyon torrent
#

it would be better to learn the language first jigenlol

earnest phoenix
#

You can't learn Python...

#

...Python learns you.

slender thistle
#

You don't learn Python. You hate it. Thinkmas

tardy hatch
#

@earnest phoenix man

#

In that list

halcyon torrent
#

sure, you cant learn that, it hurts.

#

@slender thistle I agree lmao XD

tardy hatch
#

I want to make to tag the membrr

#

Member

#

Is okay to add:

ruby dust
#

well when discord was introduced, people were very interested in making bots regardless of programming knowledge, so they go straigh to coding discord bots rather than fully learning the language

tardy hatch
#

{0.author} or?

earnest phoenix
#

Ye you can just

#

Its part of the string

slender thistle
#

That mentions the user who used the command.

earnest phoenix
#

Hes making a hug command

#

so i suggest he wants both

#

{0.author} hugged {}

tardy hatch
#

Okay

slender thistle
#

await bot.say("{0.author} hugged you, {1.mention}!".format(ctx.message.author, member))

ruby dust
#

author.mention mentions the user, no?

slender thistle
#

Author and member != the same thing.

tardy hatch
#

I want to add author tag and who was tagged in losy

ruby dust
#

it's still a user object, and needs the mention parameter

tardy hatch
#

List

earnest phoenix
#

Author is the person writing the command
Member is the person you tag.

ruby dust
slender thistle
#

'Who was tagged in list'?

tardy hatch
#

*sorry for my bad english

#

In that list i want to set

slender thistle
#

Why do you need a list?

#

Random responses?

earnest phoenix
#

Ye

#

He wants a random hug message

slender thistle
#

Aight, make one. I am lazy to do it on phone.

tardy hatch
#

{0.mention} hugged {1.mention}

#

In list

#

I want to set this

#

Is okay?

#

Or is wrong

earnest phoenix
#

await bot.say("{0.author} hugged you, {1.mention}!".format(ctx.message.author, member))

#

what shivaco said

#

then the say message is that random command

tardy hatch
#

Man, i want to add this in a responses list

slender thistle
#

I got what you want. W/e.

#

One sec.

earnest phoenix
#
import random
myList = ["{0.author} hugged you, {1.mention}!", "{0.author} hug that {1.mention}!"]
await bot.say(random.choice(myList).format(ctx.message.author, member))
tardy hatch
#

Thanks!

#

This i want

ruby dust
#

I don't think spoon-feeding is a good idea

slender thistle
#

Or:

import random
resp = ['text1', 'text2']
response = random.choice(resp)
# etc
#

Me neither.

ruby dust
earnest phoenix
#

I didnt want to spoonfeed

#

But he was not getting it.

#

🤣

tardy hatch
#

=)))

slender thistle
#

Google might help you next time, mate.

tardy hatch
#

Okay

slender thistle
#

It's not a good idea to ask people to do all the stuff for you. Google still exists. Thinkmas

halcyon torrent
#

you should learn the basics before trying to make things you dont know how to do xD there are many tutorials for that on the internet yeah

earnest phoenix
#

Your best friend 😃

halcyon torrent
#

^

#

but python is you worst enemy aswell

earnest phoenix
#

Only @halcyon torrent can be worse.

slender thistle
#

It really is. ULTRALUL

earnest phoenix
#

I find Python more kinder to me then NodeJS

#

Aslong as you obey it's rules.

slender thistle
#

Python can kinda go literally retarded sometimes. Depends on your luck. ThinkLMAO

earnest phoenix
#

Time to buy me a lottery ticket then 😃

halcyon torrent
#

true

#

time to buy you some pills for when your luck is gone

earnest phoenix
#

HELP ME FOR THE COMMAND KICK PLSSSSSSSSSSSS

#
const content = msg.content.split("");
if (content[0] === "!" && content[1] === "k" && content[2] === "i" && content[3] === "c" && content[4] === "k") return msg.member.kick();
#

jk

if (msg.content === "!kick") return msg.member.kick();```
#

@earnest phoenix vsc?

#

@earnest phoenix LUL

#

XD

halcyon torrent
#

m4st3r c0de

frail kestrel
#

how2 remove?!

trim plinth
#
#bot-details-page .bot-img {
    box-shadow: none !important;
}
frail kestrel
#

ty

old glade
#

Heyo

#

I have this in my code (python)

#
client.change_presence(game=discord.Game(name="Type !infos to list the commands"))
#

but it does not have any effect

#

Under the bot there is not display of the string

static bramble
#

did you await it

#

@old glade

old glade
#

nope

#

let me try

#

now it works

#

thanks Andrew

static bramble
#

np

earnest phoenix
#

Is that Vultpix?

#

Hmm.. Maybe not

shy verge
#

@south finch this meanie is bullying my christian development channel

earnest phoenix
#

I have some problems with making cross files functions ;/

#

anyone here good at it?

#

Should I shard even if I didn't hit >2.5k guilds?

#

what is a shard?

#

^

#

@earnest phoenix @earnest phoenix Sharding is the method by which a bot's code is "split" into multiple instances of itself. When a bot is sharded, each shard handles only a certain percentage of all the guilds the bot is on.

#

ok

slender thistle
#

@earnest phoenix 1000 is recommended, but it's up to you whether to shard or not. ThinkShrug

earnest phoenix
#

🤔

lament meteor
#

tbh i will shard at 2k guilds

earnest phoenix
#

Why are shards usefull^

#

?

lament meteor
#

so it doesnt overload

earnest phoenix
#

btw can you help me iwth the problem I have in js?

#

sure I guess

lament meteor
#

@earnest phoenix sure wats the problem?

earnest phoenix
#

@earnest phoenix you can use hastebin for your code and error

#

?

#

what's yo js problem

#

?

slender thistle
#

Scroll up.

earnest phoenix
#

^^

#

ok

slim heart
#

Hey so I wanna do my bot site like how @delicate zephyr does Phoenix, where the whole page is it, I can already do this if I wanted to but I wanted to know if there is any need to like talk to a mod first and maybe what else that needs to be included if I'm getting rid of all the other data on the page

earnest phoenix
#

hey can anyone help me with my bot

#

im having some permission issues

abstract crystal
#

@slim heart as long as you include all buttons including Report button i think you are fine

slim heart
#

Alright thanks

abstract crystal
#

@earnest phoenix could you elaborate?

earnest phoenix
#

hang on sending

abstract crystal
#

np uwuwu

earnest phoenix
gritty bolt
#

Is Amazon AWS EC2 a good place to host a bot?

earnest phoenix
slim heart
#

I just realized I already have all dat except report

#

I didn't even know what i needed be4

abstract crystal
#

@gritty bolt yes

earnest phoenix
#

what should i do

abstract crystal
#

@slim heart oh don't remove ads!

slim heart
#

err

#

I dont see ads lamooo

#

on the default page

earnest phoenix
#

gets ignored

#

;-;

abstract crystal
#

maybe is should be author.id

slim heart
#

I dont think dbl has ads Thonk

abstract crystal
#

@slim heart yes they have xd

earnest phoenix
#

it has that too

#

but ok

slim heart
#

I cant see any

earnest phoenix
#

thanks

slim heart
#

in an incognito tab

earnest phoenix
#

i will do what you say

slim heart
#

so no adblock

abstract crystal
#

@slim heart yes

slim heart
#

i dont see em

#

whatever kek

#

Ill just copy phoenix code 😃

#

lmao

abstract crystal
#

some times they show some times they don't

earnest phoenix
slim heart
#

Anyways tho, also how would i submit stats so my website can use them 😮

abstract crystal
#

@earnest phoenix well the error says that you don't hmm

earnest phoenix
#

it worked what you said

#

thanks!

#

im retarded

slim heart
#

Like bot stats

earnest phoenix
#

;-;

#

what have done wrong?

#

life

slim heart
#

bad klaus

earnest phoenix
abstract crystal
#

@slim heart make an api xd

earnest phoenix
#

Whne I call this function it gives me the error message "Cannot read property 'test' of undefined"

slim heart
#

American Institute of Physics?

#

😂

#

oh i see u dun messed

earnest phoenix
#

?

knotty steeple
#

@earnest phoenix use .run instead

abstract crystal
earnest phoenix
#

.run where?

#

I mean Its my function test?

slim heart
#

Ye ik, but also i have no clue how to do that hehe

#

Any starting points?

knotty steeple
#
const file = require("./modules/spacex.js")
file.run(spacex)
earnest phoenix
#

uhu?

knotty steeple
#

wat

abstract crystal
#

@slim heart which lang do you use?

slim heart
#

js

earnest phoenix
#

ok thx

#

I understnad now

abstract crystal
#

@slim heart

  1. Make a web server (idk, express or something like that)
  2. Make a DB to store stats (sqlite3, mysql, postgres ....)
  3. Make a route where you will do a POST request with your bot with data (like you'd send to dbl) and save it to DB
earnest phoenix
#

uhm, wtf it doesn work?

abstract crystal
topaz fjord
#

wdym it doesnt work

slim heart
#

Oki and how would i go about making the website put the data from the db lmao

abstract crystal
#

make a html page, serve it from the same server as you post stats, do html and insert data from db

#

(I'm not really your guy, I only know the surface of node.js)

earnest phoenix
#

oh, wrong screen shot

#

well the "const spacex" is actually spacex_function in code atm

abstract crystal
slim heart
#

dank u

earnest phoenix
#

youve required functions twice GWsplOof

#

ok

#

well it still does not work ;/

#

is there any errors

topaz fjord
#

why are u requiring twice

earnest phoenix
#

I removed

#

that what i said

#

the second require

topaz fjord
#

require once then use the functions by passing the variables

earnest phoenix
#

yes, well It does not work...

topaz fjord
#

depends on how your doing it

#

¯_(ツ)_/¯

earnest phoenix
topaz fjord
#

thats not even a full error

earnest phoenix
#

Oh, wait

topaz fjord
#

and also can you paste code instead of screenshots

earnest phoenix
#

The Spacex function file```module.exports = (spacex) => {
spacex.test = function(){
console.log("TEST OK");
return;
}
}

#

Index require: const spacex = require("./modules/spacex.js");

#

function call fileconst Discord = require("discord.js"); var time = require('time'); exports.run = (client, message, args, level, spacex) => { const settings = message.settings; //message.channel.send(new Date().toLocaleString('en-US',{ timeZone: settings.serverStandardTime })) var Time_Now = new time.Date(); Time_Now.setTimezone(settings.serverStandardTime); message.channel.send(`${Time_Now}`); spacex.test(); }

#

my .run cmd.run(client, message, args, level, spacex);

#

@topaz fjord

#

am I retarded?

knotty steeple
#

did you make it run the function call file like the cmd zoomeyes

earnest phoenix
#

the idea is that it will start some interval functions in the index, from spacex.js

desert bough
#

can someone help me im using cryptocompare NPM and when i try to output prices in an embed it just says object Object

bitter sundial
#

your output is an object. access the properties like for example object.price

#
cc.price('BTC', 'USD')
.then(prices => {
  sendMessage('', {description: prices})
})
.catch(console.error)

Does your code look something like this? @desert bough

desert bough
#

no

spring ember
#

Send code

desert bough
#

```if(command === ${prefix}value){
let coin = args[0];
if(!coin) return message.reply("Please specify a coin!");
cc.price(coin, ['USD', 'EUR', 'GBP'])
.then(prices => {
console.log(prices);
let CoinValueEmbed = new Discord.RichEmbed()
.setDescription(${coin} Value)
.setColor("32CD32")
.addField("Value: ", prices)
.setAuthor(bot.user.username);

    return message.channel.send(CoinValueEmbed);
});

}```

bitter sundial
#

almost

#

so prices is an object

spring ember
#

Printing an object will show object

bitter sundial
#

your object would contain USD, EUR and GBP properties

desert bough
#

ah ok

#

so what can i do to fix it?

bitter sundial
#

access those properties

desert bough
#

so like prices[GBP] ?

bitter sundial
#

that would work, just add quotes around GBP

spring ember
#

What do you want to do?

desert bough
#

i want it to display the coin prices in GBP USD and EUR

#

got it

#

thanks @bitter sundial

spring ember
#

So access those properties directly

bitter sundial
#

👍🏻

desert bough
#

@spring ember thanks for the help

bitter sundial
#

what format did you want to display them in btw

desert bough
#

ill take a screenshot one sec

bitter sundial
#

Value: 1 EUR, 1 USD, 1 GBP?

spring ember
#

Np

desert bough
bitter sundial
#

oof bitcoin is not looking good rn

desert bough
#

yeh i know

bitter sundial
spring ember
#

Not that good

#

Chrome Console heh

bitter sundial
#

ye

#

chrome console best console

spring ember
#

Agreed

#

For JS at least

desert bough
#

@bitter sundial i think u should approve my bot 😜

earnest phoenix
#

I use VSC

#

its pretty nice

spring ember
#

Lol tonkku doesn't approve bots afaik

desert bough
#

dammit XD

bitter sundial
#

I have

#

but I haven't done that recently

#

also asking doesn't help you

desert bough
#

@bitter sundial worth a shot tho 😁

coral dock
#

Hi! One sneaky question, how can I access in Discord.js the UserProfile Thing?

#

I don't get it

grizzled isle
#

UserProfile What do you mean?

coral dock
#

UserProfile
Represents a user's profile on Discord.

delicate zephyr
#

are you talking about a userbot mmLol

coral dock
#

Where I can read Premium etc

grizzled isle
#

Seems like it

#

userbots (SelfBots) Are against the ToS

coral dock
#

SelfBots?

grizzled isle
#

A bot using your login credentials

coral dock
#

No, I'm creating an Moderation Bot

delicate zephyr
#

well I dont think you can read is someone is nitro from d.js

trim plinth
#

you can't read user profiles in bots

#

with d.js

coral dock
#

Can i Post a Link on this Server?

#

Just to show you what I found

grizzled isle
#

Yes,

coral dock
#

That's what I mean

delicate zephyr
#

you cant

grizzled isle
coral dock
#

Huh

#

Ok, so I understand, but what I don't understand why it stands there 😄

#

Weird.

#

Thank's anyways!

delicate zephyr
#

because while Self-bot are against ToS its still documented @coral dock

buoyant estuary
#

Can someone help me?

#

I was doing the bot normally, but out of nowhere is giving this error now: /

#

?

earnest phoenix
#

unexpected } btw

buoyant estuary
#

?

earnest phoenix
#

You are missing some } @buoyant estuary

#

Or adding { where you're not supposed to

buoyant estuary
#

dont is this

earnest phoenix
#

What

buoyant estuary
earnest phoenix
#

Are you still getting the error

buoyant estuary
#

and it worked

#

thx

earnest phoenix
#

Because your syntax was incorrect

buoyant estuary
trim plinth
#

Like the error says, use send instead of sendEmbed GWyogurtKek

buoyant estuary
#

My bot usually gets when you use the command !userinfo gives this agreement there

#

thx ❤

coral dock
#

Hi, may I ask an question I think of a while but I don't have any Idea to make it

#

How do I get my Bot to only respond to my Prefix, I'm pretty new to Javascript

#

`let commandfile = bot.commands.get(cmd.slice(prefix.length));
if(commandfile) commandfile.run(bot, message, args);``

#

Well, messed up ^^

#

So thats how I get the Command

#

Do you need more?

earnest phoenix
#
    let commandfile = bot.commands.get(cmd.slice(prefix.length));

    if(commandfile) commandfile.run(bot,message,args);
#

That's what I got

#

so idk

coral dock
#

Yea, but I tested it and you can use every Prefix that is One Char long

inner jewel
#

check startsWith

#

if(!message.content.startsWith(prefix)) return;

coral dock
#

Ok, i try 😃

#

Thanks a lot, I couldn't figure it out 😄

lethal grove
#

Is it possible to embed a gif?

earnest phoenix
#

How would you do this with snekfetch? curl -H 'Accept: application/vnd.twitchtv.v5+json' \ -H 'Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2' \ -X GET 'https://api.twitch.tv/kraken/search/channels?query=starcraft'

#

im doing var { body } = await snekfetch .get(`https://api.twitch.tv/kraken/search/channels?query=${query}`) .query({ 'limit':5 })

#

but its wrong

#

400 bad request

#

i think i need authentication (with the client id) i have a client id but idk how to put it in snekfetch

#

wait

#

how to put these options in snekfetch instead of http?

#
const options = {
    host: 'api.twitch.tv',
    path: `/kraken/channels/${channel}`,
    headers: {
      'Content-Type': 'application/json',
      Accept: 'application/vnd.twitchtv.v5+json',
      'Client-ID': `${constants.TWITCH_ID}`,
    },
  };```
sturdy mortar
#

So one need o guide me with node.js

#

Hello?

#

R u guys deaf?

#

Nvm.

night imp
#

What do you need?

sturdy mortar
#

I need help coding

night imp
#

post issue

sturdy mortar
#

I just started

night imp
#

what language

sturdy mortar
#

I don't know how too code.

#

English

#

I speak english

night imp
#

what programming language

#

Do you want to use

sturdy mortar
#

Which one is better? C# or Node.JS

night imp
#

node is easier

sturdy mortar
#

What I need too do????

#

I'm usin mac

night imp
#

if you want to use node go through these
https://goo.gl/iQ5xIB
Learn JavaScript | Codecademy

https://goo.gl/MvTxQv
Learn Node — The best way to learn Node.js, Express, MongoDB ...

Learn Node

A premium training course to learn to build apps with Node.js, Express, MongoDB, and friends.

#

in that order

#

or something similar

sturdy mortar
#

...

#

What I do

night imp
#

click the one that says JS

sturdy mortar
#

K I did

night imp
#

that is JavaScript, what node is based on

#

take the course and learn using it

sturdy mortar
#

Free code review?

#

Now what

#

Um

night imp
sturdy mortar
#

No

night imp
#

ok go there then

#

sign up and follow the course

#

it will teach you javascript

#

then you can learn node.js

sturdy mortar
#

i don't have an account ._.

earnest phoenix
#

would this work? ```js
var snekopts = {
headers:{
'Content-type': 'application/json',
Accept: 'application/vnd.twitchtv.v5+json',
'Client-ID': Client.config.TwitchID
}
}

    var { body } = await snekfetch
    .get(`https://api.twitch.tv/kraken/search/channels?query=${query}`, snekopts)
    .query({
        'limit':5
    })```
sturdy mortar
#

hey lose

earnest phoenix
#

Im not sure how snekfetch works :/

#

hm?

sturdy mortar
#

Is coding hard?

night imp
#

@sturdy mortar then make an account

earnest phoenix
#

uhh

#

not really

#

once you get used to it

night imp
#

I would recommend learning a bit more about computers first though

#

No offense

earnest phoenix
#

ive been coding for 3 years so

sturdy mortar
#

.

topaz fjord
#

@earnest phoenix are you trying to do query params in snekfetch?

sturdy mortar
#

😦

earnest phoenix
#

uhh im trying the twitch api for the first time

#

to search a channel

sturdy mortar
#

I made two bots but I needa code them both

topaz fjord
#

So what are you trying to do with snekfetch

sturdy mortar
#

Can someone code one?

topaz fjord
#

no

#

Unless u pay me

sturdy mortar
#

how much?

earnest phoenix
#

Im pretty much trying to do this curl -H 'Accept: application/vnd.twitchtv.v5+json' \ -H 'Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2' \ -X GET 'https://api.twitch.tv/kraken/search/channels?query=starcraft' but in snekfetch

topaz fjord
#

So

#

For headers you do

sturdy mortar
#

How much?

#

@topaz fjord How much?

shy verge
#

what are you trying to do? @sturdy mortar

topaz fjord
#

.set('Header name', 'value') @earnest phoenix

earnest phoenix
#

OHH

#

Okay

#

lemme try

#

so js var { body } = await snekfetch .get(`https://api.twitch.tv/kraken/search/channels?query=${query}`) .set('Accept', "application/vnd.twitchtv.v5+json") .set('Client-ID', Client.config.TwitchID) .query({ 'limit':5 })

#

my quotes tho

#

smh

topaz fjord
#

And for query you can do .query({ query_name: value })

#

No need to do the ?query in the link

earnest phoenix
#

okay

#

still

#

(node:16204) UnhandledPromiseRejectionWarning: Error: 400 Bad Request

#

i have this js var { body } = await snekfetch .get(`https://api.twitch.tv/kraken/search/channels`) .set('Accept', 'application/vnd.twitchtv.v5+json') .set('Client-ID', Client.config.TwitchID) .query({ 'query':query, 'limit':5 })

topaz fjord
#

Try removing the quotes around the names in .query

earnest phoenix
#

wat

topaz fjord
#

@earnest phoenix

earnest phoenix
#

okay

#

nope 👀

#

you know it makes no difference right @topaz fjord

#

that's why I wated

#

its a js object doesn't matter if you quote the properties

topaz fjord
#

It worked for me when I did that for my problem

earnest phoenix
#

I would really love to see that lol

#

uuh joe

#

does snekfetch allow you to read the body regardless of an http error?

#

if you read the body you'll see why twitch api is rejecting your request

topaz fjord
#

The body will return empty/null iirc

earnest phoenix
#

idk

topaz fjord
#

But then again I don't really use snekfetch that often

earnest phoenix
#

hm

#

I can try it locally real qucik

#

where do u get your client id from

#

my config.json

#

yes I mean

#

from twitch

#

send me link so I get mine and I can test it

#

xD

#

uhh lemme see where my friend got it 👀

#

oh

#

ok

#

add .catch(r => console.log(r.body))

#

and you'll see why it fails

#

oh okay

sturdy mortar
#

HHHHEEEELLLLLPPPP

earnest phoenix
#
{ error: 'Bad Request',
  status: 400,
  message: 'Invalid client id specified' }```
#

Stop with the caps pls

sturdy mortar
#

Lose, help me man

earnest phoenix
#

there you go

#

with what

sturdy mortar
#

My Bot!

earnest phoenix
#

Thank you @earnest phoenix

#

😃

sturdy mortar
#

He ded.

earnest phoenix
#

learn to code? zoomeyes

sturdy mortar
#

Congrats on your son 😃

#

Which is a bot.

#

Your his God.

#

Someone help me choose a system

#

C# or node.js

earnest phoenix
#

nodejs

#

Ntanis sry to bother again but js { error: 'Bad Request', status: 400, message: 'Missing required parameter "query"' }

#

but i have it

sturdy mortar
#

How do i get too the coding?

earnest phoenix
#

hm

#

go to tcd

sturdy mortar
#

It's just a whole bunch of websites

earnest phoenix
#

learn node there

sturdy mortar
#

.

#

Bruh

earnest phoenix
#

what's in your query var

sturdy mortar
#

You can't even type anything --plus There's no one online

earnest phoenix
#
query = message.content.split(/\+/g).slice(1).join(" ");```
#

can u print it

#

yeah sure

#

its undefined 👀 wot

#

xddd

#

xddd

#

it works with my steam command

#

wtf

#

scope maybe?

sturdy mortar
#

No one is online i n that server

earnest phoenix
#

oml

#

there is alot of people online in tcd

shy verge
#

nobody's gonna immediately respond to you

#

there's a rule where if your question goes unanswered for 10 mins then you can ping the role that corresponds to that channel

earnest phoenix
#

kk now it works 😃

sturdy mortar
#

Ahahaha

#

I can't make a bot

#

Because no one will help me

slender thistle
#

"Make a bot"?

#

Use Google. Thinkmas

#

But learn programming language.

earnest phoenix
shy verge
#

don't expect to be spoonfed code

#

go get basic knowledge of a programming language and come back

#

we'll wait

frail kestrel
#

ur code snippet up there looks like js and python

#

value looks like js and the fact that you’re missing the var, let or const before query suggests python

earnest phoenix
#

js

#

join is a string method in python

frail kestrel
#

i know what it is

#

just stating that it looks like both

mental trellis
#

is there a way to get the user id of the person that sent the bot command using discord.py in python?

solid cliff
#

ctx.message.author.id

mental trellis
#

that worked, thank you

earnest phoenix
#

I won't link

desert bough
#

anyone know a link to a vid where i can make a discord.js music bot?

spring ember
#

read about lavalink

#

idk about any videos but it is not that hard

#

since there are many libraries that support it

earnest phoenix
frail kestrel
#

css

#

o

#

its an error

#

it looks like its rejecting

#

send code™™

desert bough
#

ive done everything with ffmpeg to get it to work but my bot still says it cant find it

topaz fjord
#

Are you on Ubuntu or windows

desert bough
#

windows

#

will move to ubuntu when i get it to work tho

topaz fjord
#

Did you set ffmpeg in your path

desert bough
#

yes

spring ember
#

don't use ffmpeg

desert bough
#

what else can i use?

spring ember
#

Lavalink

#

as I said earlier

desert bough
#

ok

#

how do i use it tho

topaz fjord
#

Set up the Lavalink.Jar, then find a wrapper for your lib

desert bough
#

is there a tut for it?

topaz fjord
#

Are you on d.js

desert bough
#

yes

spring ember
#

read the docs

topaz fjord
spring ember
#

don't forget to launch the lavalink jar

desert bough
#

ok

#

so do i just do npm isntall lavalink?

spring ember
#

umm

#

npm install discord.js-lavalink

desert bough
#

ok

#

i dont understand this

earnest phoenix
#

If you're trying to setup ffmpeg with djs

#

You have to install ffmpeg-binaries from npm

#

That's what I did and it worked on first try

#

On a windows setup

#

But same goes for any dist

desert bough
#

i did that and it didnt work

earnest phoenix
#

Are you sure you installed the correct package

#

And which version of djs are you using

desert bough
#

the latest

earnest phoenix
#

What are you trying to to with your bot

#

And are you getting any error messages?

desert bough
#

the only error msg is that is isnt found

#

and im tryng to make a music bot

#

just reinstalled it

earnest phoenix
#

Post a screenshot of your error mesage or copy it

desert bough
#

this is the only error

earnest phoenix
#

Have you googled it

desert bough
#

fckin reinstalled it and it works fine now fml 😩

earnest phoenix
#

Because I can't help you much since I never got any errors related to ffmpeg

#

Ah

#

Nice then

desert bough
#

3 hours XD

#

3 hours ive been trying to figure it out

earnest phoenix
#

Rip

#

Good luck with your bot

desert bough
#

thank you

night imp
#

(you were trying to unzip/zip a file with a corrupted header /function call)

earnest phoenix
#

The error message did mention zlib

#

So I thought it had to do with something about unzipping

#

But welp issue is solved now

gilded blaze
#
if message.content.startswith('$test'):
        await message.channel.send('u just used me. xd')``` why does this say channel has no attribute send
#

idk any other method

earnest phoenix
#

Where did you define your channel

#

Try using message.channel

gilded blaze
#

i am using message.channel

#

wat

slender thistle
#

Rewrite or async?

gilded blaze
#

rewrite

earnest phoenix
#

Oh wait you are

slender thistle
#

I doubt that.

earnest phoenix
#

My eyes ehh

gilded blaze
slender thistle
#

You might have async version used in the code.

ruby dust
#

have you saved the file before running it? eyesFlipped

gilded blaze
#

yes

slender thistle
#

Try putting await bot.send_message(message.channel, "u just used me. xd").

#

Instead of the await message.channel.send thing.

gilded blaze
#

ok

ruby dust
#

they might do use rewrite, due to them having bot dev role already

#

@earnest phoenix delete that

slender thistle
#

"Channel has no attribute send"

gilded blaze
#

that worked

slender thistle
#

You are using async.

earnest phoenix
#

?

ruby dust
#

@earnest phoenix your code has your bot's token

earnest phoenix
#

shit

gilded blaze
#

how do i use rewrite

slender thistle
#

Uh. I guess you need to uninstall Python async first.

#

I am on phone. DEIVE HALP.

earnest phoenix
slender thistle
#

Or just try to install rewrite again. ThinkShrug

earnest phoenix
#

discord.js btw

ruby dust
#

idk if you do need to uninstall current discord.py, but just doing pip install discord installs the rewrite version

gilded blaze
#

ok

slender thistle
#

Oh, does it? @ruby dust

ruby dust
#

yes

night imp
#

@proud breach you need to handle errors

slender thistle
#

Why did PyPi show pip install discord-rewrite eyesLeft

#

Fuck's sake.

earnest phoenix
#

It doesn't connect @night imp

#

just add

.catch(error => console.error)
``` right after the ```js
if(cmd === `henryplay`) {}
night imp
#

Like it doesn't connect to the discord api at all?

earnest phoenix
#

?

#

Not the discord api

#

the voice channel

#

Check bot perms

#

Make sure your bot has the connect perms specifically

#

It does

#

What about speak

topaz fjord
#

Didn't we tell you to keep the error event for that error

earnest phoenix
#

I just add my bots with admin perms because im lazy

#

mine has admin perms

#

To the dev servwr

#

Ah I see

#

@topaz fjord different bot

topaz fjord
#

To figure out what the error object is you need bot.on('error')

#

Then get the result and log it or do smth with it

earnest phoenix
#

Is there a difference between err and error

#

oh ye

topaz fjord
#

No

earnest phoenix
#

thx

topaz fjord
#

@earnest phoenix just shortcuts

earnest phoenix
#

I use (err)

topaz fjord
#

For typing

#

But error is a discord.js event

earnest phoenix
#

Yeah

#

It'll do something whenever it encounters an error

topaz fjord
#

Ye

earnest phoenix
#

That has to do with discord

#

It's pretty handy

topaz fjord
#

Yeah

earnest phoenix
#
bot.on("error", error => {
    console.log(error)
})
```  I added that
#

but, nothing

#

Lol

#

I would do Client.on("error", (err) => { return console.log(err); });

#

Should work

#

ok

#

for me its bot btw

#

Yeah just change it

#

I use Client

#

nope

#

nothing

#

Nothing being print?

#

nope

#

Does the bot connect?

#

woops

#

The bot gets online

#

but doesn't join the vc

#

Are you using opus

#

opus?

#

Discordjs website has an easy guide to setup bots for vc

#

You need to install node-opus and ffpmeg-binaries

#

Oh

#

I have YTDL core

#

That's not enough

#

But check the website documentation

#

They have a guide there

#

It's pretty easy

#

ok

#
#

ok

#

thx

#

Np

#

is it usual for ffmpeg-binaries to take forever?

spring ember
#

probably ffmpeg should not be used

earnest phoenix
#

I already set it up

spring ember
#

well you are going to have a bad time

#

it's resource hungry as hell

earnest phoenix
#

ok

#

It worked for me

spring ember
#

no big bot is using ffmpeg

earnest phoenix
#

Idk about it being hungry

#

For res

#

Besides if your bot is small it should do fine

#

As in it's included in few servers

spring ember
#

but lavalink will still do better

earnest phoenix
#

I suggested ffmpeg because it's what it's recommended in d.js

#

again, nothing

#

no errors, no joining

#

Show us your code for connecting

#

To a vc

#
          if(!message.member.voiceChannel) {
              message.channel.send("You must be in a voice channel.");
              return;
          }

          if(!servers[message.guild.id]) servers[message.guild.id] = {
              queue: []
          }
          if(!message.guild.voiceConnection) message.member.voiceChannel.join().then(function(connection) {

              play(connection, message);
          });
#

Is your command trigger working?

#

Idk

#

Its the same I used on my other bot

#

and it worked then

#

Do a console log

#

its just

#

Also

#
if(cmd === `henryplay`){
}```
#

Where you have play()

#

Replace with a console.log

#

ok

#

It's easier to know if it's a problem with ytdl or discord

gilded blaze
#

u probs got code from some outdated tutorial

earnest phoenix
#

console.error?

#

No

#

console.log("OK")

#

ok

#

It should print "OK"

#

When you type in henryplay

#

its only when its connected that it plays it

#

but no print

#

I think your play function is wrong

#

Ah I see

#
function play(connection, message) {
    let server = servers[message.guild.id];
    server.dispatcher = connection.playStream(YTDL(server.queue[0], {filter: "audioonly"}));
    server.queue.shift();
    server.dispatcher.on("end", function(){
        if (server.queue[0]) play(connection, message);
        else connection.disconnect();
    });
}

#

my play function

gilded blaze
#

don't use YTDL

earnest phoenix
#

^

#

Ok

#

what to use?

#

I used it a few weeks ago and it wasn't working actually

gilded blaze
#

Best one for JS is Lavalink or whatever it's called

earnest phoenix
#

But what matters here is that your bot doesn't join the vc

#

Not ytdl

#

ye

#

this bot is only for my server

gilded blaze
earnest phoenix
#

I can try giving you working code for joining a vc

gilded blaze
earnest phoenix
#

Something simple

#

remove all your code regarding the join command

#

ok

#

You'll have the if statement that triggers the command only right?

#

Ye

#

if (cmd.....

#

Ok

#

that?

#

Remove the last if

#

Ok

#

now what?

#

Now join a vc

#

ok

#

already in one

#

Now put below those ifs message.member.voiceChannel.join()

#

That should add the bot to thw vc

#

nope

#

No?

#

Nada

#

nozing

#

Do the other commands work

#

ye

#

actually

#

That's weird

#

Imma test that

spring ember
#

I think it is starting to be a spoon feed

earnest phoenix
#

Ok

#

it works

#

not the vc thingy

#

But how I get the commands working

#

What do you mean

spring ember
#

code them

#

listen try and read docs

earnest phoenix
#

the ```js
if(cmd === help){
message.reply("lul")
}

#

Read docs is very important

spring ember
#

Nao is currently doing all the coding for you

earnest phoenix
#

Ik

#

But like I said

#

Lol

#

Its not working what their saying to do

#

What are you typing in the message

#

@earnest phoenix

#

the help or the vc thingy?

#

both

#

did you set a prefix

#
henryplayhttps://www.youtube.com/watch?v=YJVmu6yttiw
henryhelp```
#

woops

#
henryplay https://www.youtube.com/watch?v=YJVmu6yttiw
henryhelp```
#

that's what I send

#

LOL

#

what?

#

Show me your if statement for the vc join again

#

Im afraid I know why it wont work

#
    //      if(!message.guild.voiceConnection) message.member.voiceChannel.join().then(function(connection) {
      //        console.log("this works!")
              //play(connection, message);
        //  });
#

No

#

Show me the line of the if

#

the henryplay thingy?

#

Yes

#
    if(cmd === `henryplay`){
#

if(cmd === 'henryplay') will trigger only if you type in "henryplay"

#

Not when you type a link afterwards

#
          if(!args[0]) {
              message.channel.send("Please provide a link.");
              return;
          }

          if(!message.member.voiceChannel) {
              message.channel.send("You must be in a voice channel.");
              return;
    ``` then that's useless?
#

So just type in "henryplay"

#

Yes

#

nope

#

no join nothing

#

Show me the code again...

#

Remove everything on henryplay

#

ok

#

Except what I told you to add

#

Before

#

By the way

#

args is not a variable in your code

#

That could be the reason why the command won't work

#

The bot tries to check for args[0] but args isn't defined

#

nothing

#

So it returns with exit code

#

Aaaaaaa

#

Idk anymore lol

#

me neither