#development

1 messages · Page 456 of 1

sick cloud
#

@median olive to get that, your bot has to be in this server

#

posting to the api doesn't update your status iirc

slim heart
#

(waps sowwy i am dum boi lol)

median olive
#

(yeah, I didn't see an endpoint for it or anything in the docs lol)

slim heart
#

(shh 😉)

median olive
#

@sick cloud - is there a reason my bot would be approved but not in the channel?

sick cloud
#

probably kicked, check #mod-logs with your bots id or name

earnest phoenix
#

simple question how do i get my bot username and tag using eris

#

i gave a quick look over the docs but didnt find it

#

im either blind or its well hidden

#

bot.user is a User. that has username, discriminator, avatar, etc

#

so

#

bot.user.username ?

#

k

deep pebble
#

Hello

#

My bot got muted because it responded to another bot

#

I have fixed this issue in its code

#

Could I get it unmuted please?

median olive
#

ah, looks like my bot was kicked due to DMs on guild join. That functionality has been removed, is there a way to get the bot re-added?

sick cloud
#

dm an available mod or the mod that kicked it

#

same with you @deep pebble

deep pebble
#

Thanks @sick cloud

sick cloud
#

np

feral storm
#

http://bit.ly/2Lwxt5H

do i need to change anything here in order for the webhook to post in a specific channel? or would that go on the DBL Bot Edit section?

sick cloud
#

looks like thats posting into a database?

feral storm
#

i want it to post to a channel when someone votes..

#

@sick cloud

gilded blaze
#

You have to communicate with the bot to send the message.

sick cloud
#

I don't work with PHP so dunno

spring ember
#

It should work

#

As I can see at least

earnest phoenix
#

LOL PHP

rain orbit
#

is it possible to change the text color when using canvas-constructor?

sick cloud
#

yeah, it is

#

gimme a sec

rain orbit
#

mk

#

ty

dull breach
#

@rain orbit lol google

rain orbit
#

i did

#

lol

dull breach
#

and wtf why everyone use canvas constructor

rain orbit
#

bc y not?

#

idk

dull breach
#

this i made with pure canvas

rain orbit
#

cool

dull breach
#

just a perfect copy of MEE6

#

👌

rain orbit
#

lol

fossil oxide
#

@dull breach can I look at your canvas code, out of interest

dull breach
#

@gilded plank botinfo @frosty flax

gilded plankBOT
#
Bot info
ID

464747957288435732

Username

expoBot

Discriminator

1211

Short Description

Just a bot that you need.

Library

discord.js

Prefix

Upvotes

12

Server Count

11 Servers

Owner(s)

@dull breach

dull breach
#

check git

fossil oxide
#

Thanks friend

dull breach
#

ill rewrite it soon

rugged pond
#

Did you think that bot can use animated emoji ? like a Nitro ?

quiet bobcat
#

bots can use animated emojis

earnest phoenix
#

Owo

dull breach
#

do i can use gif avatar? without nitro

stiff condor
#

No

dull breach
#

:(

earnest phoenix
#

ikr

#

i wish

#

😭

dull breach
#

but animated emoji

earnest phoenix
#

@discordapp boi

#

wait

#

nitro bot owners should get nitro gif avatars for bots

dull breach
#

oh

earnest phoenix
#

no

#

im saying

#

thats how it should be

dull breach
#

btw i won't buy nitro

earnest phoenix
#

lol

#

ive had it

#

it costs nothing

heady zinc
#

no, how it should be is that you should have an option to pay nitro for a bot account

earnest phoenix
#

no

#

thats retarded

heady zinc
#

that's the best way for discord to make MOAR MONEY

earnest phoenix
#

yeah

#

but if that becomes a thing /r/assholedesign/

dull breach
#

it costs nothing
haha

heady zinc
#

i mean no

dull breach
#

i live in Russia

heady zinc
#

honestly i wouldn't mind that at all

#

if it can help them pay better servers

dull breach
#

i havent so much money

earnest phoenix
#

yes but per bot account

heady zinc
#

or fix their broken api

earnest phoenix
#

you dont even get to use it

heady zinc
#

whatever's broken in their shit

earnest phoenix
#

discords gay ass crashes

heady zinc
#

if paying 5$/month per bot reduce discord's ridiculous amount of crashes by even 1%

#

i'd pay

earnest phoenix
#

lol

#

id maybe pay for a really good bot

#

not some shit bot i have listed here i dont care about

#

lol

heady zinc
#

why do you list them if you don't care about them

earnest phoenix
#

idk

tribal turtle
#

@gilded plank botinfo @finite plank

gilded plankBOT
#
Bot info
ID

412716344161730560

Username

Pizza-Chef

Discriminator

1046

Short Description

Fortnite stats, ban kick and much more!

Library

discord.js

Prefix

$

Upvotes

2

Server Count

No server count

Owner(s)

@tribal turtle

quiet bobcat
dull breach
#

hell yeah made a color system for rank card on my phone

#

e[rank

#

yeah wait

gilded thunder
#
# modlog
@bot.event
async def on_message_delete(message):
    if logdb.contains(Users.server == ctx.message.server.id):
        ```
This is my current code using TinyDB and Discord.py, how can I get the channel ID and store it as a variable?
#

It already checks for the server if it's been allowed to modlog but I don't know how to get it to read my channel var.

#

This is the DB layout.

[{'server': '264445053596991498', 'channel': '265156361791209475', 'log': True}]```
quartz kindle
#

get the channel from the database?

gilded thunder
#

That's my question.

#

I can't find a method in the TinyDB docs

quartz kindle
#

idk how tinydb works, but in rdbs such as mysql you need to extract the column from the row, for example (pseudocode) GET channel WERE server === server.id

gilded thunder
#

Okay, I'll try that logic then.

quartz kindle
#

if Users is your db table

gilded thunder
#

It's logdb, Users is to query it

quartz kindle
#

then you need to get channel from the row where Users.server == server.id

gilded thunder
#

I just have that as the generic Query() var

#

Okay, thanks

quartz kindle
#

ah i see, but you need to check what's the proper syntax for tinydb

gilded thunder
#

Yeah, I'll look into it now

#

That seems pretty accurate of it though

quartz kindle
#

i took a look at the docs, it seems its a json database, then your approach should work. the database returns the entire row

#

then you get the channel from the row, just like you would get any property from an object

gilded thunder
#

yeah, doing db.search returns the whole line

remote badge
#

Hi, I maked image generation command but I have to set a timer before the image send, 2s work fine but when the bot is very used, these 2s are too low and i have to set it around 7-8s but it's too long.
If I just set a delay it's because without it, on big images, it will try to send the image before it's generated.

I've tried to use an : await message.channel.send but it just don't change anything

#

if someone can help me, it will be very nice

#

using Jimp in node js if i'ts important

hearty talon
earnest phoenix
#

gRole is undefined because it cant find a role with the name, probably because it doesnt exist/you are using .find with the wrong name.

#

console.log(role) and see what it is when you use the command "correctly"

hearty talon
#

okie

earnest phoenix
#

Also , if the usage is "Usage: !addrole <user> <role>", the role name would be args[1], right? So why are you doing:

let role = args.join(" ").slice(22);

That magic number 22 is probably where you issue stems from.

hearty talon
#

ive changed the number multiple times

#

¯_(ツ)_/¯

earnest phoenix
#

yeah and it makes no sense, use args[1] and just print the role variable to see what it is.

hearty talon
#

doing that rn

#

wtf console.log(role); fixed the issue

earnest phoenix
#

did you switch to using args[1]?

hearty talon
#

i didnt change anything

#

but adding console.log(role);

earnest phoenix
hearty talon
#

clueless

#

either way thank you

remote badge
#

uh what is wrong with that plz ?

var i = false ;
while (i == true)  {

try {
const copie = new Discord.Attachment(file);
          message.channel.send(copie)
            i = false;
} catch(e) {
console.log("One error, retrying")
   }
}

The image file take time to be created so, I tried that but il stay on the catch to infinite even if the file is ready (and then ,it have to work with the try)

quiet bobcat
#

console log the error?

#

instead of just saying that there was an error

remote badge
#

hum i normally never have undefined channel problem

shy flicker
#

why are you doing .then.then instead of .then ??

remote badge
#

no it's not a .then.then just have that :

Promise.all(jimps).then(function (data) { return Promise.all(jimps); }).then(function (data) {
        data[1].resize(155, 155)
        Jimp.loadFont(Jimp.FONT_SANS_16_BLACK).then(function (font) {
          data[0].composite(data[1], 25, 70)
            .print(font, 55, 235, toto)
            .write(wanteduser);
remote badge
#

I tried something else but the loop and the catch won't work, this is all the code :

if (msg == ("WANTED")) {
      var wanteduser = sender.username + ".png"
      var imagesT = ['./images/Base/petit.png', sender.displayAvatarURL], jimps = [], mise = Math.floor((Math.random() * 1000000000)).toLocaleString(), toto = mise + " $"
      for (var i = 0; i < imagesT.length; i++)  jimps.push(jimp.read(imagesT[i]))

      Promise.all(jimps).then(function (data) { return Promise.all(jimps); }).then(function (data) {
        data[1].resize(155, 155)
        Jimp.loadFont(Jimp.FONT_SANS_16_BLACK).then(function (font) {
          data[0].composite(data[1], 25, 70)
            .print(font, 55, 235, toto)
            .write(wanteduser);
        })
      })

      var compt = false;
      while (compt != true) {
        try {
          const copie = new Discord.Attachment(wanteduser);
          message.channel.send(copie);
          compt = true;
        } catch(e) { console.log("erreur") }
      }
    } ```
#

In the catch, I can say it to just write "erreur" in the console but it will not do it, it will just that it don't find the file (that is created around 2s after the error) and it will stop there, the loop will not restart

earnest phoenix
#

how do i make a say command can i get some help

remote badge
#

The aim of the loop and the try catch is for wait for the image generation, I've tried use await but don't have results too (maybe because I don't know how to use it in my case but i've put an await at the const copie = await Discord.attachment....
and an await message.channel.send but it wont't worked

earnest phoenix
#

my bot is in javascript

remote badge
#

just slice it after your first space

#

@earnest phoenix

earnest phoenix
#

yes

#

what do you need you say my name

slender thistle
#

Is msg an object?

#

Aight nvm I am bad at js

earnest phoenix
#

i think this is my 1st time doing js

#

i mosty watched youtube vids on how to do this but i cant find how to make a say command

remote badge
#

just said you what you have to do atomic, read what ive said

#

split it by space, slice it and join it by space

#

you do that to the message.content

earnest phoenix
#

ok

#

thx

remote badge
remote badge
#

Hmm, nobody seems to find either, not bad I'll put abandoned the idea for the moment, bye ^^

mystic stirrup
#

I'm trying to update my bot's server_count, but I'm getting this error:
aiohttp.errors.ClientOSError: [Errno 101] Cannot connect to host discordbots.org:443 ssl:True [Can not connect to discordbots.org:443 [Network is unreachable]]
I'm using discord.py
Anyone know what might be up?

#

Relevant code snippet:

import aiohttp

dbl_token = ""
with io.open("tokens/lmao-dbl.txt", "r") as token:
    dbl_token = (token.read())[:-1]
dbl_url = "https://discordbots.org/api/bots/459432854821142529/stats"
dbl_headers = {"Authorization" : dbl_token}

@bot.event
async def on_ready(): 
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
        await aioclient.post(dbl_url, data=payload, headers=dbl_headers)

Never mind, I fixed it by adding dbl_connector = aiohttp.TCPConnector(family=socket.AF_INET,verify_ssl=False) and adding the kwarg connector=dbl_connector to aiohttp.ClientSession()

earnest phoenix
#

How would i pin a message with discord.js
I've looked at the docs but can't get it to work

vernal crow
#

@glossy talon You’ll get better information at #topgg-api but it involves webhooks

gilded blaze
#

@earnest phoenix What error are you getting?

earnest phoenix
#

I just don't know the function.

#

So just the not a function error.

gilded blaze
#

Use the pin method of a message object

sick cloud
#

@earnest phoenix you shouldn't start with bots, learn some basic node.js first.

jovial sigil
#

Is commando necessary for making a DB connection to sqlite? Or in other words does it make working with a DB easier? If not what other tools can I use with discord js to do that?
Any suggestions?

zealous veldt
#

Try to module that commando uses to connect

jovial sigil
#

Do you mean SyncSQLiteProvider?

zealous veldt
#

I don't know much about commando or sqlite, haven't used either. I use Mongo and a custom command handler

jovial sigil
#

I don't want to just use sqlite for putting guild settings

#

Ah okay

#

I'll keep searching

zealous veldt
#

I recommend rethink if you're starting out with database stuff, it's easy and quick

#

Mongo if you're more advanced

#

The era is SQL is coming to an end

jovial sigil
#

I've worked with databases before, just not much practice with connecting to a DB using node js/discord js
I'll check out mongo.

sick cloud
#

honestly you'd just connect it like any other application

zealous veldt
#

Mongo is dope

jovial sigil
#

@sick cloud I'm more asking for like syntax or correct use, etc.. or like a package that makes working with DBs easier

sick cloud
#

well

zealous veldt
#

With sql or mongo?

sick cloud
#

it depends on what db your using lol

#

dbs like rethink have rethinkdbdash for example

zealous veldt
#

Is you use mongo I recommend Mongoose

jovial sigil
#

I haven't chosen a DB yet

#

So I'll look into those dbs

#

Thank you guys

zealous veldt
#

Glad to help :)

earnest phoenix
zealous veldt
#

What's the error? You're going to need to give us more info

earnest phoenix
#

If I had erros I would supply them

#

It just doesn't send out anything

#

no errors

#

or an embed

quartz kindle
#

place a bunch of console.log() at key points and watch the data flow

earnest phoenix
#

Idk what to console log to even get the data :/

#

I tried console logging things

#

Nothing is happening

jovial sigil
#

That probably means that your code isn't reaching there

earnest phoenix
#

ok

quartz kindle
#

how are you console.logging?

earnest phoenix
#

I sis

#

did*

#

console.log(price) under where price was defined

topaz fjord
#

Anyone here use the jovo framework

app.setHandler({
    'LAUNCH': function() {
        this.toIntent('HelloIntent')
    },

    'HelloIntent': function() {
        this.ask('Hello, ask my anything!');
    },

    'Gas': function(type, place) {
        if (!this.googleAction().isPermissionGranted()) {
            this.googleAction().askForPreciseLocation('Sorry, you need to give me access to your location to use this action!');
            return;
        }

        console.log(type)
        console.log(place)
        this.ask('ok')
    },

    'ON_PERMISSION': function() {
        if (requestUser.permissions.indexOf('DEVICE_PRECISE_LOCATION') > -1) {
            let device = this.googleAction().getRequest().getDevice();
            console.log(device);
            this.tell('Thanks for your precise location');
        }    
    }
});

ive been trying this to get the users location for google assistant
it tells me this when i type the trigger for Gas
"Sorry, you need to give me access to your location to use this action!, I'll just need to get your street address from Google. Is that ok?"
i dont understand how the user is supposed to accept
whenever i type in "yes" it goes to the fallback intent and not ON_PERMISSION

earnest phoenix
#

Hmmm

#

What does that even do

#

it looks fishy

topaz fjord
#

It's for a Google assistant action

earnest phoenix
#

So it is asking for their location?

topaz fjord
#

In the gas part yes

earnest phoenix
#

Seems fishy

topaz fjord
#

But I don't see any place or way to confirm

#

Many Google assistant actions require your location

#

That's how they do the near me

earnest phoenix
#

Ik

#

But still

#

in a bot

topaz fjord
#

It's not for discord

earnest phoenix
#

why not just look it up on your phone

topaz fjord
#

It's for something else

earnest phoenix
#

ok

#

what are you making?

topaz fjord
#

A Google assistant action

earnest phoenix
#

oh nice

sick cloud
#

"Channel for chatting about bot development." @topaz fjord

#

from the channel topic

topaz fjord
#

Fuck

earnest phoenix
#

watch ya profanity

sick cloud
#

@earnest phoenix no need to mini-mod

earnest phoenix
#

....

#

Lmao

#

mini-mod

#

Not my fault I value what little kids hear

#

They shouldn't hear them cuss words

#

bad influence

sick cloud
#

now get out of development if your not going to be talking about bot development

#

some mild profanity is perfectly fine here

earnest phoenix
#

Wow you are a bad influence

#

tsk tsk tsk

sick cloud
#

seriously, out. angeryBOYE

earnest phoenix
#

You are continuing this I left already

#

Cya

viscid falcon
#

how would i go about sending a image using discord.js?

earnest phoenix
#

@viscid falcon you would look at the discord.js docs here:
https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=send

And find the examples:

// Send a remote file
channel.send({
  files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']
})
  .then(console.log)
  .catch(console.error);
// Send a local file
channel.send({
  files: [{
    attachment: 'entire/path/to/file.jpg',
    name: 'file.jpg'
  }]
})
  .then(console.log)
  .catch(console.error);
viscid falcon
#

thank you

viscid falcon
#

why does this keep giving me message.author.setNickname() is not a function?

sick cloud
#

because your trying to set the nickname of a user, not a GuildMember

#

users don't have guild-specific properties

viscid falcon
#

oh duh, thanks

sick cloud
#

np

#

just use <msg>.member

viscid falcon
#

yeah

#

i changed it to message.member.setNickname... but now its giving me a DiscordAPIError: Missing Permsissions

sick cloud
#

the bot has to be above the user role or permission wise to do so

#

and have the manage nicknames permission

viscid falcon
#

oh duh

#

im tired sorry

#

time to get my friend to test it

obtuse wind
#

How would I make my command "serverinfo" display server owner?

earnest phoenix
#

<guild>.owner

#

fuck me im so tired

#

soo many fucking edits

#

but theres your answer

#

Learn simple JS code

#

It makes me cringe at peolle

#

ikr esp when im tired

#

Shouldn’t be making a bit if you don’t how to code simple shit

#

im like do i have to deal with this?

#

Bot*

#

Look at an open source Bot lmfao

#

lol ikr

#

Better than asking someone

#

especially since theres different languages and libraries

sick cloud
#

specifically 7a.

keen drift
#

Dang

#

I can't attack beginners

earnest phoenix
#

oki sry and gnite @sick cloud

sick cloud
#

gn and kek

sick cloud
#

ok so i have this code https://hastebin.com/xixohagoho.js the top part for message edit works but when i pin a message or unpin it doesn't work. no errors, and as you can see i've tried the console log method, it doesn't even get to 1 apparently

#

like, nothing outputs to console

hallow harness
#

if it doesn't go to console.log('1') that means it's returning something before then

#

which means it's reading line 8

 if (msgBefore.content !== msgAfter.content && msgBefore.embeds === msgAfter.embeds && msgBefore.pinned === msgAfter.pinned)
#

as true and going into that if statement and returning the embed there

#

that is what I would assume unless something else is also interfering

#

@sick cloud ^ ?

#

check if your if statement is what you want

fluid basin
#

Yeah that means it triggered the first if statement and returned after that

sick cloud
#

no it can't be @fluid basin @hallow harness because the embed for that if statement never sends

#

its like the event is never fired when the pin happens

hallow harness
#

uuuh

#

have you tried adding a console log inside the if statement?

#

see if that goes or not

#

to confirm whether or not it's entering the if statement

sick cloud
#

i'll try that later

dapper silo
#

hi

#

i want to add guild count to my bot information

#

can someone help me?

shy rose
#

what lib you in?

dapper silo
#

discord.js

#

@shy rose im reading discord,js,org but i cant fint

#

find-

shy rose
#

bot.guilds.size

dapper silo
#

thanks 😃

earnest phoenix
#

how would make a discord inner embed

bright spear
#

@earnest phoenix can you explain?

earnest phoenix
#

oh

#

how would i be able to send a message like this?

dull breach
#

send embed xD

#

ah

#

2 ways here:

  1. If you r really lazy you can write
    message.channel.send({ embed:{"..."} })
    Use embed visualizer to create embeds it this way
  2. Create a new Discord.RichEmbed()
    .setSomething();
    And then just write a name to message.channel.send()
#

im writing on djs, just notice

earnest phoenix
#

I always just manually make the embed object FeelsGoodMan

#

no

#

Not and rich embed

bright spear
#

@earnest phoenix the screenshot you showed is a rich embed

#

@earnest phoenix you mean you just make the json? thats easier to preview cuz of the visualizer but it doesnt let you add/remove fields

heady zinc
#

uh?

#

it does

earnest phoenix
#

oh

#

yeah i just manually make it. i think a few of my commands i just push the field object to fields array lol

#

is it

heady zinc
#

ye that's what i do too

#

and that's what d.js's embeds builders do in the background anyway

earnest phoenix
#

yeah forgot to mention im on eris so dont think theres an embed builder anyway

heady zinc
#

nop there isn't indeed

earnest phoenix
#

sorry i didn't notice

earnest phoenix
#

ho how do you do that cool thing so i can send some code and it will look nice

#

hi how do i defind msg

languid dragon
#

defind msg????

earnest phoenix
#

defined msg

languid dragon
#

defined msg???

earnest phoenix
#

im makeing a bot for discord and is say msg is not defined

languid dragon
#

then define it?

earnest phoenix
#

idk how

languid dragon
#

research it on the documentation of the library you're using

earnest phoenix
#

Is message.channel.send() a promise function

languid dragon
#

read the docs

earnest phoenix
#

Ok

languid dragon
#

👍

earnest phoenix
#

Thonk you

worldly sigil
earnest phoenix
languid dragon
#

@earnest phoenix then don't respond

earnest phoenix
#

👌

slender thistle
#

The functions?

abstract crystal
long glade
#

So I'm noticing with @spice wren that it manages to embed links in the now playing embed with titles to the links instead of the raw URLs

Does anyone know how a bot can accomplish this? I'm not finding anything on specifically texting a URL in the API docs

fluid basin
#

Use markdown

heady zinc
#

[link](text)

fluid basin
#

Its supported in embeds

heady zinc
#

that's a markdown feature only supported in embeds

long glade
#

I didn't know Discord supported that specifically o:

#

Thank you!

fluid basin
#

tbh bold, italics, underline and strikethrough all use the markdown format

long glade
#

Well yes of course, but I always had the idea in mind that Discord purposefully had a limited version of markdown to prevent against malicious link texts and images and things like that
It's neat to see that a bot has more access though

heady zinc
#

discord indeed has a limited implementation of markdown, i think it wasn't specifically meant for bots but rather for internal purposes but eh

long glade
#

In any case it works how it is so I'm fine with that

heady zinc
#

uh lemme check something very fast

fluid basin
#

Pretty sure its the other way round

long glade
#

Maybe, testing now

fluid basin
#

Uhh

#

As in you want ppl to see the text rite so the text comes first

bright spear
heady zinc
#

it is

#

sorry

long glade
#

I tried that just now and the earlier suggested one

#

Neither are working

bright spear
#

no you didnt

#

not in the screenshots

long glade
#

Oh wait

heady zinc
#

[text](https://memes.com) works

long glade
#

Okay yeah I forgot to swap the text and URL

#

My bad

bright spear
#

btw, it also works in non-embed webhook messages

long glade
#

Ooo

heady zinc
#

does it ZoomEyes

bright spear
#

yeah i use it in a command

#

i have a hook command which makes a webhook that looks like you and sends the text

long glade
heady zinc
#

impersonifying users meguEyes

gilded thunder
#

How do I run command checks in d.py if the command is cogged, my code is

owner = "372931332239654912"

def ownercheck(ctx):
    return ctx.message.author.id == owner

    @commands.check(ownercheck)
    @commands.command()
    async def leaveguild(self, id):
        """Leave a guild."""
            toleave = self.bot.get_server(id)
            await self.bot.leave_server(toleave)
            await self.bot.say("Left {0} (`{1}`)".format(toleave.name, toleave.id))```
#

I had someone who isn't owner test it and he managed to run the command.

gilded thunder
#

Checks work now, just had to rejuggle my code a bit.

#

Now embeds don't work

#

I need help with rich embeds in d.py cogs, I can't even load the cog nor are any errors printed in the console.

neon swift
#

@gilded thunder You still need help?

gilded thunder
#

Yeah

#

With the embedding.

neon swift
#

The code here doesn't even use embeds tho

gilded thunder
#

I know, I said.

neon swift
#

What do you want to do? Have you looked at the documentation?

gilded thunder
#

Are there docs for cogging?

neon swift
#

There are for embeds

#

And cogs aren't diffuclt too

#

You using 0.16 or rewrite?

gilded thunder
#

0.16

neon swift
gilded thunder
#

That's where I got the basic addcog bit.

#

Nicked some commands back when I first made the bot too

earnest phoenix
#

Lol gj

neon swift
tribal hazel
#

Whats the code for when a bot joins a voice channel and he deafens

tribal hazel
#

Can someone help me?

abstract crystal
#

@tribal hazel i'd be nice if you specified language and library you use

tribal hazel
#

JS.

#

@abstract crystal

abstract crystal
#

discord.js?

tribal hazel
#

Yes.

abstract crystal
#

have you checked the docs?

tribal hazel
#

Not yet

abstract crystal
#

well what are you waiting for

tribal hazel
#

But what I want isnt on there

topaz fjord
#

what are you using for joining the channel

tribal hazel
#

What I want..

#

Is basically...

#

When the bot joins, they deafen.

topaz fjord
#

i k

tribal hazel
#

Like dabbot

topaz fjord
#

what are you using to join the vc

tribal hazel
#

YTDL-Core.

#
    
    let connection = await message.member.voiceChannel.join();
            let dispatcher = await connection.playStream(ytdl(args[0], { filter: 'audioonly' }));
    
    message.channel.send(`**${message.author}, I am now playing ${info.title}! :play_pause:**`);

    }   ```
gilded blaze
#

Get the voice channel, join, get the connection from what is returned from join, and just use https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=setDeaf

tribal hazel
#

The bot to deafen so..

#

Whe it joins it deafens..

#

SetDeaf..

#

client.user.setDeaf

#

?

gilded blaze
#

That is not a guildmember object

topaz fjord
#

message.guild.me.setDeaf(true)

tribal hazel
#

Thanks! One more thing. My pause command isnt working?

#

@topaz fjord

topaz fjord
#

show code

tribal hazel
#
module.exports.run = async (client, message, args) => {
        dispatcher.pause();
    message.channel.send(`**<@${message.author.id}>, I have just paused the current song! :pause_button:**`)
}
tribal hazel
#

Help.

knotty steeple
#

what

#

its not working because dispatcher isnt defined

#

in your play command you should have a message collector

worldly sigil
#

@abstract crystal that's so much more readable thx

abstract crystal
#

np

earnest phoenix
#

Good evening to all
you know how I can keep my bot connected to my server without putting it on the host or VPS?

neon swift
#

ummmmmmmmmmmmm

#

You do realize bots don't run in the aether

#

And VPS only costs you like 3 or 4 $ a month

earnest phoenix
#

and then how can I do it online?

neon swift
earnest phoenix
#

and I do not want to pay for a bot!!

neon swift
#

too bad, nobody is going to host your bot for free

#

(and when you see a free "product" know that you are the product and most likely company will sell your info)

earnest phoenix
#

they told me that I do this without being hosted by someone but I do not know how to do it and neither the one who told me knows

hardy fiber
#

Can you host it in your own computer?

#

I host mine on someone else's computer for free because I made a bot for them, but that's not an every day occurrence.

earnest phoenix
#

i can not keep my pc open

neon swift
#

well, then you see, VPS is the perfect solution

#

it's cheeper than paying for the internet and the electricity your computer will use hosting your bot

#

The biggest issues would be you not having a internet chargeable card (credit or debit+) or you not knowing any bash commands

earnest phoenix
#

OK thank you very much for your help
and I can find this way to let you know so you can know it

neon swift
#

No thanks, I already have my bot running on a VPS I pay $4 a month for

earnest phoenix
#

and how can I pay if I do not have a credit or debit card on the internet?
Does paysafe accept the vps you are?

worldly sigil
#

so im having a bit of trouble starting my bot

#

im using the python api documentation but a lot of stuff seems ambiguous

#

to start i created a 'MyClient' class and extended the discord.Client() class

#

and im not sure where to go from there

neon swift
#

What python lib you using?

worldly sigil
#

uh

#

not sure?

#

im using python 3.7

neon swift
#

1st, if you are making a bot, you want to from discord.ext import commands and use commands.Bot instead of discord.Client

worldly sigil
#

whats the tradeoff

#

or the benefit ig

neon swift
#

There is none, commands.Bot is a subclass of discord.Client

#

it's just that Bot has builtin command making tools

#

You don't even need to subclass the bot unless you want to overwrite something in there

worldly sigil
#

mm i see

#

will this limit me to the things i can do with my bot?

#

like moderation

neon swift
#

Very little as you can just use cogs

worldly sigil
#

or playing music

neon swift
#

Those, not at all

worldly sigil
#

oh ok

neon swift
#

I was more thinking if you want a complex prefix finding system then you might need to overwrite get_prefix or something

worldly sigil
#

exclamation point prefixes are fine for rn

neon swift
#

Yeah, for example this is my get_prefix I have overwritten: py async def get_prefix(self, message: discord.Message): if isinstance(message.channel, discord.DMChannel): return [ f'{message.channel.me.mention} ', "".join(itertools.takewhile(lambda k: not k.isalnum(), message.content)) ] # mention needs to be first to get triggered return await super().get_prefix(message)
It makes it so that DMs don't need a prefix but still use any !?=:; combination you can think of

worldly sigil
#

i see

neon swift
#

But even if you want custom per server prefixes you don't need it

#

Oh, one thing tho, if you are just starting, use the rewrite version of the library instead

#

pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]
This command in your git enabled console would install rewrite version. It's just that 0.16 og the library is getting really outdated

worldly sigil
#

thxxx

neon swift
worldly sigil
#

damn dude i really appreciate it

earnest phoenix
#

well i want to do another one question you know i can find code for music bot
@neon swift

neon swift
#

Do I look like google????????????

earnest phoenix
#

haha and of course not just asking you why I have been looking and those I found did not work.
But I've tried and made both my own and the struggle, of course

#

and I said if you had someone and you could give it to me

ruby dust
earnest phoenix
#

any idea how I can create an older version of a file using git?
For example create a copy of a file 2 commits ago. How would I do that? (fixed check_mark)

shy oak
#

I need help with a bot I'm making. I'm having trouble figuring out a way to connect the bot, which is coded in C#, to the database I'm using, which is MariaDB (MySQL). Does anyone have experience with this particular setup? I've been searching the internet for answers and I've been coming up empty-handed.

#

take your time, I literally have a mountain of time on my hands.

#

:/

earnest phoenix
#

@ruby dust sorry my friend

#

what issues are you having exactly? @shy oak - I don't have experience with c# discord bot but I use mariadb as well in node, so if its not a c# related issue I might be able to help

shy oak
#

it is a C# related issue. I can't get the connection object to work correctly.

earnest phoenix
#

ah I see, then better wait for someone who codes their bot with c# and uses mysql to give you a hand ;p

shy oak
#

I have all the time in the world... Sadd

shy oak
#

I mean, a little help wouldn't hurt... I'm not planning on waiting all day.

#

;-;

glad charm
#

:S

vernal crow
#

@earnest phoenix What Library are you using?

earnest phoenix
#

discord.js

glad charm
#

node filename.js

vernal crow
#

Okay, assuming your code works, you can start it using a console with the node command

#

^

glad charm
#

If you want it online and still use your terminal you can use forever. Just install npm install forever then forever start filename.js
(If you're computer/laptop turns off the bot will turn off too)

jovial sigil
#

Pm2 also works. I'm using that

shy oak
#

yeah, sure... completely gloss over my question... it's not like I need help or anything... ;;-;; Sadd

glad charm
#

Yeah Pm2 is pretty good.

#

Well I don't know C# sorry bud. I do C++/TS development.

jovial sigil
#

I don't know c#

uncut slate
#

@shy oak some people won't be able to answer your question, there is nothing you can do about it. we're not going to freeze the channel until someone answers your question.

shy oak
#

I know that.

uncut slate
shy oak
#

I have been trying to work this thing out for a month and nobody's been able to help me yet, so I'm a little desperate at this point.

uncut slate
#

being desperate doesn't excuse your behaviour

south finch
uncut slate
#

if you're that desperate ask on a help forum where your question won't get buried

glad charm
#

A month? Google is a better option at this point.

shy oak
#

I tried that. nothing came up.

south finch
#

You also gotta take in not a lot of people in here are good with C#

glad charm
#
discord.ExecuteAndWait(async () =>
        {
            await discord.Connect("TokenCode", TokenType.Bot);
        });``` Is this the issue?
vernal crow
#

That’s be cool if there were different channels for different libraries.

shy oak
#

no, it's not. I need a way to connect my bot's code to the Database that I have set up using MySQL.

glad charm
#

I'm in the DiscordJS server because mines TS.

vernal crow
#

I didn’t even realize they had server lol

#

Smart

glad charm
#

It's p big lol

vernal crow
#

Just joined

gusty rune
#

tell me if im wrong. Trying to get votes data. I do http request with my token then get data as json and parse?

glad charm
#

Context please?

shy oak
#

ya have a C# refrence for that...?

gusty rune
#

you can do a php connection and request data if that is easier for you

#

but both are easy

glad charm
#

Google does wonders.

gusty rune
#

^ this fr

glad charm
#

visual studio is mostly developed for C# if you're not aware

gusty rune
#

not really

#

c++ does really good

glad charm
#

Oh? I've only seen people use it for C#

gusty rune
#

nope c++ is game changer on vs

glad charm
#

I don't develop on windows so my C++ is all VSC

manic elk
#

help

glad charm
#

Please stop spamming that everywhere

manic elk
#

i need my bot on my server

glad charm
#

Invite it.

gusty rune
#

@glad charm have you ever did webhook request for who voted?

glad charm
#

who voted? I guess not.

manic elk
#

but seriously i need a sulotion

glad charm
#

Do you not have the invite link to your bot?

shy oak
#

Microsoft Visual Studio hosts various coding languages; including Visual Basic, C++, C#, Javascript and other similar languages.

glad charm
#

https://discordapp.com/oauth2/authorize?client_id=yourbotsclientidgoeshere&scope=bot&permissions=0

manic elk
#

it works!!!!!

glad charm
#

Yeah

manic elk
#

but its offline and says my application

jovial sigil
#

Well you have to run the code for it to be online

manic elk
#

how\

glad charm
#

Well what did you develop the bot in?

manic elk
#

github

earnest phoenix
#

🤔

viscid falcon
#

we mean programming language

hardy fiber
#

10/10

glad charm
#

oh jeez

earnest phoenix
jovial sigil
#

Lol

hardy fiber
#

Github is my favorite library

viscid falcon
#

did you develop the bot?

hardy fiber
#

(code it)

earnest phoenix
#

stole it from github

manic elk
#

yup

viscid falcon
#

what programming language?

earnest phoenix
#

Html

manic elk
#

java

earnest phoenix
#

and html

hardy fiber
#

That's the first time I've seen someone make a bot with Java

earnest phoenix
#

Lul

hardy fiber
#

Well, say they did

earnest phoenix
#

I once made a bot in Swift

#

100% legit

viscid falcon
#

is there even a library for java?

hardy fiber
#

I perfer scratch

earnest phoenix
#

JDA

#

@viscid falcon

#

Some big bots use it actually

hardy fiber
#

Examples?

heady zinc
#

rythm

earnest phoenix
#

go to the dbl website

#

bruh

#

Most used lib should be djs though

glad charm
#

bruh

#

true

earnest phoenix
#

then discord py

hardy fiber
#

I could, but I'm on a 4 year old phone

earnest phoenix
#

then jda

hardy fiber
viscid falcon
#

im on a 2 year phone that was 80$ when i got it

earnest phoenix
#

Doesn't crash my android

viscid falcon
#

wait 3 years now

earnest phoenix
#

👌

hardy fiber
#

Mine was low end when I got it as well, and it's Android as well

earnest phoenix
#

Android L ftw

topaz fjord
#

ew LoliPop

earnest phoenix
#

get out jellybean

topaz fjord
#

i use Oreo

viscid falcon
#

im looking at upgrading this year around christmas

#

for sales and money

hardy fiber
#

I have no idea what version of Android I use, it last updated in 2016

earnest phoenix
#

gtfo O peasant reeeee

#

Do you even custom rom

topaz fjord
#

no im not rooting my s9

earnest phoenix
#

ew

topaz fjord
#

i can use a custom rom on my nexus

earnest phoenix
#

stock rom normie

#

do you even adb

hardy fiber
#

Idk if my phone could Handel the latest Android

topaz fjord
#

just waiting for the android p rom to come out

#

yes i used adb for my nexus

earnest phoenix
#

I'm getting a new phone next month with android N

#

7.0.0

topaz fjord
#

yes i know what android N is

earnest phoenix
#

O is 8.0

#

N o u g a t

hardy fiber
#

I have android 4.4.4 👌

topaz fjord
#

i've upgraded from Lolipop to Oreo on the nexus

#

all through beta updates

earnest phoenix
#

I can always compile 8.0 for 7.0 or smth

#

i always root my devices

topaz fjord
#

apparently samsung made it pretty hard to install a custom rom on the s9

#

so im stuck with touchwiz

earnest phoenix
#

gg

#

enjoy touchwiz

#

I'll get my lineageOS

topaz fjord
#

wonder how they are gonna skin android p

#

waiting for lineage 16

earnest phoenix
#

waiting to get stuck on a bootloop and have to reflash the phone image

sick cloud
#

you guys 👀

shy oak
#

well, that Stack Overflow page didn't help at all, since it was over 4 years old.

#

I just need help figuring out this database connection...

glad charm
#

Age doesn't matterm 9/10 for me lol.

shy oak
#

I need help with a Discord bot I'm making. I'm having trouble figuring out a way to connect the bot, coded in C#, to the database I'm using, which is MariaDB (simply a fork of MySQL). Does anyone have experience with this particular setup? I've been searching the internet for answers and I've been coming up empty-handed. Either the code is outdated or it fails entirely.

quartz kindle
#

if you cant find anything for mariadb, search for mysql. they both have 99% identical apis

shy oak
#

I know that. It's just that the Libraries for the MySQL .NET packages were updated just a few days ago.

#

nothing works anymore :/

#

not even the Developer Guide for MySQL.

glad charm
#

inb4 it's not a sql issue

heady zinc
#

if it doesn't work how about rolling back to a previous version

chilly parrot
#

GWfroggyMonkaThink Anyone here with knowledge about a bot account with multiple receiver bots in the background? Like
One Bot thats check for commands, (Python)
Second posting RSS Feed stuff (Python)
Third doing other stuff (Go)

heady zinc
#

multiple receiver bots?

#

what?

quartz kindle
#

only theoretical knowledge

shy oak
#

My forehead has a 4-inch diameter bruise from constant facedesking.

#

;-;

chilly parrot
#

00:41] pawadox: multiple receiver bots?
you have 1 bot account that is used from 3 scripts (2python, 1 go ... so it is not 3x times the same, it is other stuff) in the background

quartz kindle
#

your bot can login from multiple places at once, so you can have 3 connections

heady zinc
#

you basically want to micro-service your bot don't you?

quartz kindle
#

but that will triple the data you're receiving from discord

#

you can have one bot that listens and passes stuff to other bots

chilly parrot
#

00:42] Tim: but that will triple the data you're receiving from discord
right ... but i dont think thats a huge drawback

quartz kindle
#

other than that its as simple as running 3 bots

#

using the same token to login

#

unless you wanna pipe data between them

chilly parrot
#

thats what i do

#

using the same token for the 3 different tasks

quartz kindle
#

yes

chilly parrot
#

and know i'm would check if there is any big drawback, like getting banned or so

glad charm
#

when you gotta update your VM instance for your bot and you're worried they're gonna try and review during down time

#

😱

quartz kindle
#

im not sure about getting banned

heady zinc
#

well there's a lot of drawbacks actually

#

as far as i know it will just identify three times

#

thus you will reach the identify ratelimit 3 times faster

chilly parrot
#

GWfroggyMonkaThink there is a identify ratelimit

heady zinc
#

the usual way is to only have one application connected to the gateway

chilly parrot
#

lul never got it

heady zinc
#

then this application transmit it to the other services

#

it's 1000 identify/24h

#

each shard count as identify too

chilly parrot
#

00:46] pawadox: then this application transmit it to the other services
but that would be a big drawback

#

the time between sharing is not small

heady zinc
#

no it wouldn't

#

sharing it would pretty much be instantaneous

quartz kindle
#

why dont you just pack the 3 scripts into one?

heady zinc
#

unless you host your services on different servers each far away from each others

chilly parrot
#

00:47] Tim: why dont you just pack the 3 scripts into one?
2 different languages + 1 script is blocking and that the async version is slow like hell

#

00:47] pawadox: sharing it would pretty much be instantaneous
but you can't share the full message obj between the bots, without time for copy

#

and other languages can't use the object, without getting it directly from discord again or?

heady zinc
#

wdym other languages can't use the object cuteThink

#

discord just sends you JSON

quartz kindle
#

if you're using different objects/libs, it might be tricky, yes

chilly parrot
#

how would you pass the python message obj. into golang without needing time for reencoding into json and stuff

#

you waste so much time between this steps

heady zinc
#

well you don't really have the choice, it's either that way and it will scale, or your current way and it wont scale

#

transforming it into JSON and the other way around should be a matter of nanoseconds though

quartz kindle
#

the problem is that the json object will be different from lib to lib

#

unless you're accessing the discord api directly

#

plus if you convert to json, you lose the api functions/methods

heady zinc
#

ye at this point you would usually don't use a lib

quartz kindle
#

at this point yeah, you dont really have a choice besides rewriting everything into a single bot/lang/lib

chilly parrot
#

and thats not cool

heady zinc
#

well after all you're trying to use two different languages, you'll have to drop the simplicity

quartz kindle
#

keep doing what you're doing, you got plenty of space left with 1000 logins per day

#

plus you can reload parts of your bot that way, without having to use command handlers lmao

chilly parrot
#

1000 bots incoming

quartz kindle
#

and split them into different hosts

chilly parrot
#

as long that every bot only connects 1 time per day, everything should fine

heady zinc
#

true, but you should still think about it, as there will be a point where your system will break

quartz kindle
#

tbh his system is actually quite scalable

chilly parrot
#

why should it break? can you give me a example?

quartz kindle
#

the only problem is literally triple the bandwidth and triple the resource usage

heady zinc
#

ye that's not quite scalable lul

quartz kindle
#

but each instance will use less resources

#

if they only need to do one job

chilly parrot
#

and triple the resource usage
and the instances are not blocking each other

quartz kindle
#

so it will be idling most of the time

chilly parrot
#

ye that's not quite scalable lul
thats where i'm not so sure about

heady zinc
#

how big is your bot

chilly parrot
#

when we think about python ... python is a shit language, you can't really multithread it without starting a new thread

#

so for python this is scalable like hell

quartz kindle
#

thats why there is sharding

chilly parrot
#

you just start own instances of the bot

quartz kindle
#

sharding forces you to multithread regardless

chilly parrot
#

python and multithreading

heady zinc
#

that's where internal sharding comes into action and you don't multithread mmLol

chilly parrot
#

how big is your bot
not big, 1 server with 1k ?

glad charm
#

nice

heady zinc
#

oh lmfao

chilly parrot
#

it's just a private server, thats needs some functions

quartz kindle
#

then you dont need to worry about anything

heady zinc
#

oh then you don't care at all about the identify ratelimit lmfao

chilly parrot
#

but still i wont risk breaking api rules ... so thats why i ask here

quartz kindle
#

i mean, im on almomst 300 servers with a single core and 600mb ram

glad charm
#

to strong

#

sounds like the lowest GCP tier

quartz kindle
#

it is

#

lmao

glad charm
#

AYYY my dude

#

same

quartz kindle
#

ayyy

chilly parrot
#

GCP?

quartz kindle
#

google compute engine

glad charm
#

Google Cloud platform

heady zinc
#

ye mine's on 3k servers and still use ~20% of the single core and 500mb ram

uncut slate
#

RMB got up to 4150 servers on a single core and 500MB ram

quartz kindle
#

nice

heady zinc
#

"got up to" rip rmb

uncut slate
#

that included an express API too

chilly parrot
#

ohh you can use google ... nice

uncut slate
#

hehe @heady zinc

heady zinc
#

was a good meme until the end

quartz kindle
#

which lib was rmb?

uncut slate
#

eris

quartz kindle
#

ah

glad charm
#

trying to make my bot live with new VM instance and i have to reinstall all these dependicies holy shit

quartz kindle
#

im gonna switch to eris maybe if i get close to 2k

#

im on djs stable and i have a problem with memory allocation

heady zinc
#

i doubt it's worth it honestly

quartz kindle
#

because it caches users and they come online

glad charm
#

nice

quartz kindle
#

so after like 3 days it goes from 100mb ram to almost 300mb

sick cloud
#

d.js master is good

#

it has a clear cache thing iirc

#

i need to implement it into my bot

glad charm
#

ye

quartz kindle
#

what i did to fix linux's out of memory thing was create a 1gb swap file lmao

#

not very performance-y but does the job

heady zinc
#

i mean d.js stable is really outdated

quartz kindle
#

yeah but master is in eternal beta

#

lmao

heady zinc
#

even though it's bad practice you should use master

quartz kindle
#

but tbh im just too lazy to switch

#

i have a shit ton of work to do on another project, its a big pain to even think about switching libs at this point

glad charm
#

truu

#

OOF better-sqlite3 shit the bed so now the bot is shitting the bed

#

gggf

quartz kindle
#

rip

#

what happened?

glad charm
#

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal. rip this is only happening now

#

I made a new VM instance and now it's dying lol

#

Apparently a well known issue lol

quartz kindle
#

did you change anything else?

#

like node version?

glad charm
#

No just pulled my repo and npm install'd

#

MHMHMHM I think the node version did change

#

I'll bork it and reinstall to 6

quartz kindle
#

npm install gets the latest versions

#

maybe some package was updated

glad charm
#

Lmao I'll cry

#

ayy back to 6.11

earnest phoenix
#

@glad charm judging by your profile picture is it safe to assume you're a man of culture as well?

glad charm
#

Yes sir

earnest phoenix
#

Keep it up then dear sir tickYes

long forge
#

I found a way to add playlist support to my "play music command":
https://hastebin.com/febimolefa.js
The code to allow playlists:

    if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
            const playlist = await youtube.getPlaylist(url);
            const videos = await playlist.getVideos();
            for (const video of Object.values(videos)) {
                const video2 = await youtube.getVideoByID(video.id); // eslint-disable-line no-await-in-loop
                await handleVideo(video2, msg, voiceChannel, true); // eslint-disable-line no-await-in-loop
            }
            return msg.channel.send(`✅ Playlist: **${playlist.title}** has been added to the queue!`);
        }```
Im just unsure of where I should put it in my original play command code it so it works correctly...
sick cloud
#

that's up to you

#

since we dunno how your play command or music system works

glad charm
#

Thonk dependencies work fine on laptop but VM instance cries and it won't work. Time to find another way to keep track of shit

uncut slate
#

package.json

viscid falcon
#

im using discord.js and im making a server info command, when i added the owner to it with message.guild.owner, it gave me UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
what did i do wrong?

tidal parrot
#

message.guild.owner is the guild member object for the owner

viscid falcon
#

oh srry

tidal parrot
viscid falcon
#

im sorry im new to coding kindaish, if i wanted it to say who the server owner is similar to how message.author works, how would i do that

sick cloud
#

just use user

#

so, <message>.guild.owner.user.<whatever user property, like tag/id>

viscid falcon
#

thank you

sick cloud
#

np

viscid falcon
#

that finally got it working thank you

floral stone
#

How to view the latest info in a journal log?

#

ubuntu 16.04

glad charm
#

Sorry not sure.

floral stone
#

It's fine but googling isn't helping me

glad charm
#

So you just want to view ubuntu's log file?

floral stone
#

nvm

glad charm
#

?

gilded thunder
#

This code won't increment the value, it won't even print the new user into the database, using TinyDB on Discord.py

@bot.command(pass_context=True)
async def cookie(ctx):
    await bot.say("Yum")
    if cookiedb.contains(Users.id == ctx.message.author.id):
        cookiedb.update({'user': ctx.message.author.id, 'cookies': increment})
    else:
            cookiedb.insert({'user': ctx.message.author.id, 'cookies': 1})```
