#development

1 messages ยท Page 376 of 1

topaz fjord
#

i fixed ty

olive ridge
#

I am having trouble getting my bot to randomly choose between two variables in an array.
Here is part of my code (In javascript):

var coinFlip = ['Heads!', 'Tails!'];
var randCoinFlip = coinFlip[Math.floor(Math.random() * 2)];

//Skiped part of code

if (message.content.startsWith(prefix + "Flip Coin")) {
    message.channel.send(randCoinFlip);
  }

It send either "Heads!" or "Tails!", but continues to send the same one, until the bot is reset manually.
I tried using infinite loops, but my bot would not turn on.

All my other commands work.

gilded blaze
#

Just send the math without using an extra variable

tribal torrent
#

Cause I define it in the start

#

And each time call the same var

#

Without ever updating it

glossy sand
#

right

#

you've accidentally performed early binding

olive ridge
#

oof

#
var coinFlip = ['Heads!', 'Tails!'][Math.floor(Math.random() * 2)];

Like this?

tribal torrent
#

Oh no

olive ridge
#

;-;

tribal torrent
#

Just call the maths while sending it

olive ridge
#

I'm very new to coding, and don't know how to do that.

glossy sand
#

just move the logic for selecting the flip into the command handler

#

if you execute the logic beforehand, the results are predetermined at every call to the command, right?

olive ridge
#

yos

tribal torrent
#

basically, message.channel.send(....... Maths Stuff to get item )

olive ridge
#

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOH

#

ok lemme try

#
var coinFlip = ['Heads!', 'Tails!'];

//Skipped Code

  if (message.content.startsWith(prefix + "Coin Flip")) {
      message.channel.send(coinFlip[Math.floor(Math.random() * 2)]) 
  }
#

Now it appears to alternate between "Heads!" and "Tails!", instead of a random pattern. ;-;

#

Wait no never mind, I was just astronomically unlucky for 10 flips.

#

Thank you!

tribal torrent
#

๐Ÿ˜ƒ

olive ridge
#

:3

#

Im gonna make a dice now

#

Should be easy

#

Miserably Fails

earnest phoenix
#

Im need SpoonFeedBack

olive ridge
#

hmm

olive ridge
#

I have yet more issues

#

I don't understand embedding ;-;

#

Here is my code:

#
/Embed Bot Command responces
const prefix = "s!"
client.on("message", (message) => {
  if (!message.content.startsWith(prefix) || message.author.bot) return;
  
  if (message.content.startsWith(prefix + "Embed")) {
    message.channel.send({embed: {
      color: 3447003,
      description: "A very simple Embed!"
    }});
  }
});
#

It returns the following error:

#
C:\SoupyBot\mybot.js:28
});
 ^

SyntaxError: Unexpected token )
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:607:28)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
#

The client.on("message", (message) => { . . . }); works perfectly fine in my non-embedded commands.

modern kelp
#

are you missing a }

olive ridge
#

Ohh

modern kelp
#

if you have too few ending braces, it says the bracket is unexpected

olive ridge
#

this?

/Embed Bot Command responces
const prefix = "s!"
client.on("message", (message) => {
  if (!message.content.startsWith(prefix) || message.author.bot) return;
  
  if (message.content.startsWith(prefix + "Embed")) {
    message.channel.send({embed: {
      color: 3447003,
      description: "A very simple Embed!"
    }});
  }
});
modern kelp
#

4 on either side

#

wouldnt be a problem

olive ridge
#

;-;

modern kelp
#

also, its ```js

olive ridge
#

fbi shit going on

modern kelp
#

try ```

#

in the top

olive ridge
#
m8
modern kelp
#
//Embed Bot Command responces
const prefix = "s!"
client.on("message", (message) => {
  if (!message.content.startsWith(prefix) || message.author.bot) return;
  
  if (message.content.startsWith(prefix + "Embed")) {
    message.channel.send({embed: {
      color: 3447003,
      description: "A very simple Embed!"
    }});
  }
});
olive ridge
#

that got clipped off

modern kelp
#

ok

olive ridge
#

riip

#

OH SHIT ITWORKS

#

thank you kind sir

#

or ma'am

calm pilot
#

Is there any way to make your BOT Page dark themed?

olive ridge
#

Did you log into your bot?

#

All I know is User Settings > Appearance > Theme > Dark Theme.

muted oxide
#

Now, what code should I use to execute eval in discord.py[async]?

earnest phoenix
leaden bane
#

Show the full JSON (remember to hide sensitive things...)

austere meadow
#

you've got an issue in your package.json file, if you're trying to install a package just try and do it manually

#

or try removing the file and let it regenerate

earnest phoenix
#

Rezolved

leaden bane
#

๐Ÿ‘

tame rivet
#

ratelimits are hard

topaz fjord
#

@tame rivet wdym

tame rivet
#

implementation

topaz fjord
#

Are you making something and you want to implement ratelimits?

tame rivet
#

tryna do the ratelimits for dblpy

#

๐Ÿ‘€

muted oxide
#

How do discord.py [ASYNC] get their time from ping command?

