#development

1 messages · Page 425 of 1

fluid basin
#

order by column_name desc

earnest phoenix
#

What does it do?!!

fluid basin
#

Returns results ordered using the column and in desc or asc

#

Like for int it goes from highest to lowest for desc and vice versa

earnest phoenix
#

Let me execute it

feral heath
#

For discord.net what would be the name of the permission equivalent to Read Text Channels & See Voice Channels?

halcyon torrent
earnest phoenix
#

Hey guys anybody know a tutorial/wanna send me text tutorial how to make a website dashboard for bot?

#

Discord.js btw

abstract crystal
#

Hey, this video is going to show you how to create a simple web dashboard for a discord bot. The principles are similar to every other kind of dashboard but ...

▶ Play video
#

the last two are not tutorials

slate basin
#

what do you call it when you need a webpage to fit the page without leaving white source

#

i mean like autofit

earnest phoenix
#

where

slate basin
#

give me a second

#

at the bottom of a page

#

sometimes if the page isn't made correctly

#

it will show your content

earnest phoenix
#

do you have a screen or something

#

having a hard time to understand what you mean

slate basin
#

huh

#

ok

#

wait

#

this

earnest phoenix
#

I visited your site but can't reproduce it

#

where is it at

slate basin
#

that's not where it is

#

but you will see what i mean

#

the white line isn't there

#

but

#

you will see at the bottom while switching tabs of category

#

that the bottom shows more and more

abstract crystal
#

white source?

slate basin
#

idk how to explain it ;-;

earnest phoenix
#

you mean the empty space?

slate basin
#

i fixed the white thing

#

yeah

#

idk how to fix that

#

i can add dividing stuff

#

but that's a temp fix

violet wyvern
#

Does anyone know how to make a meme command discord.js?

slate basin
#

use subreddits

earnest phoenix
#

remove all the excess dividing and then we can fix the actual problem

#

xD

slate basin
#

u mean

#

remove the dividers

#

?

#

ok

earnest phoenix
#

divider is causing the empty space because of the long ass height it has

violet wyvern
#

Hmm

slate basin
#

for fuck sakes

#

i accidentally deleted everything

#

XDDDD

earnest phoenix
#

xD

slate basin
#

okay looks like i gotta recode

#

cause i accidentally

#

copied and pasted an image

#

into my discord

#

and saved it

earnest phoenix
#

no ctrlz?

#

no backup?

slate basin
#

didnt work

#

my backup is of my old old

earnest phoenix
#

stop using notepad reeeeeee

slate basin
#

table

#

reeeeeeeeeeeeeeeeeeeee

#

nvm

#

this is gonna be fun

#

;-;

earnest phoenix
#

well dm me when you are done if u still want help t.t

violet wyvern
#

Does anyone know how to make a meme command discord.js?

abstract crystal
#

do you mean to MAKE a meme or just post random memes?

violet wyvern
#

Post random memes

tardy stag
#

so memes ?

violet wyvern
#

I want to use it just for my own server 🙏 pls help me

slate basin
#

i legit

#

told you ;-;

#

you needa use subreddits...

#

its the same with every other random image posting command

abstract crystal
#