neon swift
#

Yeah you are going to have to figure this out on your own, not sure if anyone here woud know TinyDB (whatever that is)

#

or start using big boy databases, like asyncpg and postgre

gilded thunder
#

ugh, alright then

#

lemme just check stackoverflow real quick

weak stone
#

can any1 help me in api?

dull breach
#

@Luca botinfo @frosty flax

#

it doesn't work here sorry

#

ok you have a long description

#

and there is allowed html

#

so you can paste <style> tag

knotty steeple
#

@weak stone what api?

#

if its for the discord bot list api, you would have to go to #topgg-api and ask for help

hardy fiber
#

@earnest phoenix what do you mean "how can I make the name"?

earnest phoenix
#

color-shifter

hardy fiber
#

Oh, you want it to change color?

earnest phoenix
#

bot

#

color-shifter

#

name

glad charm
#

You alright there

earnest phoenix
#

name

hardy fiber
#

Oh, you want your bot name to be a different color on the site?

earnest phoenix
#

yes

hardy fiber
#

Ok, idk then

earnest phoenix
#

How should I do

knotty steeple
#

css

earnest phoenix
#

could you tell me where to find the command

#

@knotty steeple could you tell me where to find the command

quartz kindle
#

@earnest phoenix

#

in your bot edit page

#