low rivet
#
ctx.message.created_at - datetime.datetime.now() ```
upper pumice
winged mauve
#

i cant edit my bot detailed description

#

it says "Potentially malicious script detected"

prime cliff
#

Some libraries have a config option of filtering out everyone and here @upper pumice what lib are you using?

winged mauve
#

its just html and it doesn't have any script tag

quiet bobcat
#

it does that ^

prime cliff
#

#ffff is white ๐Ÿคฆ

quiet bobcat
#

wait

#

fixed it

prime cliff
#

๐Ÿ‘

quiet bobcat
#

misspelled !important GWmythiBlobLUL

#

thanks anyway

prime cliff
#

#fff is white though?

quiet bobcat
prime cliff
#

Ah

quiet bobcat
#

wanted that

prime cliff
#

Yea its a bit annoying doing !important all the time ๐Ÿ™„

quiet bobcat
#

Yup

solemn obsidian
upper pumice
#

@prime cliff Eris

prime cliff
#

Enabled by default

heady zinc
#

that's a truly weird issue you got there trixter

#

shouldn't happen

#

i suspect discord zoomeyes

upper pumice
#

How does I do it @prime cliff

wide venture
#

How do I find out my user.id

upper pumice
#

How does I do it @prime cliff How does I do it @prime cliff

prime cliff
#

You need to use the client constructor to set the option

#

Go to where you defined discordclient

heady zinc
#

you actually don't

#

it is safer to leave the client option like that

prime cliff
#

He wants to disable the everyone/here filter

heady zinc
#

you can use the message options to enable everyone/here for that specific message

prime cliff
#

Ah

#

I dont do eris so :/

heady zinc
#

But yeah, you indeed can disable it in the client constructor options

#

i highly recommend not to tho

upper pumice
#

Yes , I saw this last time , but Idk what would I do

#

What sould I write on my codes to do it true?

heady zinc
#

you pass an object with the described parameters instead of a simple string zoomeyes

prime cliff
#

Can you do it like SendMessage("Hello", disableEveryone: false) or is it diffrent in eris Thonk

heady zinc
#

na you can't, second parameter will be considered as the file parameter

#

so it has to be Channel.createMessage({ content: "Hello", disableEveryone: false });

upper pumice
#

On yellow its where its the @here but not mentioning

heady zinc
#

Client.createMessage() takes the three parameters channelID, content, file instead of the 2 content, file the channel based method takes, so the one to change from string to object is the second one

upper pumice
#

Can u send me a print on where it is it?

supple shale
#

fucjubg hell

#

wtf

#

@upper pumice ?

#

just remove the @here ;-;

upper pumice
#

No , I want the @here , but this is not mentioning everyone , only stay blue

deep parrot
#

but

#

@here is poopy

#

just dont use it xD

#

then let them make a custom role call AFK Reminder or something

#

due to @here is the same spam as @ everyone

inner jewel
#

role pings NotLikeMiya

deep parrot
#

OOF

#

people can choose if they want to role

#

to make it even more better

#

so you dont get pings

quiet bobcat
#

can you see what the second mention is by any chance?

#

using discord.js

heady zinc
#

ofc?

quiet bobcat
#

thanks

heady zinc
#

i assume you used to use message.mentions.users.first() or something like that

#

so yeah as its a collection, and that collections don't have indexes

#

to get the second mention you would have to make the collections an array first

upper pumice
#

So I want to mention a tag , like <@&265158261945270273> , but this dont mention the guys of tag too :/

glossy sand
#

ummm

#

did you really have to tag web admins to demonstrate your point

upper pumice
#

What would I mention so?

#

mb

fossil oxide
#

you mentioned us...

gritty ice
#

how do you make your bots log?

earnest phoenix
#

by writing code to make them log

gusty topaz
#

Duh

quasi marsh
#

Uhh

#

Is there any reason why the localstorage should not work in a browser that is not in incognito mode

gusty topaz
#

You disable it?

#

I think disabling cookies disables local storage

#

At least beetwen reloads

#

At least thats the case in chrome last time I checked

quasi marsh
#

Cookies are enabled

gusty topaz
#

It doesn't retain localstorage?

#

Hmm

quasi marsh
#

It looks like it isn't even being set

gusty topaz
#

I think it may be out of space?

#

How much data is there stored already

quasi marsh
#

A few cloudlflare keys at most

#

Like 3 i'd reckon

gusty topaz
#

I believe localstorage has like a 10 MB limit

quasi marsh
#

5MB

#

But it's all KV storage

#

How the fuck you gonna run out of 5MB unless you try to write the bible there

gusty topaz
#

Or store emote usage history like discord

#

OwO

quasi marsh
#

okay wtf

#

It seems to have turned out

#

That having www in front of it affects the localstorage location

gusty topaz
#

Yes

#

www and not www are 2 separate domains

#

Lol

wind terrace
#

Creating a new bot.

#

Anyone have a name idea?

trim plinth
#

the oofster

olive ridge
#

lol

wind terrace
#

..

#

Roblox player

#

@trim plinth

trim plinth
#

I don't even play roblox lmao

#

I just say oof

wind terrace
#

roblox death sound

#

cough cough

prime cliff
#

Thats what the meme came from

#

oof is a meme because of Roblox

wooden shoal
heady zinc
#

missing async function

trim plinth
#

ik but I still say the roblox oof even though I don't play roblox

wooden shoal
#

not missing the async

heady zinc
#

getPixels is not async

#

i mean the callback isn't

wooden shoal
#

ohhh ok

#

thanks

heady zinc
#

^

wooden shoal
#

same error

gusty topaz
#

Not there

#

In callback

wooden shoal
#

oh wait

gusty topaz
#

getpixels(blah, async (arg) => {

heady zinc
#

^

wind terrace
#

.

#

Anyone have a bot name idea?

wooden shoal
#

yep I just don't really know the terminology, forgot what a callback was

heady zinc
#

well now you know

wooden shoal
#

yep thanks

wind terrace
#

any0ne

#

omfg

wooden shoal
#

pheonix idk

wind terrace
#

cool

heady zinc
#

omfg look at this scrub who can't find a name for their own bot

wind terrace
#

ya

#

im dum

wooden shoal
wind terrace
#

LOL

heady zinc
#

async

wooden shoal
#

FUCK

#

yep

heady zinc
#

i think it is about time you should go to sleep

#

sounds tired to me

wooden shoal
#

prolly lol

prime cliff
#

while (true)
await Task.Delay(Brain);

wooden shoal
#

wow so that works, but my original goal is still broken

#

._.

trim plinth
#

oof

wooden shoal
#

oh my god now it works im so happe lmao

#

happy*

#

thanks ally

wind terrace
trim plinth
#

10 year old would be banned by now

wind terrace
#

LOl

waxen quest
#

haha

earnest phoenix
#

can anyone help me with my bot?

#

Its in python.

pale light
#

S P E C I F I C S

earnest phoenix
#

the help menu

sand roost
#

@earnest phoenix logs and code would be nice

trim plinth
#

How to catch the error of a d.js ready event? Been getting promise errors, breaking my code >:(

mystic stone
clear field
#

i had nothing to thank of so i am making Bloxlink V2

trim plinth
#

ew Bloxlink

clear field
#

eh its all i thought of

abstract mango
#

maybe look at this

#

it has a json payload that you could use to send number of shards

#
            data = {
                'server_count': len(self.bot.guilds),
                'shard_count': len(self.bot.shards)
            }
#

this should be what you're looking for really

mystic stone
#

is it OK to post shard_count: 0 if the bot has no shards yet?

#

also, your code is so duplicated lol, check out mine

topaz fjord
#

if you have no shards

#

dont post a shard count

mystic stone
#

ye

#

i want my code to work regardless of my bot having shards tho

trim plinth
#

okโ„ข

inner jewel
#

@mystic stone bots always have shards

#

at least one

severe glen
#

guys I have a question, is there an API limitation for libraries including links in footers of embed frames ?

#

Because in discor.py links doesn't work in footers

olive ridge
#

Can someone explain the following code?

let args = message.content.split(" ").slice(1);
let game = args.join(" ")
earnest phoenix
#

Assuming that message represents a discord message

olive ridge
#

Yeah

earnest phoenix
#

that will split the message into an array, and then args will equal the array from the second element onwards

#

then games will be the array joined by a space character

olive ridge
#

Oooh

#

What would happen if i got rid of it?

#

I should prob show the othercode around it.

#
//Admin Commands
client.on("message", (message) => {
  if (!message.content.startsWith(prefix) || message.author.bot) return;

  if (message.content.startsWith(prefix + "setgame")) {
    if (message.author.id !== "344671380412956673") {
        return message.reply(":x: Admin Command Only")
    }
    let args = message.content.split(" ").slice(1);
    let game = args.join(" ")
    console.log(game)
  }
});
earnest phoenix
#

you will get a not defined error

#

doesnt do anything right now besides printing out game

olive ridge
#

yeah lol

#

Into meh console

#

Atleast I know it works.

earnest phoenix
#

if you're doing it that way its probably better to handle splitting the command and args first instead of inside startswith

#

then you can do if (command === "setgame") etc

olive ridge
#

hmm

earnest phoenix
#

what bot who can move someone on voice channel to free slot voice channel?

olive ridge
#

Any mod bot basicaly

#

like Dyno

#

or mee6

earnest phoenix
#

woagh dyno can?

olive ridge
#

i think

#

idk

#

I know mantaro ccan

olive ridge
#

In dyno you can enter a command ?purge [Number]. in discord.js how can I find the [Number] so it can delete the specified number? I cannot find it in the discord.js api.

quiet bobcat
#

It is there, look in the message property

olive ridge
#

Okee

#

Would it be .content

#

If so, how do I single out the [Number]?

austere meadow
#

theres no "number" property in a message
the way it works is a message (or command rather) has arguments, and thats how you get the number

#

if you're really basic with this kind of stuff, i recommend you get a framework (like commando or something) that can automatically handle arguments for you

olive ridge
#

;-;

old glade
#

What is this error ?

client_connection: Connection<ConnectionKey(host='discordbots.org', port=443, ssl=True)>
#

Is it Discordbots related ?

#

Because I'm having 502 when trying to reach the website

inner jewel
#
  1. that's not the error
  2. website's down
old glade
#

This is the error my bad

Unclosed connection
#

Do you know where it can come from ?

earnest phoenix
#

if(message.channel.type != "dm" && message.channel.type != "group")
{

#

}

#

if(message.channel.type !== "dm" && message.channel.type !== "group")
{ }

gusty topaz
#

@earnest phoenix about your question, you need to use js on your boat page

#

You need to be certified tho

earnest phoenix
#

aham

gusty topaz
#

But thats less than ideal

#

Or make an iframe

#

Or make an iframe

gusty topaz
#

Hmmm

#

Slow connection

jagged birch
#
    const testargs = msg.content.split(" ")
    const testString = testargs.slice(2).join(" ");

    if(msg.content.startsWith(prefix + " test")) { // enter value after "test"
     console.log(testString);
    }```