@violet wyvern you can get an api (i can allow you to use mine: https://api.ksoft.si) or you can use other apis like reddit api

violet wyvern
#

Ok

#

But I don't know how to use APIs

#

Never used one

#

Only for the cats command

slate basin
#

smh...

abstract crystal
#

@violet wyvern it goes the same, also there is a lot of documentation

violet wyvern
#

Ok

abstract crystal
#

which lang do you use?

violet wyvern
#

discord.js

abstract crystal
#

kk

violet wyvern
#

I still dunno how to use APIs

wise bridge
#

You know what JSON is?

violet wyvern
#

Yup

abstract crystal
#

what do you use for cat images?

violet wyvern
#

Aws

abstract crystal
#

in the code i mean

violet wyvern
#

superagent

#

Help?

abstract crystal
#

sec

#

just studying superagent

violet wyvern
#

K

abstract crystal
#
request
    .get('https://api.ksoft.si/meme/random-meme')
    .set('Authorization', 'Token insert_your_token_here')
    .then(function(res) {
// Do the json parsing and logic here
});
violet wyvern
#

I need to do that in a .json file?

abstract crystal
#

nope

#

how do you do cat images?

violet wyvern
#

if (command === "cat") {

 const { body } = await superagent

 .get('aws.random.cat/meow');

 const embed = new Discord.RichEmbed()

 .setColor(0x954D23)

 .setTitle("Meow 🐱")

 .setImage(body.file)

 message.channel.send({embed})
abstract crystal
#
request
    .get('https://api.ksoft.si/meme/random-meme')
    .set('Authorization', 'Token insert_your_token_here')
    .then(function(res) {
    const embed = new Discord.RichEmbed()
         .setColor(0x954D23)
         .setTitle("Random meme")
         .setImage(res.url)
         message.channel.send({embed})
});
violet wyvern
#

.set('Authorisation?

#

Why do I need to put bot token there?

abstract crystal
#

you need a Authorization header so the api knows who you are

#

don't put you bot token here

#

you get your token on the website

violet wyvern
#

Oh ok

#

Is it the api key?

abstract crystal
#

never post your bot token anywhere except discord

#

but first you need to add an application

violet wyvern
#

I already did that 😄

abstract crystal
#

sorry i don't see your application

violet wyvern
#

Where?

abstract crystal
violet wyvern
#

Now I did it

#

Did you see?

abstract crystal
#

got it

#

i'll dm you

violet wyvern
#

Ok

earnest phoenix
#

hm

#

My bot is in voice it says its talking but isnt playing anything Thonk

reef sluice
#

<@&304313580025544704> marsyturkiye bot invite plasse

south finch
#

oh good lord

quiet bobcat
#

not another one

buoyant estuary
#

And I want to send it to four

#

discord.js

quiet bobcat
#

Send them individually

buoyant estuary
#

No more, just go to the last one I put to send.

inner jewel
#

{embed} becomes {embed: embed}

#

{embed2} becomes {embed2: embed2}

#

for the second one you need to explicitly set the embed key, eg {embed: embed2}

earnest phoenix
inner jewel
#

where is the error message

tepid laurel
#

In const name

#

Owait

#

No

#

Lol

#

Read it wrong

violet wyvern
#

Hi, I need help, I need to install superagent on heroku, how do I do it

#

?

#

Help pls

restive silo
#

yes, a bot can connect to 1 Voicechannel on each guild it is in

shy verge
#

unless selfbot

#

in which case get beaned

earnest phoenix
#

python is being a bitch

#

pls help

topaz fjord
#

did you try google

wary anchor
#

with talking to discord about your bot shards, is it alright to have the first shard send [0,1] then have the next shard which gets connected correct to [1,3] or would it invalidate the previous shard?

earnest phoenix
#

Well python is IN MY FUCKING PATH

#

and its not even saying it is

#

its retarded

shy verge
#

python3

earnest phoenix
#

yes

shy verge
#

try it

earnest phoenix
#

try what

#

👀 I have it downloaded

shy verge
#

python3 give-it-to-me-daddy.py

earnest phoenix
#

no, i have it installed to install a node module

#

called quick.db

shy verge
#

did the install fail

earnest phoenix
#

yeah

shy verge
#

you need to install windows build tools

earnest phoenix
#

so

#

npm install --global --production windows-build-tools?

shy verge
#

ye

topaz fjord
#

you can just do npm - -g windows-build-tools

#

no need for production

shy verge
#

then install 🅱ython

topaz fjord
#

@shy verge windows build tools installs python

#

afaik

shy verge
#

that's even better

earnest phoenix
earnest phoenix
#

this channel is dead

dapper moon
#

weird question but on ubuntu how do you cd to a dir with a space

#

i tried cd music bot but it said no such dir as "music"

#

it didn't include the second part

quasi hearth
#

try cd music%20bot?

#

cd "music bot"

topaz fjord
#

You can do cd "name of for"

fluid basin
#

Or escape the space

#

cd music\ bot

toxic hemlock
#

Ello, I need help.

#

My hentai command wont work (d.py)

dapper moon
#

okay thx

shy verge
#

ew dirs with spaces

next bluff
#

my hentai command doesn't work either

shy verge
floral stone
#

My hentai command works just fine 😉

trim plinth
#

my hentai commands work ok

worn sparrow
#

my hentai command doesn't exist you vulgar swines

earnest phoenix
#

proper helpful

earnest phoenix
#

Is there a way to retrieve invite links of a server your bot is in?

shy verge
#

no

#

that would be bad

earnest phoenix
#

well oof

brisk notch
#

i'm getting .toLowerCase is not a function when trying to do this on an array. how do i fix this?

trim plinth
#

@brisk notch .toLowerCase() is a string method, not an array method. So you'd have to either make it to a string or possibly do a for loop or .forEach() to make each index lower case?

brisk notch
#

hmm

#

ill try to do that...

earnest phoenix
#

@gilded plank bots @hybrid edge

gilded plankBOT
#

User not found

earnest phoenix
#

-bots @hybrid edge

gilded plankBOT
#

User not found

solid cliff
quiet bobcat
zealous hazel
#

hi who knows if javascript code for a bot I'm looking for a code for my bot that says when he joined support servers

earnest phoenix
#

not actually looking for the code in JavaScript so that when the bot joins a server it gives us the invitation of the server that the bot has just joined

zealous hazel
#

🤔

earnest phoenix
#

help me please

mental solstice
#

Your bot would need permissions to create an invite. Not sure of the code.. but im sure its in the d.js docs

earnest phoenix
#

I read all the js docs but I could not find anything

zealous hazel
#

@mental solstice help please

#

😟

earnest phoenix
#

you can speak French rather ? @mental solstice

mental solstice
#

Si

#

jk, i think there is also a lookup for a server joined date

#

i dont use JS so im not sure what its called

zealous hazel
#

for javascript

mental solstice
#

@earnest phoenix read that.. might help

earnest phoenix
#

thanks you

mental solstice
#

joinedAt

#

and

#

joinedTimestamp

tame maple
#

hey sup guys

#

im trying to make a command in my bot to get the methods and shit from the discord.js docs

#

all i foun is the json files

#

i dont understand how to use the json files to get the stuff

earnest phoenix
#

@fair grail

quiet bobcat
#

stop trying to use bots in non bot channels

violet wyvern
ruby dust
#

uhhhh, remove token from the code?

earnest phoenix
#

is there anyone i can ask unrelated python questions to 🤔

violet wyvern
#

help???

ruby dust
#

my only assumption of the error is don't use heroku, I don't really do js (or whataver language this is), but ik a lot of errors are unrelated because of heroku

heady zinc
#

the error is not related to heroku at all

#

you don't destructure a method

#

like

#

what

#

why

elfin cobalt
#

can anyone help me with java in dm?

ruby dust
#

token again?

misty pawn
#

@elfin cobalt What library? JDA?

elfin cobalt
#

y

#

@misty pawn

misty pawn
#

What is your question tho.

elfin cobalt
#

            String[] arr={getEb().build() + "","2"};

            Random r=new Random();
            int randomNumber=r.nextInt(arr.length);

            event.getTextChannel();

            event.getTextChannel().sendMessage(arr [randomNumber]).queue();

        }else
            event.getTextChannel().sendMessage(" :warning: "+ event.getAuthor().getAsMention() +" this command only works in a NSWF Channel!" + " :warning:").queue();
        }```
#

why he's only giving out net.dv8tion.jda.core.entities.MessageEmbed@2b94e1a1

misty pawn
#

Why do you first get the textchannel and then send the message?

#

That makes no sense

elfin cobalt
#

yea idk

#

but it doesn't matter about my problem

misty pawn
#

What is getEb()?

elfin cobalt
#

the embed he should post

misty pawn
#

ok. So is it a own function/class or?

elfin cobalt
#

y

misty pawn
#

It returns MessageEmbed@2b94e1a1

#

So I guess it's a issue with embeds

elfin cobalt
#

so i didnt fail?

misty pawn
#

You probably did

elfin cobalt
#

xD

misty pawn
#

I personally use something like this:

public static EmbedBuilder getEmbed(User user){
    return new EmbedBuilder()
        .setFooter("Requested by " + user.getName() + "#" + user.getDiscriminator(), user.getEffectiveAvatarUrl())
        .setTimestamp(ZonedDateTime.now());
}
#

And use it later for embeds.

#

Makes it a little bit easier for me.

uncut slate
#

@heady zinc you could tho

heady zinc
#

fuck you

#

no shut up

#

he is wrong in this context

#

that's what matters

uncut slate
#
const { body } = await superagent.get({ ... });
heady zinc
#

and what would even be the point of doing that

uncut slate
#

not having to use res.body

heady zinc
#

so none ZoomEyes

uncut slate
#

well, no

heady zinc
#

discarding everything but the body is not quite nice for error handling 🙃

uncut slate
#

error handling would be in a .catch clause where you have complete access to the object

earnest phoenix
#

i want

#

hide nsfw

slender thistle
earnest phoenix
#

I?

uncut slate
#
const { body } = await get()
  .catch(res => ({ body: 'fuck' + res.statusCode }));
slender thistle
#

Yes, you. @earnest phoenix

earnest phoenix
#

Thank you

inner jewel
#

@elfin cobalt that happens because of getEb().build() + ""

#

the + "" calls the toString() method of the object

#

which gives that string for embeds

elfin cobalt
#

but without it it doesnt work

#

how can i change this?

#

@inner jewel

inner jewel
#

that way won't work at all

#

you can't just send an embed as a string

elfin cobalt
#

and how i can send random embeds?

inner jewel
#

MessageChannel#sendMessage(MessageEmbed)
MessageAction#embed(MessageEmbed)
MessageBuilder#setEmbed(MessageEmbed) + MessageChannel#sendMessage(Message)

elfin cobalt
#

okay

inner jewel
#

or instead of building an array you use a switch/if there

modern kelp
#

would you guys say that a self destruct command that sends “Self Destruction in 3 Seconds” then “Boom” with a nickname change to “Dead” 3 seconds later is classed as api abuse?

#

(of course then a nickname change back)

severe socket
#

if you want to aply this to all members of a 60k members server it's not a good idea. If it's just on a specific user it's fine theshrug

shy verge
#

what data does Discord require you to encrypt?

#

just all data they don't send you?

topaz fjord
#

Afaik it's user data @shy verge

dapper moon
#

they also now require you to get users permission to store their data like ids etc

topaz fjord
#

That's why you put it in a help message

#

Like a welcome message

#

If they read it good, if they don't, their loss

dapper moon
#

mhm

#

i put it on my bots invite link too

topaz fjord
#

I put this bot will collect guild information

#

Which includes users

dapper moon
#

its a yt vid duration apparently

#

but i have no idea what type it is

gilded blaze
#

ISO 8601 string

native narwhal
#

ISO 8601 Data elements and interchange formats – Information interchange – Representation of dates and times is an international standard covering the exchange of date- and time-related data. It was issued by the International Organization for Standardization (ISO) and wa...

inner jewel
#

P - duration
T - time
2M - 2 minutes
27S - 27 seconds

dapper moon
#

oof ok

#

thanks

#

never seen it done like that :o

earnest phoenix
#

id like a source so i can read more up on this @vestal cradle

vestal cradle
#
  return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
    else
        return text;
  }```
#

you see this ppart

earnest phoenix
#

oh

#

oh yuo modified eval

vestal cradle
#

you can remove it

earnest phoenix
#

well

#

not modified

#

but youre changing what you put in

#

eval will still always support everything

vestal cradle
#

yes support

#

but it doesnt have to have math

#

it's your choice

earnest phoenix
#

it still has math

#

you arent changing eval

vestal cradle
#

nope

earnest phoenix
#

you are simply modifying the user input

vestal cradle
earnest phoenix
#

i dont think you understand

#

you arent changing how eval works

#

in any way

vestal cradle
#

i'm not

earnest phoenix
#

you are simply restricting input

vestal cradle
#

let me just say

earnest phoenix
#

but at the core of it eval still supports math

vestal cradle
#
  return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
    else
        return text;
  }``` this is the part has been removed by me
#

not added

earnest phoenix
#

i get it, you can do all of that stuff

#

but its wrong to say eval cant support math or it can be disabled

vestal cradle
#

i didn't said eval cant support

earnest phoenix
#

because it will always support it and you cant control it

vestal cradle
#

so iwas telling him

#

tho eval can have math

#

it doesn't have to have it to work

earnest phoenix
#

you cant disable it either tho, eval is unsafe feature and it can do everything, always, so its up to you to restrict the input

#

when you say disable, you are merely controlling what goes in

#

not what it can evaluate

vestal cradle
#

lemme just say what am talking

#

so technically

  return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
    else
        return text;
  }``` this is the part of a code that coders add in a simple eval , usually to make a math from eval you need to write the whole function like [prefix]eval int a;  jada jada jada message.channel.send(this + that );  usually but coders added the above part where i said "math isn't needed for eval to work, quick math is something you can add to your eval