long description

#

use html: <style> </style>

#

and css

neon swift
#

Isn't this for certified bots only?

knotty steeple
#

no

#

js is for certified only

earnest phoenix
#

can anyone show me how to make the bot edit a embed

#

?

#

what do you guys use for databases

#

nodejs

restive silo
#

i use Postgresql

#

is SQL, really fast and uses extremly less ram

earnest phoenix
#

can anyone anwser my question

buoyant sleet
#

Hello I'm Doing A discord Bot From Discord.js. How To Ban&Kick With Messages?

earnest phoenix
#

you dont just come here to ask for code ok @buoyant sleet

#

any errors

#

?

#

No

#

Nada

#

Nilch

#

also why are you coding on your phone?

#

Because I'm on vacation

#

hmm....

#

no clue if i cant see all the code XD

#

haft of it is cut off

#

Hold on, ill get a file

#

put it in a hastebin XD\

#

Can't I don't think. I can't cut and paste from the codeanywhere app

#

lol

#

im not downloading it

#

That's the best I can do

#

XD

#

do you know how to remove the code

#

waht code?

#

line above bot image

#

line above bot image

#

Css sucks ass dude sry. You should use a preprocessor like scss

#

Then compile it ofc

heady zinc
#

what is crapping out on your code exactly

earnest phoenix
#