how do i make it so it will return if you haven't given this command a value, just using this for test, whenever I do the command normally without any value it console.log's a new line with nothing on it, is there any way to make it so if no value is entered it returns and sends a message telling the user to enter a value?
gritty ice
#

Do I have to be inside a @bot.even decorator to be able to use bot.user.id? Because I tried to follow the aiohttp sample in #312614469819826177 and it says AttributeError: 'NoneType' object has no attribute 'id!!

#

code snippet

bot = commands.Bot(command_prefix=commands.when_mentioned, description=description)

dbltoken = os.environ.get('DBL_TOKEN', None)
url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
headers = {"Authorization" : dbltoken}
cold fjord
#

What does this error mean and how would I fix it?
Trying to implement the API into my python bot.

Traceback (most recent call last):
  File "run.py", line 3, in <module>
    import dblpy
ModuleNotFoundError: No module named 'dblpy'```
gritty ice
#

@cold fjord do this $ pip install dblpy

cold fjord
#

I already have.

gritty ice
#

make sure you're doing this inside the workspace

cold fjord
#

Yea I am.

gritty ice
#

๐Ÿค” launch a python interpretor in that directory and try import dblpy see if you get the same error

cold fjord
#

I get the error loading up the bot.

gritty ice
#

wait a sec, I just received a mention from here ๐Ÿค”

cold fjord
#

Some guy told you to look at the rules cause you are helping me and apparently it falls under "spoon feeding beginners"

#

Not a beginner just never ran into this problem before and was getting help.

quiet bobcat
#

kk, mb

cold fjord
#

Alright.

uncut slate
#

telling someone how to use pip install is not spoon-feeding, jonas

vestal moth
#

Okay guys.

#

I'm the owner of the host for @cold fjord .

gritty ice
#

whaaa

cold fjord
#

He pays for the host for our bots.

#

Pretty much.^

vestal moth
#

Dblpy is installed to the /usr/local/lib/python3.6 directory, and it says the the requirements are "up to date".

gritty ice
#

make sure it's inside the virtualenv

vestal moth
#

The wha.

gritty ice
#

whaa you guys are not using virtualenv for this?

vestal moth
#

It's installed to the vps.

gritty ice
#

I am talking aboutthe local development, that's where you're getting the error, right?

vestal moth
gritty ice
#

this is your local system, right?

#

or may be the requirements.txt file isn't update and may not have dblpy

vestal moth
#

No, that's a screenshot from an ssh session to the vps.

gritty ice
#

well the error ModuleNotFoundError is pretty straight forward, Module Not Found

#

try this in your ssh, start a python instance, try import dblpy

#

tell me if you get any error

cold fjord
#
>>> import dblpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dblpy'
>>>```
vestal moth
gritty ice
#

you don't need to do sudo

#

this is kinda weird tho

#

wait a sec

vestal moth
#

Still.

#

Same error.

#

Even installed it without sudo.

#

dblpy==0.1.5

gritty ice
#

my guess is w/o sudo the modules should go in ~/.cache/pip/

vestal moth
#

My guess is this this is just going straight to dev/null (jokes)

gritty ice
#

you know what, there's a workaround this if you create a Virtual Environment

vestal moth
#

๐Ÿคท

earnest phoenix
earnest phoenix
#

I'm getting an error can anyone help me?

jagged birch
#

Why the hell am I getting this error: TypeError: Cannot read property 'send' of undefined if I try to send a message to a channel but if I try to send it to another channel it works. and yes, the bot has perms to send messages.

earnest phoenix
#

Are you using message.channel.send('Message Here')

#

?

jagged birch
#

yea message.channel.send({embed});

earnest phoenix
#

Well.

#

Read the error.

heady zinc
#

the channel is undefined

#

ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

Mhm

jagged birch
#

uhh what does that mean

#

the bot can see the channel and has all perms

earnest phoenix
#

Figure it out yourself.

heady zinc
#

well its not that the bot can't see it

#

its just that the channel is not a thing

jagged birch
#

weird.

heady zinc
#

afaik ur message object is probably wrong

earnest phoenix
#

mhm