#

math can be done by scratch code but the code above makes it so you can simply do 1+1 without adding all the code in

earnest phoenix
#

i think the fuss here is simply a difference in view on definitions, i understand what youre doing, but to me it sounds like youre trying to say you can change how eval works, when its simply just modifying or restricting input. thats all

vestal cradle
#

let's say this

#

[prefix]eval x = 2; y = 3; message.channel.send(x + y);

#

that's the part that gets simplified by js return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203)); else return text; }

#

so eval can do math but it's not relavent to add the "eval 1+1 " <--- this bit is simplified version of [prefix]eval x = 2; y = 3; message.channel.send(x + y);

#

how about you add this case to @uncut slate if you're here

uncut slate
#

what

vestal cradle
#

so @uncut slate

#

into an "eval code" is math "needed" for eval to work

#

or is the math part just simpliefied version of [prefix]eval x = 2; y = 3; message.channel.send(x + y);

topaz fjord
#

you can just eval [prefix]eval let thing = 2+3; message.channel.send(thing)

uncut slate
#

I'm still confused, what are you trying to ask

vestal cradle
#

does eval have to respoond "eval 2+2"

#

as in eval's firstform

#

not after adding js return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203)); else return text; }

knotty steeple
#

what are you trying to do 🤔

uncut slate
#