Idk why but my bot keeps restarting

#

Pm2 errors somehow restarts the process and I see none of it

heady zinc
#

uh, perhaps it runs out of memory cuteThink

earnest phoenix
#

Except for the commands reloading

#

How do I solve that

#

The memory thing

heady zinc
#

i mean it's a possibility but i highly doubt it's the case

earnest phoenix
#

Oh

heady zinc
#

do you check the full logs from pm2?

earnest phoenix
#

I use pm2 restart 12 && pm2 logs 12 when I restart the bot after adding smth new

#

Does that not give me the full logs?

heady zinc
#

it does, threre's nothing that makes sense in your logs?

earnest phoenix
#

No. Just my bots startup logging which just tells me when each command gets loaded into sqlite

bitter sundial
#

it loads a few lines from history and then prints the logs live

earnest phoenix
#

Ye

heady zinc
#

ye so everytime you run the command your bot just restart and nothing else is logged? thonk

earnest phoenix
#

No every time I restart the bot it loads all the commands like 20 times through

#

And when I run the new command it literally does nothing

bitter sundial
#

how does your command loader work

earnest phoenix
#

hey how would you make your bot edit its embed

#

New embed object

heady zinc
#

soo at this point, i can only think of adding logs to the console at every step of your command

earnest phoenix
#