jagged birch
#
const reportArgs = msg.content.split(" ")
    const reportString = reportArgs.slice(2).join(" ");

    if(msg.content.startsWith(prefix + " bugreport")) {

        const embed = new Discord.RichEmbed()
        .setAuthor(`Bug Report:`, `${message.member.user.avatarURL}`)
        .setDescription(`**Member:** ${message.member.user.username}#${message.member.user.discriminator} (${message.author.id})\n**Report:** ${reportString}`)
        .setColor(0xff0000)

        client.channels.get("416598356173914115").send(embed);

        const secondembed = new Discord.RichEmbed()
        .setTitle(":white_check_mark: Successfully sent Bug Report!")
        .setDescription("Thank you for reporting a bug, your message will now be sent to the developers so they can fix it ASAP!")
        .setColor(0x32CD32)
        msg.channel.send(secondembed);
    }```
it's just the server's channels it wont send to, it'll send to other server's channels tho
heady zinc
#

but

#

do you know

#

that channels IDs are unique

jagged birch
#

yes

heady zinc
#

oh okay i failed to read the entire code lul

jagged birch
#

๐Ÿ˜›

heady zinc
#

so yeah, what doesn't work is the second message?

jagged birch
#

it works in that other channel. I don't see why it wouldn't work.

heady zinc
#

you should log msg and see where's the channel property

jagged birch
#

uh ``` Client {

    domain: null,

    _events: [Object],

    _eventsCount: 6,

    _maxListeners: 10,

    options: [Object],

    rest: [Object],

    dataManager: [Object],

    manager: [Object],

    ws: [Object],

    resolver: [Object],

    actions: [Object],

    voice: [Object],

    shard: [Object],

    users: [Object],

    guilds: [Object],

    channels: [Object],

    presences: [Object],

    user: [Object],

    readyAt: 2018-02-23T14:47:01.541Z,

    broadcasts: [],

    pings: [Array],

    _timeouts: [Object],

    _intervals: [Object] },

 _guild: 

  Guild {

    members: [Object],

    channels: [Object],

    roles: [Object],

    presences: [Object],

    available: true,

    id: '325040514858745856',

    name: 'Pete\'s Room',

    icon: '91734fcede8b55b2dc36f654532d9a60',

    splash: null,

    region: 'sydney',

    memberCount: 11,

    large: false,

    features: [],

    applicationID: null,

    afkTimeout: 900,

    afkChannelID: '393663975360823299',

    systemChannelID: '325040514858745856',

    embedEnabled: undefined,

    verificationLevel: 0,

    explicitContentFilter: 0,

    joinedTimestamp: 1515123517118,

    ownerID: '223919574536552449',

    _rawVoiceStates: Collection {},

    emojis: [Object] },

 _members: null,

 _channels: null },

webhookID: null,

hit: null,

_edits: [] }```
that's the bottom part

#

when i typed the command i made it console.log msg

earnest phoenix
#
    message.channel.send(`Roundtrip took: ${message.createdTimestamp - m.createdTimestamp}ms. Heartbeat: ${Math.round(bot.ping)}ms.`);
                                                                       ^

ReferenceError: m is not defined``` Any help?
uncut slate
#

don't use code you don't understand ๐Ÿ˜›

inner jewel
#

m is not defined

earnest phoenix
#

im blind ty for reading that out

quiet bobcat
#

So? define it

inner jewel
#

#define m message

scenic crest
#

please

uncut slate
#

import m from 'message';

bitter sundial
#

am I seeing trolling

uncut slate
#

nah

quiet bobcat
#

depends

#

define trolling

bitter sundial
#

import trolling from 'HumanBehaviour';

quiet bobcat
#

In that case, no

floral stone
#

I'm getting a 404 error when posting server count

#

400*

uncut slate
#

how are you trying to send it

floral stone
#

Using aiohttp

uncut slate
#

hmmm

floral stone
#

Alice is online!
Discord Bots WP has sent the 5017 servers with a 200 responce!
Discord List NET has sent the 5017 servers with a 200 responce!
Carbonitex has sent the 5017 servers with a 200 responce!
Terminal Ink has sent the 5017 servers with a 400 responce!
Discord Bots ORG has sent the 5017 servers with a 400 responce!

scenic crest
#

RIP terminal and dborg

#

do you log the response?

#

perhaps the body'll give you more information

floral stone
#

I log only the response code

#

How do I retrieve the response?

earnest phoenix
#

hi guys

#

if anyone knows anything about html, css, and js i need a bit of help

glossy sand
#

ideally you should just ask your question rather than ask to ask

earnest phoenix
#

well i kinda want to embed something coded in html into discord but im not sure how to go about it

glossy sand
#

that's not a thing you can do

#

unless you're talking about client mods?

earnest phoenix
#

what does that mean

glossy sand
#

like, you're modifying the discord client?

#

the official client doesn't support arbitrary html embeds for obvious reasons

earnest phoenix
#

No, I was thinking I wanted to make a bot embed something I coded in html, but i dont know javascript so i wouldnt know how to exactly make it work.

#

I know you can make html work with javasript but im not very familiar with all that stuff

#

I was going to ask my friend, but she's busy all day

glossy sand
#

yeah there's absolutely no way to do that

#

the best you can do is have your bot link to some external website where you can then serve your content

earnest phoenix
#

But what about the thing that bots do with custom embedding?

uncut slate
#

That's not in HTML

earnest phoenix
#

i know, but i wanted to hange it to javascript

uncut slate
#

that's just a JSON embed, not even close to as versatile as HTML/DOM

earnest phoenix
#

oh

inner jewel
#

the closest you can get with embeds and html is ogp.me

#

still you don't choose the format

#

just give data

#

sending embeds yourself is the closest you'll ever get

gusty topaz
#

It's not HTML

earnest phoenix
#

hm

gusty topaz
#

Oof slow network

earnest phoenix
#

i guess i'll have to figure out how to do it another way, then.

gusty topaz
#

Image?

#

You have full control over an images content

inner jewel
#

up to 8MB

#

in size

#

i know there are libs that render html to an image

gusty topaz
#

Can even be a gjif

inner jewel
#

you can use that and upload it

earnest phoenix
#

the code gets changed to python, right?

inner jewel
#

you can send one of those with any discord lib

nimble coral
#

How to log in to your bot

wooden shoal
#

What lib

earnest phoenix
#

someone know bot can kick all online member?

#

did not have roles

floral stone
#

This is the response Discord Bots ORG has sent the 5017 servers with a 400 responce saying {"error":"Unexpected token s in JSON at position 0"}!

inland canopy
#

;

inner jewel
#

malformed json

toxic hearth
#

How to search on google using their API?

floral stone
#

@inner jewel I've fixed it

gilded blaze
#

how do I prevent my nodejs app from timing out of mysql connection

gusty topaz
#

On disconnect reconnect

gilded blaze
#

thx

topaz fjord
#

Why would it timeout

#

I use mysql with node and it never times out

gilded blaze
#

for me it does

drowsy falcon
#

how can i show how many servers the bot is in in the playing status? d.js

uncut slate
#

Client.user.setStatus

#