"eval 2+2" would be interpreted as 2+2, no variables

vestal cradle
#

yes but does eval need to answer that

#

like if it doesn't have math it won't work

#

adfljasdjfkasdf

#

scratch that

#

does eval work if it doesn't respond to 2+2

#

there

#

without restriction

uncut slate
#

no

#

2+2 is regular js

vestal cradle
#

then can i ask

#

how does my eval work

#

coz what i understood

#

people add this peace of code to their eval

#
eturn text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
    else
        return text;
  }```
#

which is not needed

trim plinth
#

wat

native narwhal
#

Confused

vestal cradle
#

@native narwhal 2 of my friends says that "eval" SHOULD respond to the simpliefiedversion to "2+2"

#

which i say thats bs

#

because eval 2+2 is simpliefied version by js eturn text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203)); else return text; }

#

normally if you want math without adding that code you do

#

eval x = 2; y = 3; message.channel.send(x + y);

native narwhal
#

You have posted the same piece of code 7 times now 😂

vestal cradle
#

ys coz that's the peace of code that everyone is concerned should be on eval

#

it SHOULDN'T but it can be intto eval

native narwhal
#

Well you can just refer to the already sent piece of code instead of sending it again 😂

vestal cradle
#

ye you can

#

i was just trying to prove 2 of my friends

#

that keep bsing about NEEDING to have that

#

which pretty much turns eval x = 2; y = 3; message.channel.send(x + y); this into this eval 2 + 3

opaque bison
#

Anyone here uses RethinkDB Dash and has the problem of Can't find any open connections and can't open any after timeout? 4-5 of my shards are able to connect to RethinkDB but after that it just gives that error and fails, if anyone here knows the rethinkdb dash options to prevent such issue, lmk

trim plinth
#

hmmm

#

personally using rethinkdbdash, I've never had an issue like that

opaque bison
#

Hmm, I guess I should increase my timeout even more... Do you think buffer helps with anything in my situation?

trim plinth
#

might as well try

knotty steeple
#

is enmap a good database?

topaz fjord
#

no

trim plinth
#

enmap isn't a db

knotty steeple
#

ok

#

then what is it Thonk

trim plinth
#

extension of maps

topaz fjord
#

persistent maps

trim plinth
#

yes

knotty steeple
#

ooh

#

ok

#

got it

earnest phoenix
#

is this correct?

      let voteStatus = await dbl.hasVoted(msg.author.id).catch(error => {
           winston.error(`[VOTE ERROR]: Error checking vote for ${msg.author.tag} (${msg.author.id}):\n ${error.stack}`);
       });

       if (voteStatus) {
           msg.author.send(`Thanks for voting for ${this.client.user.username}!`);
       }```
#

What time period should I throttle my points system by?

frail harness
#

@earnest phoenix try it and see™

earnest phoenix
#

TIAS

knotty steeple
#

So i have cleverbot integration on my discord bot @vernal gull and im wondering should I use a animated emoji or typing because it takes a while to answer

trim plinth
#

typing

knotty steeple
#

hmm Thonk

#

i was doing typing but i was thinking about doing animated emoji so i asked here

earnest phoenix
quiet bobcat
#

json needs ""

#

around things

#

¯_(ツ)_/¯

earnest phoenix
#

its not json

#

👀

quiet bobcat
#

are you sure about that?

earnest phoenix
#

well I am using an object..

frigid sierra
earnest phoenix
#

my util is using quick.db so

frigid sierra
#

although i cant think of a single person here who's made a working dart bot yet

quiet bobcat
#

uh

#

could you try ""?

earnest phoenix
#

ye i just did

#

Doesn't work :/

quiet bobcat
#

hm

#

i got no idea

#

I'm sorry

uncut slate
#

@frigid sierra spong is into dart I believe

#

not sure if he's made a bot in it

frigid sierra
#

my friend @austere coyote is working on a dart lib as we speak i think

#

i can see it blowing up sometime soon

uncut slate
#

oh wait oops, yeah it was aemino, not spong

frigid sierra
#

i've already made one, but it's really basic and unmaintaned

austere coyote
uncut slate
#

the dart shill in DV

earnest phoenix
#

That looks like an easy thing to code zoomeyes

#

oh wait Just saw weebhooks

#

lol

#

Im out

uncut slate
#

a discord api lib isn't exactly "easy to code"

#

not if you want 100% coverage

frigid sierra
#

yeah my discord api lib wasnt easy lol

#

but the dbl api was pretty easy

uncut slate
#

ye

frigid sierra
#

was only like a 3-4 hour project

