#development

1 messages ยท Page 408 of 1

floral stone
#

message.mentions[0]

earnest phoenix
#

these things are called lists in python, right?

floral stone
#

yeah

earnest phoenix
#

PartyParrot woohoo i didnt forget python at all

abstract mango
#

lists are ['thing', 'thing']

#

but you can do the same thing with them

#
a = ['thing', 'thing']
print(a[0])
``` would return `thing`
#

if i'm correct

knotty steeple
#

so basically javascript arrays are called lists in python

floral stone
#

yes

earnest phoenix
#

I added these styles:

b { color: black !important; }
h2 { color: black !important; }
h3 { color: black !important; }

but every text in <h2> is still white.

#

but it works for <b>

#

but why?

elder rapids
#

oh no, the use of !important ๐Ÿ‘€

earnest phoenix
#

nvm could fix it

elder rapids
#

pro-tip it's better to use more specific selectors than !important ๐Ÿ‘€

earnest phoenix
#

okay thanks

elder rapids
#

people will argue this though

earnest phoenix
#

i used to use setgame

#

but that got deprecated

toxic oracle
#

is ur account streaming

earnest phoenix
#

no

#

but it still said i was streaming when i was using setgame

split ether
grizzled isle
#

What is your main file name?

split ether
#

main file name?

trim plinth
#

yes

split ether
#

er

shy verge
#

check package.json

split ether
#

bot.js

shy verge
split ether
shy verge
#

paste the contents of your package.json

split ether
#

{
"name": "greeter-bot",
"version": "1.0.0",
"description": "My own Discord bot",
"main": "bot.js",
"author": "YOUR-NAME-HERE",
"dependencies": {}
}

shy verge
#

huh

grizzled isle
#

Do you have the main file named bot.js

split ether
#

I have a file named bot.js

grizzled isle
#

Is that the main file?

split ether
#

Don't know what you mean by main file

halcyon abyss
#

are you in the right folder ?

shy verge
#

is it in the same directory as your package.json

grizzled isle
#

What is the file called when you do <Client>.login(SuperSecretToken)?

halcyon abyss
#

He just typed his command in the wrong folder

split ether
#

well

#

im in the folder

#

communications then bot

#

then selects bot.js

#

idek

shy verge
#

make sure the mainfile is in the same dir as the package.json or you need to specify folder in the path iirc

halcyon abyss
#

This is the typical error when I write node 'some file who dont exist' on my side though

knotty steeple
#

if i were to make cleverbot, what would i use?

halcyon abyss
#

there's no custom file in call stack

bitter jay
#

Lil

split ether
#

Like, the files are in the same folder

shy verge
#

directly call the file instead of node .

#

node bot.js instead

knotty steeple
#

that should work

shy verge
#

your package.json could be rekt for some reason

#

hey wait

#

why are there no dependancies in your package.json

split ether
#

i dont get any of whats happening rn

bitter jay
#

Dependencies are good to have

shy verge
#

ok i have to check something

#

do npm ls

split ether
#

woah

#

says like

#

peer dep missing

#

stuff

shy verge
#

yeah that's normal

#

but is djs in that tree

#

is discord.js on that list

split ether
#

discord.js@11.3.2

shy verge
#

ok

#

uh

#

hmmmmm

knotty steeple
#

in discord.js can u do msg.send()?

halcyon abyss
#

what's the content of the folder

#

(Bot)

split ether
#

auth.json

#

bot.js

#

package.json

shy verge
#

hmmmm

#

just try node bot.js

split ether
#

same error thing

halcyon abyss
#

maybe node don't have permissions to access to that folder ?

#

idk

split ether
#

oof

#

how would like

#

it not have access

shy verge
#

run your terminal as admin

#

might be some good ol windows fuckery

split ether
#

using cmd

shy verge
#

k

#

close that

split ether
#

did this over and over

#

nothin

halcyon abyss
#

bc don't understand how node would exit directly before reading anything if file really exists

shy verge
#

do windows key + X

#

click cmd (admin)

split ether
#

k

shy verge
#

and then do cd C:\Users\Alex\Desktop\Communications\Bot

toxic oracle
#

and then do node .

split ether
#

k

#

nope

toxic oracle
#

show me whats in the Bot folder

shy verge
#

dir

#

type that

earnest phoenix
split ether
#

might be because its text doc

#

idk

earnest phoenix
#

it is

toxic oracle
#

lmfao

split ether
#

welp

earnest phoenix
#

lol

toxic oracle
#

bot.js.txt

split ether
#

g

#

g

shy verge
#

gg

split ether
#

how to fix

earnest phoenix
#

:youtried:

shy verge
#

what text editor are you using

toxic oracle
#

click view

#

click File name extensions

#

and then rename to just .js

shy verge
#

actually tho

split ether
#

k

shy verge
#

what's your editor?

earnest phoenix
#

who u askin?

#

him?

shy verge
#

@split ether

halcyon abyss
#

xD

split ether
#

?

#

well

halcyon abyss
#

yeah that was that

knotty steeple
#

notepad++

halcyon abyss
#

File don't exists

split ether
#

i have like the studio code thing also

earnest phoenix
#

i use notepad

#

lol

#

jk sublime

shy verge
#

i use nano

earnest phoenix
#

and sometimes atom

knotty steeple
#

i use visual studio code

#

best editor

shy verge
#

i use emacs

#

jk LUL

earnest phoenix
#

i have that but it eats my cpu

halcyon abyss
#

vim > all

shy verge
#

no

#

use gnu nano

knotty steeple
#

well rip you @earnest phoenix

shy verge
#

no

knotty steeple
#

VSC runs fine on my laptop

earnest phoenix
#

rip me

#

Lol

shy verge
#

use echo "code" >> bot.js

knotty steeple
#

also

halcyon abyss
#

Use echo text >> file

#

u_u

knotty steeple
#

how would i integrate cleverbot

#

on my bot

halcyon abyss
#

check out their api

earnest phoenix
#

with the api

#

:/

knotty steeple
#

what api

halcyon abyss
#

official cleverbot api..

knotty steeple
#

but isnt it paid?

shy verge
#

you need to pay out the nose for it tho

halcyon abyss
#

Yeah it's not free

earnest phoenix
#

no theres a free i think 1k requests

knotty steeple
#

i need a free version

shy verge
#

see if you can get your hands on @cold harness's Jade

halcyon abyss
#

It got removed

shy verge
#

its an actual ai

earnest phoenix
#

and that lasts awhile, its lasted me 2 years

#

lol

knotty steeple
#

jade?

shy verge
#

his ai

earnest phoenix
#

idk why they didn't just keep setGame

#

@ornate zealot

split ether
earnest phoenix
#

yeah

shy verge
#

cause setgame locks you to "PLAYING"

split ether
#

for every thing?

earnest phoenix
#

no it doesnt

split ether
#

because some has .json

earnest phoenix
#

well yeah it kinda does lol

knotty steeple
#

i use .setPresence

inner jewel
#

because you don't have just games anymore

#

you have other types of activity

knotty steeple
#

u have listening

#

and watching

earnest phoenix
#

oh and rich presence

knotty steeple
#

yes

earnest phoenix
#

like this?

split ether
earnest phoenix
#

okay

#

open auth.json

split ether
#

k

knotty steeple
#

yes @earnest phoenix

earnest phoenix
#

its not working rip

knotty steeple
#

wait

split ether
#

wat

earnest phoenix
#

alex

split ether
#

?

earnest phoenix
#

whats in auth.json,

#

is it your token?

split ether
#

ye

knotty steeple
#
game: {
name: "",
type: 0
}```
earnest phoenix
#