trying to set up server blocks with nginx - both domains just reset to the default nginx page
followed https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04
Anyone had to deal with this before?

DigitalOcean

When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server. In this guide, we'll discuss how to configure server blocks

drowsy falcon
#

no

#

for bad people on ${bot.guilds.size} servers!

inner jewel
#

what are your nginx configs?

drowsy falcon
#

i need that

inner jewel
#

might be a wrong server_name

#

had that some time ago

#

also check /var/log/nginx/error.log

#

if an error happens it may fallback to the default vhost

uncut slate
#

/var/www/tweetcord.xyz/html/index.html

<html>
    <head>
        <title>Welcome to tc!</title>
    </head>
    <body>
        <h1>Success!  The tc server block is working!</h1>
    </body>
</html>

/etc/nginx/sites-available/tweetcord.xyz

server {
        listen 80;
        listen [::]:80;

        root /var/www/tweetcord.xyz/html;
        index index.html index.htm index.nginx-debian.html;

        server_name tweetcord.xyz www.tweetcord.xyz;

        location / {
                try_files $uri $uri/ =404;
        }
}
#

and the same for remindmebot.xyz

#

lemme check those, sec

inner jewel
uncut slate
#

Error log:

2018/02/23 21:49:33 [alert] 29935#29935: *11 open socket #11 left in connection 3
2018/02/23 21:49:33 [alert] 29935#29935: *12 open socket #12 left in connection 5
2018/02/23 21:49:33 [alert] 29935#29935: *10 open socket #3 left in connection 7
2018/02/23 21:49:33 [alert] 29935#29935: aborting
2018/02/23 22:00:08 [alert] 767#767: *9 open socket #3 left in connection 6
2018/02/23 22:00:08 [alert] 767#767: aborting
inner jewel
#

looks right to me

#

idk what it is

uncut slate
#

hmmmm

uncut slate
fickle hawk
#

@earnest phoenix im probably too late but above your message.channel.send put

const m = await msg.channel.send("Pinging");
uncut slate
#

rule 7

glossy sand
#

don't spoonfeed because then they learn nothing!!!

topaz fjord
#

@uncut slate im gonna ask this stupid question but not the same port right?

#

And also

#

Do you use cloudflare

#

If you do you only need to add 1 type of address

#

You can just make a cname

undone plover
#

any possible chance you could tell me where the hell I am missing the )