west raptor
#
(node:7162) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 11): TypeError: bot.destory is not a function
``` what did i do wrong?
dapper moon
#

its saying it. bot.destroy is not a function

#

aka it doesn't need destroy() or something

floral stone
#

it means destroy isn't a function in bot

#

@west raptor is bot defined

west raptor
#

yes

floral stone
#

show code

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

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

  if(!message.author.id == "257521982021566464") return message.reply("No.");
  
  message.channel.send("Restarting... !")
  .then(msg => bot.destory())
  .then(() => bot.login(process.env.TOKEN));
  
}

module.exports.help = {
    name: "restart"
}
#

its in a command handler bot is defined in index.js

#

@floral stone

dapper moon
#

thats not gonna work

#

is your bot running in pm2?

inner jewel
#

destory

#

typo

floral stone
#

that's not the problem

dapper moon
#

use process.exit()

floral stone
#

destory

dapper moon
#

if the bots in pm2 it'll auto restart, otherwise it'll shut it off

floral stone
#

how did i not see that

west raptor
#

lemme try now

earnest phoenix
#

also why not just () instead of msg

dapper moon
#

also i have an issue myself: how do i change my git thing? in vsc, the source control/git push won't work since its logged into an old account, how do i change it to my new account?

west raptor
#

no error

#

its all good

#

thanks

earnest phoenix
#

git config --global --unset-all quick google

#

then add the new one

#

by the same way you did last time

dapper moon
#

i can't remember how i did ._.

earnest phoenix
#

well remove the current user first by that

dapper moon
#

ok

earnest phoenix
#

git config --global user.name name here

#

git config --global user.email email here

#

then them

dapper moon
#

ty

earnest phoenix
#

also if you want to check if that you set, google it

dapper moon
#

i will

#

also for a command handler would something like this work for a command file?

module.exports = {
    help: = {
        name: 'command',
        description: 'command desc',
        usage: 'xxx'
    },
    execute: async (msg, args) = {
        // code
    },
};

trying to make my own

earnest phoenix
#

remove that equal sign and should work

#

and it be async (msg, args) =>

trim plinth
#

^

dapper moon
#

okay, so no = for help

trim plinth
#

and make the = in execute an arrow function

earnest phoenix
#

ye

dapper moon
#

okay

#

@earnest phoenix btw the git config --global --unset-all code isn't working ;-;

earnest phoenix
#

hmm

#

with user.email

dapper moon
#

ok

#

don't i need to give it a password or something as well?

earnest phoenix
#

no

#

it’s like a dummy account which commits to your repo with that set name and email but it isn’t your real account

dapper moon
#

oh

#

the error i keep getting is access to imalexok/project bot denied for use <my old account username>

#

even tho i set the new username and email

earnest phoenix
#

refresh console?

dapper moon
#

this is in vsc

#

.>

#

@earnest phoenix any idea..? ^^

shy verge
#

reclone and try again

#

tends to magically fix everything

#

also git cli > *

dapper moon
#

ok

#

f*ck. same error @earnest phoenix

#

nothing is working

west raptor
#

so

#

anyone can restart my bot

#
if(!message.author.id == "257521982021566464") return message.reply("No.");
#

what did i do wrong

dapper moon
#
if (message.author.id !== "257521982021566464") return message.reply("No.");
#

wrong way around for the code

west raptor
#

thanks

#

ill try it

#

it worked

#

thanks

#

im so tired

dapper moon
#

np

earnest phoenix
#

How would I send a message from one guild to another

low rivet
#

lib?

dapper moon
#

i'm not too good with maths ._.

earnest phoenix
#

It should

#

@low rivet d.js

dapper moon
#

@earnest phoenix

const channel = client.guilds.get('guild id').channels.get('channel id');
channel.send('your content here');
#

also ty

earnest phoenix
#

Np

shy verge
#

aowierubvapowiyuvubepwieubvapwiuvbpao9uwbhgr[O9UWRBJGB[p923b7bp-29b73GBP9w8ebuguuipbp97gp9GP-98G4HB93APW[84WBGHA[P98WGB9[P8890hbep[s9eg4

#

have a password

dapper moon
#

https://hastebin.com/amebiharuk.js this works ok but at the end of the 2nd song aka the end of the queue the "queue ended i'll leave now etc etc.." msg doesn't send, and it doesn't leave the voice channel. why? 😦

gilded thunder
#

Does anyone know how to get user information in JSON format on steams API?

zealous hazel
#

help me for javascript please 😟

#

i am noob

quiet bobcat
#

"Do not ask to ask. Provide all possible information so people know what's up. Just saying "I get an error" doesn't give us enough information on your problem."

native narwhal
#

So I made this very advanced problem solving algorithm and whenever I run it I get an error mmLol

earnest phoenix
#
async def pat(self, ctx, user : discord.Member):

How do i make it so that user is not a required argument?
If i do *user its not required but then it loses it's object

slender thistle
#

user: discord.Member = None? 🤷

earnest phoenix
#

That seemed to do the trick, Thanks @slender thistle

slender thistle
#

👌

hazy marten
#

yo

#

so I used discord.ext.commands.errors.CommandNotFound

#

but

#

its not working

#

like I did

#
                            await bot.process_commands(message)
                        except discord.ext.commands.errors.CommandNotFound:
                            await bot.send_message(message.channel, ":exclamation:Command Not Found")
#

wait

knotty steeple
#

gotta remove those unknown command messages man

slender thistle
#

Do you use them under async def on_command_error event?

hazy marten
#

wow

#

never knew that existed

#

ok ty

#

its an event right

ruby dust
#

when I told you to try to not send unknown command errors, I didn't mean switching from logging in console to posting in a channel facepalm

upper ember
#

how do I mention role? thinkEyes

ruby dust
#

<@&265125253443878912>

#

you mean like this?

upper ember
#

yes

ruby dust
#

<@&265125253443878912>

#

you gotta get the role's id first

knotty steeple
#

how did that not ping anyone

ruby dust
#

because role is not meant to be pingable?

knotty steeple
#

makes sense

upper ember
#

LukiBOT - Today at 2:24 PM
Help needed in MrSheldon's Hub

Invite --> INVITE_LINK_WAS_HERE
ID --> 339085367770611713

@deleted-role

#

this is the message I get

#

when I did it without the &

#

@ruby dust

#

I have this role and he is pingable

ruby dust
#

@& is for mentioning a role specifically, and a deleted role most likelly means that the role doesn't exist

knotty steeple
#

the & means role

upper ember
#

the role is exists

ruby dust
#

it happens when a previously mentioned role was deleted

knotty steeple
#

just like how # means a channel

ruby dust
#

try to post my string in here

upper ember
knotty steeple
#

noo

#

without the @

ruby dust
#

with

knotty steeple
#

but like

ruby dust
knotty steeple
#

ok thats weird then

upper ember
#

just for the record, it doesn't work without it

ruby dust
#

if I did it, why am I incorrect?

#

idk

#

now what's left is to doubt if your role actually exists or not

knotty steeple
#

or is it pingable

upper ember
ruby dust
#

oh wait, how exactly did you get the role's id?

upper ember
#

what....?

knotty steeple
#

is that even an id of a role

ruby dust
#

rightclicking on the mentioned role doesn't work, that way you copy the message's id

upper ember
#

right click --> copy id @ruby dust

slender thistle
#

That copies the message ID.

upper ember
#

seriously...?

ruby dust
#

do like I did in the screenshot

upper ember
#

javascript please

native narwhal
#

<@&265125253443878912>

#

What is it that doesn't work?

ruby dust
#

he tries to copy the role id, I assume

native narwhal
#

<@&265125253443878912>

#

Yeah you can't copy the id for some reason

#

🤔

upper ember
#

well

ruby dust
#

not "for some reason"...

upper ember
#

doesn't work also with role id

native narwhal
#

What is the reason

ruby dust
#

maybe because it's not a role id?

upper ember
#

it is

ruby dust
#

you've been copying the message id all this time

upper ember
#

used bot command

#

for get the role id

native narwhal
#

I meant, you can't right click and copy the role id for some reason

#

It copies the message id instead of the role id

ruby dust
#

that actually makes sense

native narwhal
#

Why though

upper ember
#

nvm

#

it works

ruby dust
#

cause you can't click on the role mention just like on user mention?

upper ember
#

used this command

native narwhal
#

Well the role mention is just the id underneath so I don't see why wouldn't be able to

ruby dust
#

because that way you'll be able to click on everyone and here mentions?

#

which isn't what I'd want to do

native narwhal
#

I don't see how that has much to do with this

ruby dust
#

¯_(ツ)_/¯

#

open your eyes wider

native narwhal
#

Boi

#

A role mention is just <@&265125253443878912> parsed in to <@&265125253443878912> on the client so I don't see why you would not be able to right click and copy it

ruby dust
#

sometimes you'd have to stop and think why some features is best to not be implemented, and I'm sad seing how people can't understand that

native narwhal
#

Explain how a feature to copy the role id is "best to not be implemented" and don't bring up everyone and here because those two are irrelevant to this

ruby dust
#

it's not about "how it can be abused" or something, but it's just unnecessary... you expect to be able to do literally anything on discord and that's why it brings you to these questions

native narwhal
#

Why is unnecessary? It doesn't make any sense. It's as necessary as to have the ability to copy user ids

#

Well at this point it is an opinion based matter so I am just gonna leave this argument here

gilded thunder
#

What's the problem with this?

Traceback (most recent call last):
  File "bot.py", line 18, in <module>
    data = json.load(data_file)
  File "/usr/local/lib/python3.6/json/__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.6/json/decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 6 column 2 (char 136)
root@joshek:~/Arc# ```
#