how is it formatted (replace your token with "TOKEN")

split ether
#

// JavaScript source code

{
"token": "TOKEN"
}

earnest phoenix
#

remove the //

#

like the comment

split ether
#

k

earnest phoenix
#

remove // JavaScript source code

split ether
#

did

earnest phoenix
#

save it

#

and try to run again

split ether
#

k

knotty steeple
#

also @earnest phoenix u have to do bot.user.setPresence({options})

shy verge
#

@split ether comments aren't allowed in json

split ether
#

oof welp

earnest phoenix
#

wdym samurai

split ether
#

it kind of worked

earnest phoenix
#

Bot is the client

#

user is Client#user

toxic oracle
#

right

split ether
#

so it didnt give any errors but

#

my bot still is offline

#

);

shy verge
#

@earnest phoenix {} = notate json

earnest phoenix
#

hm?

#

i know that the user is an object

#

i guess i can change properties there

#

i like the methods

#

it makes it easier

#

alex

#

is it the proper token?

split ether
#

uhm

#

let me check e.e

knotty steeple
#

this is what i do

split ether
#

wait

#

do i use secret token

earnest phoenix
#

this is what i do because i use a handler

knotty steeple
#

i have a handler as well

earnest phoenix
#

Yeah you do alex

split ether
#

oof did the client id

knotty steeple
#

well command handler

split ether
#

and of course

#

it gave an error

earnest phoenix
#

i use event and command handler, aswell as a config handler (for custom guild configs)

#

idk why the setPresence isnt working

split ether
earnest phoenix
#

here

#
{
'token':'(PASTYOURTOKENHERE)'
}```
#

put that in auth.json

#

make sure the quotes are still around your token

grizzled isle
#

PAST

earnest phoenix
#

lmao

split ether
#

gg

earnest phoenix
#

oops

#

uwot

#

no

#

pls

#

nostar

split ether
#

didnt give error but

#

still offline

grizzled isle
#

gets 1000 alts

earnest phoenix
#

weird

#

is it a bot account? and is it in your server

split ether
#

yea

earnest phoenix
#

okay what token did you use

split ether
#

secret token

earnest phoenix
#

hm

#

this one?

split ether
#

oooooooooooof

#

used client secret

#

welp

earnest phoenix
#

ah

#

lmao

knotty steeple
#

i dont even know what secret is for tho

#

it seems useless

earnest phoenix
#

its for the oauth apps

#

like the login for the bot list that app

knotty steeple
#

Thonk ok

earnest phoenix
split ether
#

and of course

earnest phoenix
#

also, my game still isnt working

split ether
#

ANOTHER error

earnest phoenix
#

what error?

#

is it with auth.json again?

#

if so, you didn't format the json right to work with require

split ether
#

here

earnest phoenix
#

do you have double quotes

#

like

#

Token:'Msakfspogtjsaoedg''

split ether
#

oof

#

welp

#

didnt go online still

#

gg

earnest phoenix
#

lemme see console

#

take a pic

#

did you client.login()? idk what lib ur using

#

pretty sure djs right?

split ether
#

djs?

earnest phoenix
#

discord.js

split ether
#

idek

earnest phoenix
#

oml

#

did you write this bot?

#

or is it just something off of github or smth?

split ether
#

youtube e.e

earnest phoenix
#

ah

#

okie

#

so

split ether
#

unreliable

earnest phoenix
#

console?

split ether
#

here, can you just call, so i can share screens?

earnest phoenix
#

Yeah

night imp
#

How would I change the shadow on the bot image? I can't find anything looking through inspect element

trim plinth
#

@night imp try this maybe GWnanamiRemHmmm ```css
.bot-img {
box-shadow: none !important;
}