#
var msgid = "403986411310809088"
var channel = tempVars("channel")
channel.fetchMessages({around: msgid, limit: 1})
  .then(messages => {
try{console.log(client)}catch(err){console.error(err)}
    const fetchedMsg = messages.first();

    var guild = fetchedMsg.guild;

    client.on("messageReactionAdd", (messageReaction, user) => {
      if(messageReaction.message.id !== msgid) return;
      if(messageReaction.emoji.name === "โœ…"){
          console.log('added coin to ${member}')
        guild.member(user).addRole("416775048511356938").catch(err => {console.error(err)});
      }
      } else {
        console.log("different emote");
    }
    });

    client.on("messageReactionRemove", (messageReaction, user) => {
      if(messageReaction.emoji.name === "โœ…"){
        console.log(`removed coin to ${user}`)
        guild.member(user).removeRole("416775048511356938").catch(err => {console.error(err)});
      }
      } else {
          console.log("different emote");
      }
    );
#

(tag me please when you respond)

austere meadow
#

use a parser??

undone plover
#

I tried, its not getting it

austere meadow
austere meadow
#

sorry accidentally added a slash

undone plover
#

oh I see

#

tysm

#

what program is dat?

austere meadow
#

this is a bit of a stupid question but if anyone here uses postgres, what would be the easiest way of adding new entries to a model, and have that reflect for all existing users?
so basically, i have a User model, and it has two keys called afk and afkReason, but I want to merge them into one object like afk: {afk: BOOLEAN, reason: STRING}, but what should i do to get this change to reflect for all existing entries/users in the database?

austere meadow
#

cc @white blaze (not a random ping ok don't you yell at me people)

white blaze
#

Funny thing is

#

I'm the one that goes to you to ask about SQL stuff

#

HAHAHAHAHA

austere meadow
#

ok well you're smart though how can i do that

#

i would loop over every user object and add the values i need to but thats not smart because i have over 2k users in the database i think

#

probably way more

white blaze
#

I actually have no idea what you're talking about hahahaha

#

A model?

#

I'm not the right guy to ask man, sorry

austere meadow
#

alright

#

rip

olive ridge
#

I reencountered an error

trim plinth
#

oof

olive ridge
#
client.on("message", (message) => {
  if (!message.content.startsWith(config.prefix) || message.author.bot) return;
  
  if (message.content.startsWith(config.prefix + "purge 10k")) {
    if (msg.author.id !== ("344671380412956673")
      return message.channel.send(":x: Soupyz Only Command :x:")
        message.channel.bulkDelete(100);
  }
});
#

returns

#
C:\SoupyBot\bot.js:53
          return message.channel.send(":x: Soupyz Only Command :x:")
          ^^^^^^

SyntaxError: Unexpected token return
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:607:28)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
#

In console

#

Prob forgot a bracket or somthing

#

i see

#

it

#

so dumb

olive ridge
#

I fixed it

jagged birch
#

Anyone know how I would fix this? I need it to send the message to the guild but as I have shards it's looking only in 1 shard, how would I make it scan them all? Because the bot can't find the guild. This is my code:

    const reportArgs = msg.content.split(" ")
    const reportString = reportArgs.slice(2).join(" ");

    if(msg.content.startsWith(prefix + " bugreport")) {

        const embed = new Discord.RichEmbed()
        .setAuthor(`Bug Report:`, `${message.member.user.avatarURL}`)
        .setDescription(`**Member:** ${message.member.user.username}#${message.member.user.discriminator} (${message.author.id})\n**Report:** ${reportString}`)
        .setColor(0xff0000)
    
    client.guilds.get("399121674198581248").channels.get("416611377554391091").send({embed});
    
    
        const secondembed = new Discord.RichEmbed()
        .setTitle(":white_check_mark: Successfully sent Bug Report!")
        .setDescription("Thank you for reporting a bug, your message will now be sent to the developers so they can fix it ASAP!")
        .setColor(0x32CD32)
        msg.channel.send(secondembed);
    }```
frank girder
#

<@&265158261945270273> <@&264889767072628742> How do i get my bot online

quiet bobcat
#

Well you don't ping all the staff

frank girder
#

Well can you help me

steel heath
#

Oh my god.

quiet bobcat
#

What library?

frank girder
#

?

quiet bobcat
#

What language?

frank girder
#

Eng

quiet bobcat
#

Programming language

frank girder
#

wait did i haft to set the lang

quiet bobcat
#

Well, you need to choose a lang first

frank girder
#

I Need help can you walk me though this

#

Can i edit my bot?

quiet bobcat
#

?

#

wym

frank girder
#

Like make changes to it

quiet bobcat
#

You need to choose a language first

#

and then a library

#

and then you can make changes

#

Beginner languages are python and javascript

frank girder
#

I made the bot already its just offline

#

I Just made it

quiet bobcat
#

Well, to make it online you need a language and a library

frank girder
#

Can i edit my bot

quiet bobcat
#

Not without a language and a library

#

jesus christ

low rivet
#

do you know any programming language?

frank girder
#

No

low rivet
#

then learn one

uncut slate
#

@topaz fjord nope, both websites running on port 80 on their domains, with just one IP

#

and I'm not using cloudflare

#

it's just apache and express

earnest phoenix
#
    db.Database_Open('1234567890').then(i => { // Gets the Information on the Database of ID: 1234567890
        console.log(i); // Returns { id: '1234567890', value: 0, text: '' }
    });```
#

this returns a Promise<Object> right?

uncut slate
#

what does

jagged birch
#

How do I find a guild if Iโ€™m grabbing it by id if I have shards, cause itโ€™s not picking up my server as itโ€™s in the other shard. Using discord.js

warm halo
#

anyone have a moderation bot files?

#

i want to make some discord moderation bots

#

like kicking, or banning

heady zinc
#

write it yourself facepalm

warm halo
#

๐Ÿ˜ฆ

#

pls

#

can i have a app,js file pls

#

?

#

just one

heady zinc
#

what the heck is a app.js file

warm halo
#

bot launcher

#

-_-

#

main

heady zinc
#

you realize life doesn't work like that right

earnest phoenix
#

@warm halo <member>.kick("why(reason)") or <member>.ban("why(reason)")

warm halo
#

yeah like that

#

cuz my music file does'nt

#

has a moderation

earnest phoenix
#

let member = message.members.mentions.firts();
member.<kick or ban>("Reason")

#

.-.

warm halo
#

hmm

#

lemme test

earnest phoenix
#

add the .catch(err=>console.log(err)

heady zinc
#

oh also spoon-feed is forbidden

#

you might want to know that before continuing any further

earnest phoenix
#

let member = message.members.mentions.firts();
member.<kick or ban>("Reason").catch(err=>console.log(err)

@warm halo

warm halo
#

wow

#

are u helper??

earnest phoenix
#

No

#

I just joined today

#

lol

heady zinc
#

inb4 u get banned today kappalul

earnest phoenix
#

did i see a kappa?

#

no

heady zinc
warm halo
#

omg

earnest phoenix
#

epilepsy

#

xddd

#

for the nitro-less

heady zinc
#

i feel ya

earnest phoenix
#

hm..

#

change your discrim... lol

heady zinc
#

hell no

earnest phoenix
#

i hate mine...

heady zinc
#

i hate the discrim changer

gusty topaz
earnest phoenix
heady zinc
#

just killed any way to uniquely identify a user with a human-readable way

gusty topaz
#

I keep my name and avatar

earnest phoenix
#

I already change my discrim

heady zinc
#

that's because ur a scrub rph

gusty topaz
#

Im always an RGB turtle and Rph

#

No u

heady zinc
#

no im a baguette

earnest phoenix
#

๐Ÿฅ–

heady zinc
earnest phoenix
#

xD

#

btw i am french

gusty topaz
earnest phoenix
#

xd

#

thinking baguette?

heady zinc
#

oh fck

earnest phoenix
heady zinc
#

french peeps need to get banned

earnest phoenix
#

nu

heady zinc
earnest phoenix
#

):

quiet bobcat
radiant basin
#

Interesting development conversation you guys have here.

gusty topaz
#

Nothing

earnest phoenix
#

idk

#

xD

heady zinc
earnest phoenix
#

yes very developing

quiet bobcat
heady zinc
#

move urself

earnest phoenix
#

bot.guilds.size

#

xd

earnest phoenix
#

b!nsfw-gif

gusty topaz
#

Hmm

#

Bots only work in testing channels

earnest phoenix
#

b!nsfw-gif

gusty topaz
#

Did you even read what I said

pastel lynx
#

hey does anyone know a good hosting things thats free or below ยฃ5

uncut slate
#

Google Cloud trial, Digital Ocean w/ GitHub student pack are really good free options

#

Vultr and DO are pretty good too

bitter sundial
#

$5 > ยฃ5

#

if you can't get a student pack, you can register and wait and you'll get $10 free from do and $20 from vultr

earnest phoenix
#
    print("User {} is using the command kick".format(ctx.message.author.name))
    role_names = [role.name for role in user.roles]
    if ctx.message.author.id == ctx.message.server.owner.id or "Veruta_Commander" in role_names:
     try:
         await bot.kick(user)
         await bot.say("User {} was kicked!".format(user.name))
     except discord.Forbidden:
         await bot.say("FORBIDDEN (status code: 403): Privilege is too low... :cry:")
     except:
        print("hi")
    else:
        await bot.say("You do not have permmision! This command is ristricted to {}".format(ctx.message.server.owner.name))```
#

What am I doing wrong?

#

I have the role but it doesn't work

#

Give me a sec.

#

Error is: Line1: Unexpected identifier

#

@earnest phoenix

#

Mk

#

@earnest phoenix

#

How so

#

i dont get that error

#

Hmm...

#

I'm not sure then.

#

k doesnt matter

#
  let mod_role = message.guild.roles.find('name', settings.modrolename);
                               ^

TypeError: Cannot read property 'roles' of null``` Any help?
gusty topaz
#

Ehm

abstract mango
#

you don't have a guild

gusty topaz
#

@earnest phoenix that code is python not js

abstract mango
#

the guild is null

gusty topaz
#

TypeError isn't very pythonic

abstract mango
#

he wants help with js

#

lol

gusty topaz
#

Oh

abstract mango
#

also TypeError does exist in python

gusty topaz
#

Oh

earnest phoenix
#

Welp any help though?

#

Or you all just clicked off?

uncut slate
#

the guild object is null

#

try thinking of scenarios where you receive a message that isn't in a guild

abstract mango
#

^ exactly what I told this dude lol

mental willow
#

Yo can someone help me i am dion a Python bot and i can't seem figure out what the code is for ping

hushed oyster
#

๐Ÿคฆ

mental willow
#

what

#

@hushed oyster

#

i asked for help can you help

hidden fern
#

Hi

#

Who know how to arrest_logs

fleet mason
#

guys how do i make this first code only take out the mention

#
  let text = args.slice(1).join(" ");```
mental willow
#

can someone help me

this is coming up as an error

async def pingtest(ctx): 
    now = datetime.datetime.utcnow() 
    delta = now-ctx.message.timestamp
    await client.say('{}ms'.format(delta(microseconds=1)))```
topaz fjord
#

This place is cancer rn

fleet mason
#

XD

abstract mango
#

@mental willow wHAT EVEN IS THE ERROR

#

if we don't have the error we can't help

#

lol

mental willow
#

ok one second @abstract mango

inner jewel
#

@mental willow that's not how you calculate ping

#

start = now()
message = await sendmessage()
elapsed = now() - start
message.edit(elapsed + " unit")

mental willow
#

@abstract mango

async def pingtest(ctx): 
    now = datetime.utcnow() 
    delta = now-ctx.message.timestamp
    await bot.say('{}ms'.format(delta(microseconds=1)))```

when this command is executed the console brings up an error saying that 

 await bot.say('{}ms'.format(delta(microseconds=1)))

then has this as another error
glossy sand
#

what the heck do you expect delta(milliseconds=1) to do

abstract mango
#

you're subtracting now minus the timestamp

#

that isn't going to return a function

sour robin
#

How do I use this bot?

umbral pelican
#

seduce it

gusty topaz
#

ask him out

#

give him flowers

slim heart
#

i have a bot that censors, and when you curse it responds with "You can't say that" and it deletes the curse message, How would i make the bot delete the "You can't say that" after like 3-5 seconds...

#

I cant do a second message.delete

#

so idk what to do

elder rapids
#

sentMessage = message.send() ??

#

psuedo code

inner jewel
#

thing = sendmessage()
wait(5 seconds)
thing.delete()

elder rapids
#

That works too

slim heart
#

right

#

thanks guys

#

wait

#

@inner jewel confused, do i put thing = sendmessage(message)

inner jewel
#

you don't copy paste that

#

you understand what that means

#

and write the equivalent in actual code

slim heart
#

i dont really understand what that means ๐Ÿ˜ฎ

#

i tried making my message.reply("blah") into the variable

#
     nomsg.delete()```
gusty topaz
#

ahhh

#

your issue is you are trying to delet a promise

#

not an actual message

#

you need to await message.reply

#

but the code needs to be in an async function

slim heart
#

soooo...

#

(this is a guess)

await message.reply()
#

nvm

#

i stopped half way

#

that's not right

#

i have no idea what I'm doing xd

#

idk

abstract mango
#

await message.reply("blah")

slim heart
#

then what

#

how do i set it to "thing"

abstract mango
#

thing = await message.reply("blah")

#

gg ez

slim heart
#

thats not a thing tho

gusty topaz
#

lang?

abstract mango
#

js

#

iirc

gusty topaz
#

exactly

#

in modern js

slim heart
#

ahh

gusty topaz
#

you can make the function async

slim heart
#

async function

gusty topaz
#

it needs to be an async function

#

not a normal one

slim heart
#

how, exactly...

gusty topaz
#

then you can await promises

inner jewel
#

thing = (async()=>await message.reply(""))()

gusty topaz
#

async function blargh() { code(); }

#

NO!

#

natan stop

#

client.on('message', async (message) => {
// your shite
thing = await message.reply("blurgh");
});

#

this is async function

#

now adjust it for your code

#

i've given you enough

inner jewel
#

async message >>>>>>> async (message)

slim heart
#

ah, wait, if i make it async will it effect the rest of it?

#

like everything else in the client.on(awseSadsdasdasd(asdasd){ HERE})

gusty topaz
#

no

slim heart
#

k

#

yay

#

it works ๐Ÿ˜„

#

now, im guessing wait(blah seconds) isnt actually a thing

earnest phoenix
#

no

#

setTimeout

#

search this on google

hushed oyster
#

Am I allowed to ask about CSS here?

trim plinth
#

it's development so go ahead

earnest phoenix
#

Hey is it possible to create a bot using a phone?

#

huhhhhhhhhhhh

#

I don't have my computer rn

#

Oh okay thanks

gusty topaz
#

android?

#

you can download a terminal emulator

#

install node

#

npm

#

and nano

#

and code away

inner jewel
#

and stackoverflow is your ctrl + c

earnest phoenix
#

There's also DoryJS

#

It's on Google Play store.

#

free.

earnest phoenix
#

guys

#

dudes

#

how can i take the main color in the avatar of a user

#

in node js

trim plinth
#

no spoonfeed zone

gusty topaz
#

Download avatar

#

Average all the colors

#

Done

#

Its no rocket science

#

Make sure you handle animated avatars properly

signal oar
#

Hello guys

pale light
pastel lynx
#

n!servercount

#

Hmmm

uncut slate
quiet bobcat
#

^

restive silo
#

@austere meadow @earnest phoenix does anybody know why my lavalink doesn't play audio when i send a play op code? it logs ```lavalink_1 | [21:30:01] [ INFO ] [SocketServer] {"op":"voiceUpdate","guildId":"199857240037916672","event":{"token":"5d
2654571145be91","guild_id":"199857240037916672","endpoint":"eu-central926.discord.gg:80"},"sessionId":"c07dc3d4a45e9ca9f
8fe42690a8d4e27"}
lavalink_1 | [21:30:01] [ INFO ] [JDAA] Audio System successfully setup!
senpai_1 | 21:30:13 - info: [Shard:0] [Command] Yukine#8080/184632227894657025 (@warm fox play ytsearch
:moms sphaghetti)
lavalink_1 | [21:30:13] [ INFO ] [[/]] Initializing Spring FrameworkServlet 'dispatcherServlet'
lavalink_1 | [21:30:13] [ INFO ] [DispatcherServlet] FrameworkServlet 'dispatcherServlet': initialization started
lavalink_1 | [21:30:13] [ INFO ] [DispatcherServlet] FrameworkServlet 'dispatcherServlet': initialization completed in
36 ms
lavalink_1 | [21:30:13] [ INFO ] [AudioLoaderRestHandler] GET /loadtracks
lavalink_1 | [21:30:13] [ INFO ] [GarbageCollectionMonitor] GC monitoring enabled, reporting results every 2 minutes.
lavalink_1 | [21:30:14] [ INFO ] [AudioLoader] Loaded playlist Search results for: moms sphaghetti
lavalink_1 | [21:30:14] [ INFO ] [SocketServer] {"op":"play","guildId":"199857240037916672","track":"QAAAkwIAKEVtaW5lbS
AtICJNb20ncyBTcGFnaGV0dGkiIChNdXNpYyBWaWRlbykAEUpheSBHcmVlbidzIHN0dWZmAAAAAAAEPfAAC1NXLUJVNmtlRVV3AAEAK2h0dHBzOi8vd3d3Ln
lvdXR1YmUuY29tL3dhdGNoP3Y9U1ctQlU2a2VFVXcAB3lvdXR1YmUAAAAAAAAAAA==","startTime":0,"endTime":0}

earnest phoenix
#

d.js?

#

@restive silo

restive silo
#

yes but i use a custom library to interact with lavalink from appelation

#

i forword all stuff correct and it seems to get everything correct but like it doesn't play

earnest phoenix
#

saw that a few min ago, looks nice

restive silo
#

ye

#

but it doesn't play KonataCry

earnest phoenix
#

@warm fox play ytsearch
:moms sphaghetti

#

is that what you inputed?

restive silo
#

yes

earnest phoenix
#

oof

restive silo
#

?

#

thats only for testing i will make it better

inner jewel
#

you can try asking fred

#

in #lavalink

earnest phoenix
#

oh okay XD uh anyway im not too sure

restive silo
#

in #lavalink? Thonk which server

#

๐Ÿ‘€

inner jewel
#

wait

#

lavaplayer*

restive silo
#

oh

#

hmm

inner jewel
#

which also became lavalink support

restive silo
#

oh it does?

inner jewel
#

not officially but that's where people go ping fred for help

restive silo
#

wew

#

i dont wanna do that tbh

inner jewel
#

cc @ kromatic

restive silo
#

i will just ask in freds server i guess

earnest phoenix
severe socket
#

guys

#

might sound like a dumb question, but

#

how can we use the webhooks the API sent to do something like giving a role when someone vote?
I mean, how to make the bot listen to the post request sent by the API?

earnest phoenix
#

Idk what you mean

fair verge
#

hes french

severe socket
#

why are you linking me to d.js docs lmao

fair verge
#

what he's asking is, how we're supposed to set up a webhook which in the end gives a user which upvoted our bot a role in the server

#

is there a guide or something?

gusty topaz
#

Read up on express

pastel lynx
#

Can someone help me with my API for discord. Py

severe socket
#

Okey wasn't sure

#

so we just need express that's fine. Never done that before

gusty topaz
#

You need to run a http server on your boat

#

Essentially

severe socket
slim heart
#

how do i make the message double wide

#

like

there
hi```
#

not there hi

gusty topaz
#

there\nhi

slim heart
#

thanks

gusty topaz
#

Assuming it's in code

slim heart
#

ye

#

thanks

gilded blaze
#

How would I access require.cache from the main file in a module?

uncut slate
#

require.cache is global

#

not per-file

gilded blaze
#

wtf

#

oh i was looking at the wrong line

#

i hate bugs

topaz fjord
#

anyone one here with dealing with message edits with d.js

pale light
#

Hi

#

what u need

earnest phoenix
#
Hi
There
frail terrace
#

how do I uhhhh stream youtube videos

austere meadow
#

@topaz fjord yessir

#

loris too

#

@frail terrace use ytdl-core

frail terrace
#

wot

#

dl means download

abstract mango
#

or lavalink

#

ยฏ_(ใƒ„)_/ยฏ

austere meadow
#

well

#

you're kinda streaming with ytdl-core

frail terrace
#

my current setup works but i don't wanna have to download

#

and i'm using c# btw

austere meadow
#

you will always have to download no matter what, but ytdl-core works by downloading videos chunk by chunk, which is essentially what streaming is

#

and ok you're using c# so all those options go down the drain

frail terrace
#

oh well

earnest phoenix
#

guys can you help me?.

frail terrace
#

with what

austere meadow
#

in all honesty im not really sure, sorry @frail terrace

frail terrace
#

oh well

earnest phoenix
#

how replace to ```
`

this text  in nodejs
austere meadow
#

it might be best to google other projects that use music with c#

frail terrace
#

?

#

@earnest phoenix

earnest phoenix
#

?

austere meadow
#

.replace("`", "") blobwaitwhat

earnest phoenix
#

so im doing that

#

but it didn't work

topaz fjord
#

@austere meadow wut

austere meadow
#

you wanted help with message edits

topaz fjord
#

oh

#

so

#

i get the part with remiting the message event when i edit a message

#

but

#

if i edit my message while using eval how would i be able to edit the bots message @austere meadow

earnest phoenix
#
    if(yoklist.some(word => message.content.replace(/\s+/, "").replace(/\s+$/g, "").replace(/\n/g, "").replace(/\r/g, "").replace("`","").includes(word))) {
        message.delete();
        message.channel.send("omg");
    }```
#

but it didn't replace ` this text

topaz fjord
#

beacuse you cant

#

iirc

austere meadow
#

you would need to use .then on the bots message
so

//message is your message
message.channel.send().then(botmessage => {
botmessage.edit() //botmessage is the bots message
})
earnest phoenix
#

ok thx

austere meadow
#

@earnest phoenix try putting a slash behind it

#

to escape it maybe

earnest phoenix
#

ok

#

ok thx!

frail terrace
#

:thonk:

bright karma
#

in discord.js how would I get how many guilds are in each shard?

gilded blaze
#

shard.manager.fetchClientValues

bright karma
#

yea I tried that before but when I use it, it returns 0 guilds

bright karma
heady zinc
#

do you await it

bright karma
#

no, I didn't

heady zinc
#

so yeah you may want to wait for the result to be gathered before trying to read it

bright karma
jagged birch
#
  client.shard.broadcastEval('this.guilds.size').then(results => {
  console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`);
});```
@bright karma
bright karma
jagged birch
#

don't await

#

it works for me

#

at the bottom of the logs it prints the server count.

daring mulch
#

@jagged birch

jagged birch
#

???

echo shadow
#

@unborn stone that's gay

tawny lava
#

i am gay

#

i leik gay

shadow hollow
#

so like

#

when do you know whennn your bots been approved

glossy sand
#

@shadow hollow you'll get a DM from our magical bot @gilded plank

#

also can y'all get out of this channel if you're not adhering to the topic

shadow hollow
#

lol

olive ridge
glossy sand
#

upload a file as an attachment

olive ridge
#

oooh yes

#

thx lol

olive ridge
#

MORE ERRORS

#

lol

#
client.on("message", (message) => {
  if (!message.content.startsWith(config.prefix) || message.author.bot) return;
  
  if (message.content.startsWith(config.prefix + "ton")
    message.channel.send({
    file: "https://cdn.discordapp.com/attachments/409886899914932224/417223891023298561/asston.png"
    })
  } else

//more code
#

Returns

#
C:\SoupyBot\bot.js:66
        message.channel.send({
        ^^^^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:607:28)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
#

I tried doing this:

#
client.on("message", (message) => {
  if (!message.content.startsWith(config.prefix) || message.author.bot) return;
  
  if (message.content.startsWith(config.prefix + "ton")
    message.channel.send({
    file: "https://cdn.discordapp.com/attachments/409886899914932224/417223891023298561/asston.png"
    });  //<--- Semi colon
  } else

//more code
#

Didnt help

#

NVM

#

IM JUST STUPIF

frail kestrel
#

./filename.ext

#

not url

#

also remove the () from your message parameter

#

it'll work without it

prime cliff
#

Does anyone know how to use javascript httprequests in DBL bot pages im trying but i keep getting network errors ik that Donut did it with his bot page but he hasnt been on in awhile

olive ridge
#

no it worked

#

i forgot

#

the

#

( {