The JSON file is

[
    {
        "Token": "yeet",
        "Prefix": "arc!",
     "Owner": "372931332239654912",
    }
]```
#

Spacing is correct, just broke in the codeblock.

native narwhal
#

It's the comma at the end of Owner

gilded thunder
#
Traceback (most recent call last):
  File "bot.py", line 18, in <module>
    data = json.load(data_file)
  File "/usr/local/lib/python3.6/json/__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.6/json/decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 6 column 2 (char 136)
root@joshek:~/Arc# ```
native narwhal
#

?

gilded thunder
#

That's the error now, same thing.

native narwhal
#

What does the json look like now

gilded thunder
#
[
    {
        "Token": "no token",
        "Prefix": "arc!",
     "Owner": "372931332239654912"
    }
]```
native narwhal
#

What if you try to replace the " with '

hazy marten
#

yo guys

#

I have no clue

#

what to do

#

with command errors

gilded thunder
#

Same error.

hazy marten
#

all I found

#
@bot.event
async def on_command_error(self, message, error):
#

was this

#

what do I write for command not found?

gilded thunder
#
await bot.say("An error has occured.")```?
native narwhal
#

It's supposed to have " but why does it not work 🤔

#

Unless it's a problem with the code and not the json

gilded thunder
#

This is how I call the token one
bot.run(config["Token"])

hazy marten
#

hmm

native narwhal
#

And how is config loaded

gilded thunder
#
    data = json.load(data_file)```
#

That's line 18 too.

native narwhal
#

Weird

#

Do you have notepad++?

gilded thunder
#

I use VS Code.

native narwhal
#

But do you have it?

gilded thunder
#

Don't have it installed/

native narwhal
#

Fak

#

Can you see the encoding of the file somehow?

#

(The json file)

gilded thunder
#

UTF-8

native narwhal
#

The file might be UTF-8 BOM and in that case it would be a hidden character at the beginning of the file

#

Try to change the format and see if that works

gilded thunder
#

How would I do that?

native narwhal
#

?

#

You could probably just make a new file and then copy paste everything in to it

#

The only thing is that if it was a UTF-8 BOM file the error would have been different 🤔

gilded thunder
#

I'm trying different ways of loading it.

native narwhal
#

What about the data you're storing, do you have any quotes or anything in it?

gilded thunder
#

Yeah, I posted the JSON before.

native narwhal
#

Like I mean the actual data (What is inside the quotes), so probably only the token then since everything else is displayed there

gilded thunder
#

Prefix, token and owners ID.

native narwhal
#

Does the token have any quotes in it?

gilded thunder
#

Nope.

native narwhal
#

I really don't see a problem with it then

hazy marten
#

duuude

#

T_T

#

I don't understandd

native narwhal
gilded thunder
#

hmmm

low rivet
#

why place it in an array?

gilded thunder
#

How else?

native narwhal
#
{
    "Token": "no token",
    "Prefix": "arc!",
    "Owner": "372931332239654912"
}```
quasi marsh
#