ashen quail
earnest phoenix
#

give your bot permissions

#

probably missing perms to embed

ashen quail
#

Okay and how do I add that perm?

earnest phoenix
#

just make a role with embed perms and give it to your bot

#

or reinvite with a new url that gives all perms

ashen quail
#

Okay

night imp
#

inb4 I had to go but the suggested solution didn't work

trim plinth
#

hm

#

@night imp try this GWnanamiMonokumaSweat ```css
#bot-details-page .bot-img {
box-shadow: none !important;
}

night imp
#

dblSmile it worked!

#

Thank you

trim plinth
#

np GWnanamiKonataThumbsUp

austere meadow
#

does anyone know if its possible to extend the functionality of the send function in discord.js? i can extend TextChannel, but i wanted to know if theres a way to override/extend the send function to make it so i can pass translation through it

spring ember
#

Umm can't you use an object format to translate and then pass it to send?

young cradle
#

It is possible, but on Message case you have to change the object itself you can't simply extend, I can send you an example if you want

austere meadow
#

@spring ember i haven't optimized my code for translation, and it would easier if i could sort of extend send to deal with translation inside of that

#

@young cradle sure, an example would help blobsmilehappy

young cradle
#

Oh I just read TextChannel @.@, but well, doing this way for that case should be better anyways

gilded blaze
#

i would just make a translation portal

#

like a module

young cradle
#

Look at the extensions folder if needed, and yes it is TypeScript, but you shouldn't have a problem reading it

spring ember
#

That's what I suggested

austere meadow
#

thanks!

#

@gilded blaze i would do that, but then i'd have to go into every single file i've ever used text with and add some kind of function between the text to translate it

fluid basin
#

@austere meadow tbh you could replace the function at the onmessage event

gilded blaze
#

rip

fluid basin
#

like message.channel.send = function(msg) {...}

#

But extending I guess you'll need to mess around with the library itself?

#

Like you could do stuff with the message first, then send it

#

Yeah basically like

austere meadow
fluid basin
#

Honestly

#

I'd say do remapping

austere meadow
#

how would i go about doing that

ashen quail
#

how do I make it so that every - in an args will be changed to a space? like hello-hi will become hello hi

fluid basin
#

hmm

#

Language @ashen quail ?

#

what lang

ashen quail
#

js

#

java script

fluid basin
#
let args = ["hello", "hi"];
args = args.join('-');
console.log(args);
// prints "hello-hi"
ashen quail
#

well the problem is that here is my code:

if(message.content.startsWith(prefix + "cembed")){
  if (!args[0]) {
  message.channel.send("Test");
  } else {
 let title = args[0];
let desc = args[1]
if (!args[1]) {
let cembed = new Discord.RichEmbed()
.setTitle(`${title}`);

message.channel.send(cembed);
} else if(args[1]) {
console.log("a");
let cembed = new Discord.RichEmbed()
.setTitle(`${title}`)
.setDescription(`${desc}`);

message.channel.send(cembed);
}
#

so yeah it is hard to do that

fluid basin
#

Well @austere meadow you could do something like this in your onMessage event:

message.channel._send = message.channel.send;
message.channel.send = (msg, lang) => {
  msg = translate(msg, lang);
  message.channel._send(msg);
}
#

So every message will get translated if you provide a lang etc

austere meadow
#

ill try that

#

thanks blobthumbsup

fluid basin
#

Thats only for plain messages... embeds will be much harder

ashen quail
#

oh rip

fluid basin
#

@ashen quail I don't really get what you are trying to do in that code

ashen quail
#

well I want people to be able to create their own embeds

fluid basin
#

and ugh your code is really messy haha

#

Well in your case you could use quotes I guess

#

Or if you insist with - then..

ashen quail
#

ik

fluid basin
#

I guess a simple replace will do

ashen quail
#

my code is REALLY messy

fluid basin
#
let title = args[0].replace(/-/g, " ");
let desc = args[1].replace(/-/g, " ");
#

@ashen quail

ashen quail
#

Oh thanks!

fluid basin
#

Haha np

bitter jay
#

No problem, I helped a lot.

ashen quail
#

yeah thanks allte could not have done it without you x)

fluid basin
#

Btw /-/g is regex xD

#

Matches "-" and matches all instances "g" (which means global)

ashen quail
#

@fluid basin oof

(node:9180) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'replace' of undefined
#

Oof\

fluid basin
#

ugh you sure you added args?

ashen quail
#

yeah

#

let args = messageArray.slice(1);

fluid basin
#

probably you need to check if args[1] is defined

#

Or add it in the second part

ashen quail
#

ok

fluid basin
#

Like in the else if (args[1]) {...}

ashen quail
#

Okay it works, Thanks!

fluid basin
#

np ๐Ÿ˜‰

gilded thunder
#

Instead of making a background action or whatever, can I just do something like this to have the playing status update?

while True:
await bot.change_presence(game=discord.Game(name="arc!help | {} servers and {} users!".format(len(bot.servers), len(set(bot.get_all_members()))), type=3))
asyncio.sleep(120)
dusty shuttle
#

hello

#

can someone help me

halcyon abyss
#

First start by asking your question, it will be faster

low rivet
#

@gilded thunder no

gilded thunder
#

๐Ÿ‘Œ

low rivet
#

use loop.create_task(func())

dusty shuttle
#

@gilded thunder free now?

#

sry by mistake i tagged u @low rivet

low rivet
#

๐Ÿ˜ณ

gilded thunder
#

omfg

#

No, I'm at the pub for dinner.

#

I have my laptop and stuff.

dusty shuttle
#

okay have funhrt

gilded thunder
#

But it's a time for me to relax before I have another week of school.

#

I might be available in an hour or so.

#

What do you need help with anyway?

dusty shuttle
#

okay

#

i need help with codings

#

idk where to add them

lament meteor
#

what coding lang u coding ur bot?

#

and what lib?

#

maybe i can help

dusty shuttle
#

python

#

i added autobot files to my bot

gilded thunder
#

There's your problem.

dusty shuttle
#

ohh

#

idk what files to add

gilded thunder
#

Your own.

lament meteor
#

ah...

#

theres ur problem

dusty shuttle
#

my own?

lament meteor
#

u are coping someones work

dusty shuttle
#

yeah

lament meteor
austere meadow
#

@earnest phoenix can i ask how you update the db and your configuration map/collection? is it through an extender or a structure?

dusty shuttle
#

okay

earnest phoenix
#

@austere meadow well i use Klasa but, structures.extend, class for configs

dusty shuttle
#

@gilded thundercan u come pm?

gilded thunder
#

Sure.

#

My dinner can wait, I guess.

dusty shuttle
#

nope

#

have dinner and come to me

gilded thunder
#

Alright.

austere meadow
#

cheers jacz

earnest phoenix
#

Anyone who knows c# very good and can help me?

prime cliff
#

It would be better to explain what you need help with

earnest phoenix
#

Ok soo i have my own source for my bot but i wanted to test and edit the nadeko bot source , i edited the dmhelp to look like this

#

but it still sends this message

#

any ideea?

prime cliff
earnest phoenix
#

It's not about that

#

The problem is the text doesn't change

#

It keeps runing the old .help message

gilded thunder
low rivet
#

str(ctx.message.author)

#

i assume its python

gilded thunder
#

Yeah.

low rivet
prime cliff
#

Yea you need to turn it into a string not using the object

low rivet
#

@prime cliff you use dbm? GWcfcThonk

prime cliff
#

Check my status facepalm

gilded thunder
#

Yep, that worked.

#

Thanks

low rivet
#

o

#

lol

earnest phoenix
#

soo @prime cliff Can you help me?

low rivet
#

my respect for you is restored

prime cliff
#

Check to see if one of the functions is not overwritting it

earnest phoenix
#

it is not

prime cliff
#

Ok where do you have the help command defined in a
[command("help")]

earnest phoenix
#

Can you acc my friend request so we can talk there?

prime cliff
#

Or we could just talk here....

earnest phoenix
#

ok

#

Like i said i just want to test and edit the nadeko bot source from github

#

i don't know where is defined help

#

command

prime cliff
#

Yea in the command structure you have

[command("help")]
public async Task Help()
{
}```
earnest phoenix
#