like the bot edits the embed

heady zinc
#

to see exactly where it borks

earnest phoenix
#

Bork!

#

can anyone give me an example of it

#

?

#

The dimensions of the whole image are 500px by 250px

#

are you using js?

heady zinc
#

yes that is js

earnest phoenix
#

hmm

#

dont know

violet siren
#

I'm messing around with Oauth2 atm, so I'm trying to amke a simple API call using cURL. I can access the API and get results using a bot token, but I keep getting '401 : Unauthorized' errors with my bearer token, even though I have the token. Any ideas ? My code :

$membersEndpoint = $domain . "/guilds/guildID/members/" . $user->getId();

$curl = curl_init();
curl_setopt_array($curl, array(
            CURLOPT_URL            => $membersEndpoint,
            CURLOPT_HTTPHEADER     => array('Authorization: Bearer TOKEN'),
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_FOLLOWLOCATION => 1,
            CURLOPT_SSL_VERIFYPEER => 0,
        ));

        $output = curl_exec($curl);
        curl_close($curl);

I'd rather use something not related to my bot to make these API calls if i can

earnest phoenix
#

Ye @earnest phoenix

#

?>

#

I do use js

#

ah

#

Canvas to be exact

#

i dont know

#

With d.js and snek

#

need help with how to edit a embed

#

make the bot edit it

#

Use a new embed object

#

And edit the old msg with it

#

i need an example XD im not that experienced with embed

#

not that im not expreienced its that im having trouble making it XD

#

ayy its Tom XD

#
const embed = { title: 'example' };
const editmsg = await msg.channel.send({ embed: embed });
// do whatever you need
embed.title = 'something else';
editmsg.edit({ embed: embed });

something like that

#

ahh ty

#

not 100% sure if .edit() is correct for d.js but its probs something like that

#

ill try it

earnest phoenix
#

Ye

#

That's correct tom

bold girder
#

im not really a dev i just use discord bot maker uhhh bye

glad charm
#

Uh?

earnest phoenix
#

Yeah bye @bold girder