Try json.loads perhaps

gilded thunder
#
Traceback (most recent call last):
  File "bot.py", line 18, in <module>
    json_data = json.loads(json_file)
  File "/usr/local/lib/python3.6/json/__init__.py", line 348, in loads
    'not {!r}'.format(s.__class__.__name__))
TypeError: the JSON object must be str, bytes or bytearray, not 'TextIOWrapper'
root@joshek:~/Arc# ```
slender thistle
#

@hazy marten

@bot.event
async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandNotFound):
        await bot.say('There is no such command!')
#

Hope hat helps you.

hazy marten
#

ok wait

#

let me try it out

#

its not saying anything

#

its not raising an error

#

but its not saying anything

#

hmmm

slender thistle
#

Huh.

#

await bot.say(ctx.message.channel, 'There is no such command!')?

hazy marten
#

isnt it bot.send_message

#

?

slender thistle
#

Whoops.

#

Yeah.

hazy marten
#

still nothing tho

slender thistle
#

Eh. 🤷

#

No idea, then.

hazy marten
#

:/

#

@slender thistle so I took off the if instance

#

and I put

#

yea

#

I just ook out that line

#

and I get this

#

AttributeError: 'CommandNotFound' object has no attribute 'message'

#

await bot.send_message(ctx.message.channel, 'There is no such command!')

slender thistle
#

await bot.say('There is no such command!') Thonk

hazy marten
#

discord.errors.InvalidArgument: Destination must be Channel, PrivateChannel, User, or Object. Received NoneType

#

xD

#

@slender thistle

slender thistle
#

Huh.

#

await bot.send_message(ctx, 'There is no such command!)?

hazy marten
#

raise InvalidArgument(fmt.format(destination))
discord.errors.InvalidArgument: Destination must be Channel, PrivateChannel, User, or Object. Received CommandNotFound

#

DOOOOOOD

#

I GOT IT

#

I just put a global

#

in on_message

#

and did

#

x = message.channel

#

and then i just did

#

await bot.send_message(x , "There is no such command!")

#

@slender thistle thank you man

#

or woman

#

😮

slender thistle
#

"Man", it is.

#

You are welcome.

#

😄

hazy marten
#

😄

#

now to specify

#

thats it command not found

#

xD

slender thistle
hazy marten
#

yea screw that

#

cba finding whats wrong

slender thistle
#

Wait

#

Send me the whole on_message thing.

hazy marten
#

the whole on_message???

#

global messagechannelmessagechannel = message.channel

#
global messagechannel
messagechannel = message.channel
#

my whole on message command is way toooo long

#

xD

#

you don't wanna see it

#

like whats in it

slender thistle
#

on_command is uh... unrelated to CommandNotFound error. thanking

hazy marten
#

I think it goes to it

#

when there is an error

#

and then you have to compare the error

#

so

#

if isinstance error == commands.CommandNotFound):
await bot.say('There is no such command!')

#

something like

#

that

#

but im unsure

#

if its like that

#

but thats like

#

my logical thoguh?

#

thought*?

slender thistle
#
if isinstance(error, commands.CommandNotFound):
        await bot.say('There is no such command!')```
hazy marten
#

exception discord.ext.commands.CommandNotFound(message=None, *args)¶

slender thistle
#

I am using rewrite and...

        elif isinstance(error, commands.CommandNotFound):
            if ctx.guild == 264445053596991498:
                pass
            else:
                await ctx.send('This command does not exist.')
``` works.
hazy marten
#
@bot.event
async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandNotFound):
        await bot.send_message(messagechannel, ":exclamation: Please Review Your Statement")
#

ctx.send?

#

nope

slender thistle
#

Don't mind me. I am using another version of library.

hazy marten
#

What

slender thistle
#

Doing await bot.send_message(ctx, ":exclamation: Please Review Your Statement") doesn't work, does it?

hazy marten
#

I dont think its going through the ifinstance

#

because nothing is popping up

slender thistle
#

It works like that for me.

hazy marten
#

no errors

#

but no output

#

xD

slender thistle
#

await bot.send_message(ctx.message.channel, ":exclamation: Please Review Your Statement")?

ruby dust
#

one question, why do you want your bot to send command not found error messages? if thinking about user-friendlyness, there is a high chance that a server will be having more than one bot with the same prefix as yours, so you are clearly making a server be spammed with that crap, plus your bot is already muted for responding to bots, and you are just making another reason to keep it muted here Thonk

#

if at this point you just want to get rid of your console be spammed with command not found errors, swapping this spam to a discord chat is not the best idea

hazy marten
#

I was told

#

that it was good

#

to do so

#

good practise

#

wait

#

lemme find the message

ruby dust
#

yeah it's no problem, but it's not the best practice

hazy marten
#

Oh

#

my god

#

you said isn't

#

I'm blind

#

and it was you

#

ahahaha

#

xD

#

rip

#

thank youu, cuz I hate error checking

ruby dust
#

I'll give you a link where best practices are listed

hazy marten
#

okay

ruby dust
hazy marten
#

thank you

#

yo @ruby dust bots like pokecord, have a gift system for people who vote for their bots. How does the bot, recognize how it has voted?