i don't find it

prime cliff
#

Then where are you trying to define commands?

earnest phoenix
#

i try to edit the string of the help command

#

but it keeps saying the same thing

prime cliff
#

But where are you defining the commands to run?

knotty steeple
#

what npm module would i use for image manipluation

earnest phoenix
#

canvas

#

or jimp

#

jimp slow

#

yes

#

that why i said jimp

#

what

#

jimp slow

knotty steeple
#

u trying to set me up? zoomeyes

fluid basin
#

sharp?

#

based off libvips so its very fast

#

@knotty steeple

knotty steeple
#

what is

fluid basin
#

?

#

I would say either canvas or sharp

low rivet
#

you just pinged a random dude

toxic oracle
#

no

#

it was a bot

grizzled isle
#

Using discord.js, can someone help me figure out if the bot has permissions to send messages in a channel? I've tried permissionsFor() but it always returns null and/or the member information, and not the permissions itself.

fluid basin
#

use the docs

grizzled isle
#

I am ๐Ÿ˜

fluid basin
#

well

#

its pretty easy

#

get the bot member

#

and check for send messages permissions

#

Or you could just send the output message and catch it if it fails to send(returns API error: Missing Permissions)

#

like this:

try {
  await message.channel.send('test command')
}
catch (e) {
  console.log('Message fail to send!')
}
uncut slate
#

you'd have to await it if you want to try{}catch

fluid basin
#

oh yeah whoops

#

yeah

#

Thats for await

halcyon abyss
#

channel.permissionsFor(client.user).has('SEND_MESSAGE');

fluid basin
#

if not

halcyon abyss
#

this wworks

#

client is your discord client

fluid basin
#

Must be guildMemberResolvable?

#

So user obj or member obj

halcyon abyss
#

client.user

#

sry

fluid basin
#

yeah client.user xD

halcyon abyss
#

messed up

#

n_n

ashen quail
grizzled isle
#

@ashen quail You are not returning it.

ashen quail
#

meaning what do I do?

grizzled isle
#

if (!args[0]) return....

ashen quail
#

okay so I do that for every one of them?

grizzled isle
#

No.

#

Well

#

Yes

halcyon abyss
#

or test args.length

ashen quail
#

so I would do like this?

if(message.content.startsWith(prefix + "cembed")){
  if (!args[0]) return {
  message.channel.send("Test");
  } else {
 let title = args[0].replace(/-/g, " ");
let desc = args[1].replace(/-/g, " ");


#

@grizzled isle

knotty steeple
#

yes

halcyon abyss
#

after { xD

knotty steeple
#

except

halcyon abyss
#

not before

knotty steeple
#

yea lol

ashen quail
#

okay

knotty steeple
#

also u dont need return

ashen quail
halcyon abyss
#

bc it's the same for args[1]

#

at line 6

lament meteor
#

u are only testing if there isnt args[0]

#

so if (!args[0] || !args[1]) return

brittle ginkgo
#

is someone here who is yousing discord4j?

halcyon abyss
#

If I understand correctly, it's impossible that two differentes objects have the same snowflake ? (for example a channel and a user)

restive silo
#

yes

#

snowflakes a unique

halcyon abyss
#

nice

#

i just wanted to make sure thk

dusty shuttle
#

anyone free and can help me?

topaz fjord
#

ask your question

dusty shuttle
#

i need help with creating a bot

#

ik how to create but idk how to make it online and work

topaz fjord
#

to make a bot you need to code it

dusty shuttle
#

ohh how?

topaz fjord
shy verge
#

no

#

don't use that

#

java is cancer

topaz fjord
#

no

shy verge
dusty shuttle
#

what should i use?

shy verge
#

what do you get from this quiz

dusty shuttle
#

okay i will try now

#

@shy verge it says java

shy verge
#

FUCK

dusty shuttle
#

lemme try agaim

topaz fjord
#

then use jda

shy verge
topaz fjord
#

^

shy verge
#

use that, and pick up jda when you feel comfortable

topaz fjord
#

you have to learn the lang before you code

dusty shuttle
#

it shows java coz i use android

topaz fjord
shy verge
#

Or you can just learn c# and not shove an ar15 down your throat every time you try to use async functions

dusty shuttle
#

ohh

topaz fjord
#

everyone has there own lang

#

they choose what they want

dusty shuttle
#

oh

#

is it hard to create own lang?

shy verge
#

if you really want to develop for Android, learn kotlin instead

topaz fjord
#

where did you get create own lang

dusty shuttle
#

what is kotlin?

topaz fjord
#

i said they use there own coding language

#

which doesnt mean that they made it

shy verge
#

Kotlin is officially supported in Android studio, so you can natively build Android apps with it

dusty shuttle
#

ohh ok

shy verge
#

And it's nullsafe

#

Thank fucking god

topaz fjord
#

@shy verge golang whenโ„ข

dusty shuttle
#

is there a app for that

shy verge
#

Intellij

#

Cause jvm doesn't have an easy to use cli afaik

shy verge
#

do you have a pc

dusty shuttle
#

yeah

topaz fjord
#

intellij is a text editor for java

dusty shuttle
#

ohh

topaz fjord
#

specially for jvm

shy verge
dusty shuttle
#

is there someone who use android?

shy verge
#

@topaz fjord replace java with jvm and you got it

#

cause intellij can compile any jvm lang it damn well pleases

topaz fjord
#

turtlelang

shy verge
#

as long as you have the extension lul

trim plinth
#

yes

dusty shuttle
#

i dont really have a pc

#

its with a friend

gleaming summit
#

Is there anyone who is good at ubuntu/debian or web backends?

halcyon abyss
#

coding on a phone or a tablet is srsly a pain in the ass

#

good luck

shy verge
#

^^^^^

dusty shuttle
#

really???

shy verge
#

please get some sort of computer

gleaming summit
#

coding without pc is impossible

#

sorry

shy verge
#

@gleaming summit what do you need help with?

gleaming summit
#

That's so hard

#

@shy verge oh

dusty shuttle
#

bur i will work hard untill i achive

shy verge
gleaming summit
#

I am installing mariadb-server on my ubuntu server

shy verge
#

boi

halcyon abyss
#

Tried vim on phone ๐Ÿ˜ฆ

shy verge
#

Oh shit I can't do that lul

gleaming summit
#

what

#

lel

halcyon abyss
#

never did it again

dusty shuttle
#

cya guys gonna work hard

topaz fjord
#

have fun coding on a phone

shy verge
#

Sorry I thought you were having vps trouble like this one kid who I had to ssh into to help cause he was dumb

dusty shuttle
gleaming summit
#

Mariadb returns timeout when it's demon starts

trim plinth
#

@dusty shuttle you're most likely not going to achieve as from what I know, theres no command prompt/terminal for mobiles

gleaming summit
#

lel

#

Google doesn't helps me

shy verge
#

same

gleaming summit
#

I removed all apt caches

shy verge
#

coding on a phone

gleaming summit
#

lel

shy verge
#

That's gonna be a nightmare

#

He's gonna quit before he has anything that would get on dbl

gleaming summit
#

When I code on phone, I'll write under 30 lines

#

lel

shy verge
#

I have a markdown editor and an ssh client on my phone

#

That's as far as I'll ever go without throwing my phone out my window

halcyon abyss
#

It can do the trick for emergency fix

#

But I'll stop here

#

x)

tulip steeple
#

Learnt a bit of python

#

I know how to make a simple command

#
async def play(ctx, url):

    author = ctx.message.author
    voice_channel = author.voice_channel
    vc = await client.join_voice_channel(voice_channel)

    player = await vc.create_ytdl_player(url)
    player.start()```
#

I have an error

#

It says No module namedyoutubedl

earnest phoenix
#

Okay I have my line of code to enable my discord bot to come online, I would like to know where I run the code.

shy verge
#

what's the line you use to start the boat

tulip steeple
#

I cant import PyNaC

#

l

#

Why?

#

I Installed it?

earnest phoenix
#

From what I pick up the code I'll be using is node bot.js

#

But I want to know where I run it

#

;-;

tulip steeple
#

I recommend you dont ping

#

He'l help you when he can

shy verge
#

@earnest phoenix run that line in the same directory as bojs then

tulip steeple
#

It says Unable to import PyNaCl

shy verge
#

or if you're lazy type node . in the same directory as your package.json and it'll handle where to run for you

tulip steeple
#

Anyone?, I tried saying import PyNaCl and it gives an error Unable to import PyNaCl even though I installed it pip install PyNaCl

topaz fjord
#

Wait for someone to answer

tulip steeple
#

No wait fixed

#

I have a new problem

#

It says

#

No module named 'youtube_dl'

earnest phoenix
#

pip install --upgrade youtube_dl

tulip steeple
#

Ty

raw wharf
#

How can I animate the profile image of discord bot list of my bot?

narrow quiver
#

guys help me

#

whats the code to the bot for make the bot say a random

earnest phoenix
#

say random what? and what language/library ?

narrow quiver
#

its eris

#

say a random linguage

trim plinth
#

@raw wharf css

raw wharf
#

@trim plinth ty

tulip steeple
#

My bot now has voice now

#

Yay

#

Guys I need help

trim plinth
#

yes

raw wharf
#

@trim plinth Where do I insert CSS inside the page?

tulip steeple
#

WHen the song finishes why wont my bot leave the voice channel>

trim plinth
#

@raw wharf long description through <style> tags

tulip steeple
#
async def play(ctx, url):

    author = ctx.message.author
    voice_channel = author.voice_channel
    vc = await client.join_voice_channel(voice_channel)

    player = await vc.create_ytdl_player(url)
    player.start()```
#

How Do I make it leave the voice channel when its done

raw wharf
#

snarkyllama#4331 ty ;D [no more ping good ]

earnest phoenix
#

you need to pay @gilded plank 3000$ upfront

tulip steeple
#
async def play(ctx, url):

    author = ctx.message.author
    voice_channel = author.voice_channel
    vc = await client.join_voice_channel(voice_channel)

    player = await vc.create_ytdl_player(url)
    player.start()```
#

How Do I make it leave the voice channel when its done

earnest phoenix
#

its the one on your discord app panel

tulip steeple
#

Hq do you know how to make the boot leave the voice channel

fresh cedar
#

VoiceChannel.leave()

tiny turtle
#
 // can put custom stuff that doesn't work properly in run scripts here!

   client.on("messageDelete", (message) => {
        const content = message.content;
        const author = message.author.tag;
        const channel = message.channel.name;
        const botlog = client.channels.find("id", "ID HERE");
        const id = message.id;
        const embed = {
            "title": "Message from " + author + " removed!",
            "description": content,
            "color": 9902553,
            "footer": {
                "text": "In: #" + channel + " ID: " + id + " Guild: " + message.guild.name
            }
        };
        botlog.send({ embed });
   });
}```

How do I make this say the channel name instead of ID and have it send it to a channel in all servers called bot log instead of just my server?
inner jewel
#

why do you want to broadcast globally message deletions

tiny turtle
#

its an option for server admins II dont want it global is the thing

#

local servers

#

this was sending them all to my server from all servers

inner jewel
#

message.guild.channels.find instead of client.channels.find

#

afaik

tiny turtle
#

ty

#

can I use name instead of id?

#

message.guild.channels.find("name", "name HERE");

#

so this should work more as intended

    client.on("messageDelete", (message) => {
        const content = message.content;
        const author = message.author.tag;
        const channel = message.channel.name;
        const botlog = message.guild.channels.find("name", "bot-log");
        const id = message.id;
        const embed = {
            "title": "Message from " + author + " removed!",
            "description": content,
            "color": 9902553,
            "footer": {
                "text": "In: #" + channel + " Channel: " + message.channel.name + " Guild: " + message.guild.name
            }
        };
        botlog.send({ embed });
    });
}```
#

or should I edit the client.on to guild.on

fresh cedar
#

channel does not have a name property i believe

tiny turtle
#

so leave it as id

fresh cedar
#

Although you can search for it that way

#

Weird

tiny turtle
#

yea that was my main issue

#

its a bit confusing

fresh cedar
#

Okay try

#

should work

#

Because GuildChannel has a name property

#

Oh you already have it

narrow quiver
#

how does eris libary bot create a game in chat

gilded blaze
#

I donโ€™t think it can

#

Are you talking about status

narrow quiver
#

no one game to play

gilded blaze
#

?

narrow quiver
#

a code to bot make a minigame in chat

gilded blaze
#

Oh

#

Thatโ€™s possible

narrow quiver
#

equal to bird game of tatsumaki

gilded blaze
#

You have to create the logic

narrow quiver
#

ok

#

do you have a tutoriaรง

inner jewel
#

some libraries have built in ways of listening to messages like the d.js message collector

narrow quiver
#

on yt

#

i use the eris lbary

inner jewel
#

yt tutorials are bad in general

#

they get outdated quickly

gilded blaze
#

Ye

inner jewel
#

and you probably won't find one for something specific like this

gilded blaze
#

So you wanna wait for a message then do something with it?

inner jewel
#

the easiest way is reading the docs and implementing it yourself

narrow quiver
#

oh

#

ok

#

guys how does your bot turn on forever even when your pc is turned off

topaz fjord
#

vps

#

we bought a vps

inner jewel
#

check pinned messages

gilded blaze
#

Or raspberry pi

topaz fjord
#

ew no

gilded blaze
#

Well paying monthly is hard

inner jewel
#

a pi is good enough for most bots

gilded blaze
#

At least for me

inner jewel
#

if you don't have music and have a stable power supply and internet

gilded blaze
#

Yeah

inner jewel
#

a pi should easily handle a few thousands of guilds

#

(considering a pi 3b)

narrow quiver
#

ok

topaz fjord
#

natan ur smart help

tepid laurel
#

Vps cheaper tho comparing to electrical costs

#

Paid a year vps about 85 dollars

#

Electrical bill is waaay higher

inner jewel
#

depends on where you live

#

also an rpi doesn't use much

tepid laurel
#

Running it a year it used more energy in costs then a vps costs me definitely

earnest phoenix
#

huh wat?

#

rpi cost at most 0.02$ per day

ashen quail
#

oops

#

ok fixed it

knotty steeple
#

lmao

ashen quail
#

i meant the message

#

not the code

#

xD

earnest phoenix
#

something something exports and imports

#

So I'm making a custom prefix command and it says there is something wrong with this line: let prefixes = JSON.parse(fs.readFileSync("./prefixes.json", "utf8")); and the error is ``` (node:2858) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected end of JSON input

at JSON.parse (<anonymous>)```
knotty steeple
#

check the json file

earnest phoenix
#

Already did

#

should I add {
}
?

#

maybe.

knotty steeple
#

no

earnest phoenix
#

then what?

halcyon abyss
#

then what's inside your json file

earnest phoenix
#

nothing.

halcyon abyss
#

that's it

knotty steeple
#

maybe thats why Thonk

earnest phoenix
#

hm

#

then what do I need to add?

halcyon abyss
#

{}

earnest phoenix
#

didn't change at all.

knotty steeple
#

do u have a db

earnest phoenix
#

didnt even log it.

knotty steeple
#

do you have a database

#

to store that prefix

earnest phoenix
#

prefix.json

#

prefixes.json*

trim plinth
#

@earnest phoenix don't use json for storing data like prefixes

#

use a database

earnest phoenix
#

What I heard is its glitch being glitch

#

so I just removed it

#

I think ** is a good prefix anyways

earnest phoenix
inner jewel
#

.setImage("./memes/tf2/" + memes[Math.floor(Math.random() * memes.length)]);

#

you can't set local files as image

#

you need to upload them

earnest phoenix
#

How would I fix that then? not exactly sure how I'd upload them

knotty steeple
#

how would a bot upload images without a link

inner jewel
#

attachments

knotty steeple
#

hmm

earnest phoenix
#

MessageAttachments = memes

#

?

inner jewel
#

i don't use discord.js ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

rip

knotty steeple
#

look in docs

earnest phoenix
#

Its MessageAttachments

#

a

#

some1 remove the 2 roles

#

pls

#

wait how do i have bot developer, my bot isnt accepted yet

gilded blaze
#

-bots <@211649732890722304

gilded plankBOT
#
LoseJoe#6437
Bots

@rigid gorge

earnest phoenix
#

How would I define setFile?

tulip kraken
#

Whats this even

#

message.channel.reply

#

Thats creative

#

you can

#

do

#

msg.channel.send({ file: mphoto })

#

That should work

earnest phoenix
#

ok

tulip kraken
#

@earnest phoenix Did it work?

earnest phoenix
#

Yes

#

its just one issue

#

it goes back a bunch of tragectories

#

doesn't see the discordbot.js file

#

discordbot (attempt) as it is in my pc

#

but wouldn't

"./commands/memes/tf2/bad.png",

work if its in the commands folder?

tulip kraken
#

Should be fine

earnest phoenix
#

Ok

tulip kraken
#

Glad i could help ๐Ÿ‘

earnest phoenix
#

It didn't work, I had to do this:

"../Discord bot (attempt)/commands/memes/tf2/bad.png",

But, I am glad you tried! Thx

#

don't ask me why it didn't want to work

earnest phoenix
inner jewel
#

you'd need to load them all

#

and sort

earnest phoenix
#

idk how to sort

#

like idk how to use .sort()

inner jewel
#

what language?

earnest phoenix
#

discord.js

#

or node

inner jewel
earnest phoenix
#

:/

#

lol

#

im on that rn

#

actually

inner jewel
#

array.sort((a,b)=>b-a)

#

to sort from high to low

earnest phoenix
#

what the hecc

#

okay

#

well isnt that for an array?

#

cus i have objects

#

i guess ill need to load them somehow

#

.?

maiden mantle
#

Alright so,
I'm programming on sublime
How do I get my bot online?

earnest phoenix
#

Prince i am too

#

(a,b) => do some logic then return 1 if a comes before b , -1 if b comes before a , 0 if equal

elder rapids
#

You run your bot program

maiden mantle
#

I know you have to use client.login then token (right?)

earnest phoenix
#

ye

maiden mantle
#

Which file though

elder rapids
#

the main file

earnest phoenix
#

it'll teach you

inner jewel
#

@earnest phoenix you have an array of objects

#

you sort that array

maiden mantle
#

I have package.json, auth.json, and bot.js

earnest phoenix
#

OH

#

im so dumb

maiden mantle
#

which file do i put it in

ashen quail
#

I am making a small library that makes it easier to code but I really don't want people to copy my code, what do i do?
and I do what the API to be public ๐Ÿ˜ข

What do i do?

topaz fjord
#

Put a license

#

That prohibits public use

#

Or smth

#

GitHub has lots of them

maiden mantle
#

so to make my bot online I need to put client.login ('token') but which file do I put it in
Package.json, auth.json, bot.js

earnest phoenix
shy verge
#

run your bot with your normal args, but append --trace-deprecation

#

and copypaste the stacktrace you get when running the command

earnest phoenix
#

?

grizzled isle
#

client.on("warn", err => { console.log(err.stack) }) would work also

toxic oracle
#

no it wouldnt

#

lol

earnest phoenix
#

    const args = message.content.slice(prefix.length).trim().split(/ +/g);
    const command = args.shift().toLowerCase();

    try {
            let commandFile = require(`./lib/commands/nsfwCommands/${command}.js`);
            commandFile.run(client, message, args);
    } catch (err) {
            console.error(".");
    }
});```
toxic oracle
#

there we go

earnest phoenix
#

didnt i already catch the error?

shy verge
#

we need to know where the warning is raised

#

the exact line of code

earnest phoenix
#

hmm

#

ok

#

how does one do this?

toxic oracle
#

ye console log the error not just "."

earnest phoenix
#

i added the .

toxic oracle
earnest phoenix
#

as a way of ignoring them for ahilw

toxic oracle
#

ok?

shy verge
#

i'm guessing it has something to do with whatever you're doing with fs cause normal network io doesn't do that

maiden mantle
#

which file do I put it in

shy verge
#

?????????

earnest phoenix
#

im not using io or am i confused?

shy verge
#

network io = just doing network based things

#

like that reddit scraper you seem to be using

earnest phoenix
#

well the fs is making a file named 4k writing an image to it and sending said image

shy verge
#

is there any way to just get the image link and stick it in an embed?

earnest phoenix
#

hmm

shy verge
#

cause that seems unnecessarily complex

earnest phoenix
#

ive been trying that for ages

#

i cant find one

#

and the the reddit scrapper seems to only work this way

shy verge
#

hmmmmmmm

earnest phoenix
#

second please

#

im perplexed

#

im gonna log r.body

#

and see if its a link

#

i hope it is

#

because if it is

#

then ill get what i need

earnest phoenix
#

fs.writeFileSync(4k.jpg, r.body)?

#

maybe///

shy verge
#

do you really want to use fs for this?

earnest phoenix
#

hmm

#

no

#

i just want it to give me the image

delicate zephyr
earnest phoenix
#

........................

#

......................

#

.................

#

RUN

delicate zephyr
#

nvm

earnest phoenix
#

Visual Studio Code keeps saying

#

npm ERR! Callback called more than once.

#

And it won't work

#

Any suggestions?

#

(I am using Javascript)

low rivet
#

code

earnest phoenix
#

.

#

.

#

.

maiden mantle
#

so to make my bot online I need to put client.login ('token') but which file do I put it in
Package.json, auth.json, bot.js

lament meteor
#

learn js pls

amber ice
#

@maiden mantle client.login goes at the bottom of bot.js and bot.js is stored in you're bot file

earnest phoenix
#

I am learning js

amber ice
#

Same

#

I think I'm better using js then python ๐Ÿ˜„

earnest phoenix
#

I tried Python and I learnt it all

#

It's just it broke

low rivet
#

maybe u just didn't know how to use it

lament meteor
#

how do u get the png type of a gif avatar of a user?(discord.js)

earnest phoenix
#

stable or master?

floral stone
#

Can't you replace the gif to ping of the string itself with js

earnest phoenix
#

idk about stable since I havent used it forever but on master it is user.displayAvatarURL({format:'png'}) @lament meteor

lament meteor
#

ah... ok

#

but iirc im using stable

#

im thinking of moving to master thou is it better?

#

which one u think i should use?

hot sleet
#

You need to provide a client to bind to, either in the constructor of dblposter or in the bind function!

#

this is error

#

note : trying on test bot it mean the bot isn't in dbl list