lament meteor
#

Dbl webhooks

hazy marten
#

webho- ok nvm

native narwhal
lament meteor
#

That also works

#

But @native narwhal ratelimits

native narwhal
#

What are the limits for that

lament meteor
#

60/60 iirc

native narwhal
#

Should be fine for small bots

hazy marten
#

whats considered small

#

the user base?

native narwhal
#

Server count

hazy marten
#

oh

#

uhhh

#

ok

#

so if it increases

#

I have to change to webhooks

native narwhal
#

Well the more users you have the more they are going to use the commands (and with servers comes users)

ruby dust
#

you have to use webhooks if your bot gets to getting over 1000 monthly votes iirc

native narwhal
hazy marten
#

oh ok

native narwhal
#

What I sent does not have such limitations

hazy marten
#

btw how much does an average server cost (SQL)

ruby dust
#

you mean a vps?

hazy marten
#

Virtual Private Servers?

#

Well I don't know much about like SQL

#

I know SQLite3

#

a bit

#

of it

#

so enlighten me

ruby dust
#

sql is a database, not a server Thonk

hazy marten
#

because if my bot gets more people, I think I would have to move to like an online server

#

where it an host the database

#

it is an*

#

that doesnt make sense

#

where it can host the database*

ruby dust
#

you don't have to be so specific about "hosting databases", it's just a file that contains data

#

a vps is most likelly what you are asking for

hazy marten
#

online and doesn't peg the RAM?

#

interesting ok

ruby dust
#

I would recommend skysilk

#

they are in free beta with 100% discount, and will have a free plan later when beta will be closed

hazy marten
#

thanks ❤

hazy marten
#

test

buoyant oak
#

class dbl.Client(bot, token, **kwargs)

#

bot – An instance of a discord.py Bot or Client object

#

what does it take

#

because I get this

#

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000018DD32B3668>

#

and I'm unsure what's the problem

#

@ruby dust

ruby dust
#

is this dbl api?

buoyant oak
#

yea

ruby dust
#

I don't really use dbl lib, I use aiohttp requests

buoyant oak
#

what does unclosed client session mean

ruby dust
#

you didn't close the session, I assume

buoyant oak
#

await bot.change_presence(game=discord.Game(name='With Governments'))
token = '#############' # set this to your DBL token
dblpy = dbl.Client(bot, token)

#

ohhhhhh

#

ok

#

how do i dothat

#

xD

ruby dust
#

in my case I have session defined as aiohttp.ClientSession(), so it'd be await session.close()

buoyant oak
#

it says

#

**session (Optional) – The aiohttp session to use for requests to the API.

#

whats the purpose of aiohttp

ruby dust
#

it's a python module

buoyant oak
#

yea i know that, but what's its primary function

ruby dust
#

http requests

#

¯_(ツ)_/¯

buoyant oak
#

xD

#

okay...

ruby dust
#

are you using dbl lib?

buoyant oak
#

yea

#

I'm just slightly confused

#

I can't find examples of its usage

fluid basin
#

?

ruby dust
#

that channel teaches how to use aiohttp

#

not dbl lib

fluid basin
#

Ohrip

#

Well I guess on the dbl docs they should tell you how

ruby dust
#

honestly, why is the lib even needed? it's like it's so hard to post server count directly to the api

buoyant oak
#

xD

ruby dust
#
while True:
    url = 'https://discordbots.org/api/bots/stats'
    headers = {'Authorization': 'CENSORED'}
    payload = {'server_count': len(bot.guilds)}
    async with aiohttp.ClientSession() as session:
        async with session.post(url, data = payload, headers = headers) as r:
            if r.status == 200:
                await session.close()
    await asyncio.sleep(1800)
#

that's how I have mine

slim heart
#

how would i set a channel to nsfw

#

.js

ruby dust
#

have you checked docs?

slim heart
#

channel.edit({ nsfw: 'true' })
?

#

im just makin sure

buoyant oak
#

huh

slim heart
#

i have

buoyant oak
#

198466968725094400

#

415570038175825930

#

wait no

#

how do you get it specifically for your bot?

ruby dust
#

what

#

you want to use my code for your bot?

buoyant oak
#

...

#

I would like to educate, and enlighten myself through the code provided, after which I would assimilate code to fulfill my requirements

#

inshort, maybe

#

I mean it looks simple

ruby dust
#

but it's a bit outdated and it's not really the best idea to update server count on guild join/leave if it's happening a lot

#

since it will spam dbl's api

buoyant oak
#

just when info is called

#

like

ruby dust
#

instead you should have an own loop with a fixed interval

buoyant oak
#

-info

#

is that possible

ruby dust
#

you want to post server count with a command?

buoyant oak
#

ye

#

wait

#

what do you mean posting server count

ruby dust
#

I'm not sure what you want anymore...

west raptor
#
const server = servers[message.guild.id];
      
        server.gueue.push(args[1]);

        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();
        });
    }

    if (!args[1]) return message.reply("Link please!");
    

    if (!message.member.voiceChannel) return message.reply("You are not in a voice channel!");

    if(!servers[message.guild.id]) servers[message.guild.id] = {
        gueue: []
    };

    const server = servers[message.guild.id];
``` not even getting an error
#

says "Link please!"

#

even though i did

topaz fjord
#

<prefix>play this is a test message

#

args[1] would be is

#

@west raptor

#

try args[0]

west raptor
#

ok

native narwhal
#

I mean it all depends on how the args are made

topaz fjord
#

arrays start at 0 in js

west raptor
#

still says "Link please!"

topaz fjord
#

did you try console.log(args[0])

#

to see if its actually there

west raptor
#

undefined

topaz fjord
#

console.log args itself

west raptor
#

[]

#

@topaz fjord

buoyant oak
#

test

earnest phoenix
#

👀

#

thats my code

#

Im pretty sure its suppost to work :/