#development

1 messages · Page 589 of 1

near aurora
#

lol youre the one whos not thinking

spare glen
#

i have never done this

#

dont bully

near aurora
#

yeah but u didnt read the errors and youre not thinking

spare glen
#

stop

#

im trying

near aurora
elfin vale
#

why not just delete them through the site or somethin?

lunar topaz
#

Question about an issue with login features to bot for games

near aurora
#

It depends

#

do you want to remove the files from git or not

spare glen
#

@elfin vale i cant delete them

near aurora
#

Why

#

you definitely can

lunar topaz
#

So ive been playing certain games and it asks me to login to vote for a game so i get my ingame currency

elfin vale
#

try just committing (not pushing) then rming the files

lunar topaz
#

however it wont let me sign it with my main account it only lwts me sign in with my alt why is that or how can i change that?

tawdry swift
#

Log out of discord on your browser

#

And try again

spare glen
#

no, look i have this setup rn. I code on VSC, and push to github, and import from github to my "vps" thats it. But when i code again on VSC and before i push, i gotta take the JSON files on my "vps" and copy paste them on VSC and then push so poeple dont get different money. I wanna ignore these JSON files, so that the files on my "vps" doesnt get changed

#

@elfin vale

mossy vine
#

add them to .gitignore, if the files are already on the github repository, manually delete them from there

elfin vale
#

are the files on github rn?

spare glen
#

i cant delete them cuz then they will be deleted from my "vps"

elfin vale
#

they should be ignored through .gitignore

#

why would they get deleted through your vps if you are deleting them on github?

spare glen
#

if i put them on .gitignore, woont it put them on .gitignore on my "vps"

elfin vale
#

i don't rly get what you mean, no?

lunar topaz
#

@tawdry swift

#

i only use discord on my phone

elfin vale
#

your files aren't going to be ignored. they just won't be pushed to github lol

spare glen
#

@elfin vale can we dm so i can acctually show u

elfin vale
#

ok sure

quartz kindle
#

How do you import them from github? Whatever youre using in your vps to do this, thats where you should set it not to import the json files

lunar topaz
#

So i have to use a computer to sign into my main account...thats kinda dumb.

#

Because mobile doesnt have access to changing the accounts if its connected to one already

#

oof.

ruby dust
#

it's a website

#

if it's on phone like that then it's the same everywhere else

silk girder
#

i think i fixed my bot responding to to other bots...

#

would this fix my bot responding to other bots xd maybe

pliant copper
#

it should

silk girder
#

hopefully

earnest phoenix
#

Hey does anyone know how to make your bot leave every server its in? Im using discord.js

pliant copper
#
    guild.leave;
}); ```
earnest phoenix
#

forEach

pliant copper
#

should do the job

earnest phoenix
#

Oh i'll try that, thank you

#

Lol but why?

#

Xd

#

its in a hacking server

#

What?

#

What is an hacking server?

pliant copper
#

why not only remove that server lol

earnest phoenix
#

Yup

#

No clue how

pliant copper
#

lol do you have the guild id?

earnest phoenix
#
client.guilds.forEach(guild => {
if(guild.id === id) {

    guild.leave;
}
}); 
#

I got the server ID

pliant copper
#

client.guilds.get("GUILD ID").leave

earnest phoenix
#

Or ^

#

I'll try that, thank you

#

didnt seem to work

pliant copper
#

any errors?

earnest phoenix
#

also no errors for some reason

pliant copper
#

where did you put the code?

earnest phoenix
#

in index.js

pliant copper
#

try putting it in client.on("ready") part

earnest phoenix
#

hmm still no result

pliant copper
#

try my thing than

#

client.guilds.get("GUILD ID").leave

#

oh wait I know why it doesn't work

#

client.guilds.get("GUILD ID").leave() try this

earnest phoenix
pliant copper
#

lol you sure your bot is still in that server?

earnest phoenix
#

yeah im sure

#

let me test on another server

#

ah it worked, finally, thanks for your help

#

Try by .find

pliant copper
#

yeah you could have also done it with client.guilds.find(g => g.id === "ID").leave()

#

nice

#

np

earnest phoenix
#

does anyone know a good tutorial to add music to a bot

amber fractal
#

Why did you use find when you had the id

#

That is pointless

zealous veldt
#

You can just use ```js
let guild = client.guilds.get("<ID>");
guild.leave();

quartz kindle
#

Or you can save a couple bytes by not creating a variable lul

hushed berry
#

thats really just nitpicky 🤷

ruby dust
#

hm, what's the best way to keep track of guild modlog cases if I'm using sqlite database

#

I was thinking of using count() to return the amount of cases the guild already has, is that efficient enough?

last ferry
#

Anyone know why my bot randomly stopped logging in

#

Like when I start it it just gets stuck on the version number and doesn’t connect to the api

#

And I didn’t update the code or anything it just randomly stopped

amber fractal
#

Sometimes iscord auto resets tokens

#

check your token

last ferry
#

bruh

amber fractal
#

What

#

ok delete

bright spear
#

Honestly if someone says "bruh" they're probably not interested in actually getting help

earnest phoenix
#

you might've gotten ratelimited

#

if you disconnect and reconnect too often

#

bots with under 100k guilds are restricted to 1000 IDENTIFY a day

ruby dust
#

isn't that for every bot?

near aurora
#

A whole 1000

wooden prawn
#

Sometimes discord auto resets tokens

You're kidding, right?

#

IK I'm like 30 mins late

zealous veldt
#

In reference to the snippet I posted above: I know you can accomplish it without creating a variable, I just did it that may to make it more understandable.

bright spear
#

@wooden prawn no 🤔

wooden prawn
#

Why is that a thing that happens? Couldn't that break a lot of bots?

bright spear
#

yes and it does

wooden prawn
#

Again, why is that a thing?

amber fractal
#

Abuse

bright spear
#

well it intentionally resets after 1000 connects in a day

#

but often that happens when discord breaks

#

or discord will just glitch and reset it

#

the api isnt exactly stable all the time

amber fractal
#

Never would be a better word for that

inner jewel
#

i've never had my token reset

#

discord only resets on too many IDENTIFYs

#

if your lib breaks and gets into a reconnect issue when discord has issues, it's the lib's fault

rugged linden
#

What is the minimum time that is aloud for the game the bot is playing to change?

junior summit
#

I got this ```(node:6128) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access
at item.request.gen.end (C:\Users\chill\Desktop\chill\discord-bot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:79:15)
at then (C:\Users\chill\Desktop\chill\discord-bot\node_modules\snekfetch\src\index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)

#
(node:6128) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:6128) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access
    at item.request.gen.end (C:\Users\chill\Desktop\chill\discord-bot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:79:15)
    at then (C:\Users\chill\Desktop\chill\discord-bot\node_modules\snekfetch\src\index.js:215:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:6128) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:6128) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access
    at item.request.gen.end (C:\Users\chill\Desktop\chill\discord-bot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:79:15)
    at then (C:\Users\chill\Desktop\chill\discord-bot\node_modules\snekfetch\src\index.js:215:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:6128) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not hand```
#

i think its because the bot doesnt have perms like the user removed it

#

or something

amber fractal
#

yep

#

you should be catching at places like that

junior summit
#

is there documentation

#

for writing an if statment

amber fractal
#

}```
earnest phoenix
#

if(gay) return uber.send(your.number)

#

and thats a fax

#

a game fax

#

thanks for watching

junior summit
#

is this a good site

earnest phoenix
#

what

#

are you trying to do

junior summit
#

make a if statment

#

that says

#

if someone removes perms

earnest phoenix
#

what language

junior summit
#

discord.js

earnest phoenix
#

you can just add checks to the commands to prevent crashes

#

for kick and ban commands you just need to send and error if it doesn’t have the permission

junior summit
#

yeai did that

earnest phoenix
junior summit
#

yea i do that

#

but they removed the perms

#

of the bot

#

so it cant do anything

amber fractal
#

yeah, you can check perms

#

if no perms

#

return

earnest phoenix
#

okay so you can still send a message when they use a command with no perms

bright spear
#
if(!message.guild.me.hasPermission('KICK_MEMBERS')) return message.channel.send('i don\'t have kick perms u meme')```
junior summit
#

yea i did that

#

i am saying

#

like perms for bot

amber fractal
#

yes

bright spear
#

Yes

#

That's what that does

amber fractal
junior summit
#

oh epic

bright spear
#

It checks if the bot has perms

earnest phoenix
#

advaith

#

thats invalid

#

syntax

#

you gotta \'

#

you nerd

bright spear
#

Really

#

Wdym

#

Oh fuck

earnest phoenix
#

noob

bright spear
#

Fixed

amber fractal
#

or put it in double quotes

bright spear
#

I just typed that out on mobile

amber fractal
#

you meme

bright spear
#

Ew double quotes

earnest phoenix
#

^

#

i litterally only use

#

' or `

bright spear
#

Double quotes are for English not js

#

Same

amber fractal
#

you are all memes

bright spear
#

No u

amber fractal
#

send("hi")

earnest phoenix
#

send('hi') > send("hi")

bright spear
#

Yes

amber fractal
#

I'd rather not escape every single quote

#

kthx

earnest phoenix
#

oh yea your on a phone

amber fractal
#

What?

#

Not right now

earnest phoenix
#

oh

#

i dont see the problme then

amber fractal
#

but send("don't") > send('don\'t')

#

you have to escape the single quote

earnest phoenix
#

its litterally one character

amber fractal
#

one more byte of storage mmLol

earnest phoenix
#

ill tell you what

#

if im short of 1 byte exact

#

ill make sure to star switch over

amber fractal
#

it's like adding semi colons

#

waste of space

#

you're being less productive

#

I've proven this scientificly

marble needle
#

except not adding semicolons is literally inviting unintended behavior to happen depending on your coding style :>>>

#

plus you're gonna get fucked for it in anything that isn't js

amber fractal
#

Sure if you code a 1 line bot

last ferry
#

so i changed my bot's token to the new one discord changed it to and now my bot starts fine on my pc but it still gets stuck when i try to run it on my vps

amber fractal
#

No, I also use java I know how it feels to be forced to use semi colons

#

waste of time

bright spear
#

Lol semicolons in js

#

@last ferry explain, what exactly happens

marble needle
#

you people are tripping if you aren't using semicolons

amber fractal
#

CLearly not

#

I dont use semicolons

bright spear
#

Same

amber fractal
#

My dbl lib doesnt use semicolons either

#

ggez

marble needle
#

glhf doing that in any professional environment with project guidelines

amber fractal
#

I dont work with other people

bright spear
#

Same

amber fractal
#

besides uber, he doesnt use semicolons either tho

#

so I'm good

bright spear
#

And when I do, I'm one of the main devs

last ferry
#

so i tried running my bot on my vps a few hours ago, and it got stuck on the version number, never got to like Connecting... or anything. I checked the discord page for it and noticed that the token was changed. So i went into my code, updated the token, and tested it on my pc to make sure it worked, and it connected fine. But once i move my files to the vps, it gets stuck on the version number again and refuses to connect to discord

bright spear
#

And I can do whatever I want

#

What exactly does it do

#

Does it log an error?

last ferry
#

no theres no errors or anything

#

it just gets stuck on like Discord.NET (2.0.1) or whatever

#

and like i said it runs completely fine on my pc

bright spear
#

Oh

last ferry
#

its the vps that makes it stuck

#

and its never done this before

#

so im confused

bright spear
#

I'm not sure if there are much people here who know d.net

last ferry
#

yeah ill have to go ask in the api discord

earnest phoenix
#

Good evening, it is possible to put a picture in the background of our presentation of our bot? if so can you give me the solution? please

amber fractal
#

Wdym

bright spear
lilac geyser
#

is it token invalid

bright spear
#

Probably

lilac geyser
#

Fuck

earnest phoenix
#

lol

earnest phoenix
#

hey. i need a little bit coding help...
i can code cmds an all but have no idea from the examples in #312614469819826177
can anyone help me a little bit?

#

thats was very nice 😅

zealous veldt
#

Are you asking how to post your server count? @earnest phoenix

earnest phoenix
#

yeah

zealous veldt
earnest phoenix
#

ok thank you :D#

zealous veldt
#

No problem

silk gust
#

It's not really development related but I didn't see a better place.

So I'll be releasing a new version my bot soon that will adversely affect the functionality of the current system, what i was wondering is if i wanted to release another version of my bot with a new ID that they could move to when they have time, Would i need to create a new bot on discordbots.org or could i have my current one updated?

fiery birch
#

you can ask that in general

#

but you'd have to make a new bot

silk gust
#

Thank you

wet wedge
#

in discord.js how would i make it so that if there is a ratelimit of some kind it would send the details about it in a channel, for example #ratelimits pm me if possible

amber fractal
#

Docs are a good thing

#

I wish more people read them

wet wedge
#

I did, but it didnt work

#

Lol

elfin vale
#

what didnt work?

wet wedge
#

Wait is it for like other api or discord's api like changing the game to fast?

high lava
#

@wet wedge I believe 15 seconds should be a safe value to go for if you want to have the status change over time

#

A lot of people do 10 seconds and it seems to be perfectly fine. I myself went to 8 seconds and also seems to be fine after a few months. This is out of my experience though

#

I'm not exactly sure where to get the exacts of the limits for status changes, but I know for the Discord Presence add-on in VSCode it seems to mention a 15 second limit

bright spear
#

That's only rich presence

#

And rich presence works differently from status updates

#

It runs locally on your computer

high lava
#

Well yeah. It runs locally

#

But nevertheless it still calls the Discord API in some way

#

But still, I'd go for 10 seconds at most with status changes to be safe

wet wedge
#

Ok

quartz timber
#

anyone working on or could work on a twitch to discord mirror chat bot? It is rare as dinosaurs when it comes to public bots.

bright spear
#

@high lava the application communicates with the discord client over RPC, and the client sends it to the API

quartz timber
#

its probably extinct

#

well besides botismo -_-

high lava
#

Is that not still an API call?

bright spear
#

Well I'm pretty sure the ratelimit is on the application-client connection

high lava
#

So how much is the limit on the normal status?

inner jewel
#

afaik you can update rich presence as often as you want

bright spear
#

No, only once every 15 seconds

inner jewel
#

but the client will only send new data to discord every 2s iirc

high lava
#

Yeah. I swear to has to be less than 15 unless Spotify has some VIP rate limits, because Spotify updates within a second a lot of the time

quartz timber
#

lt me know what you think from general

#

and this

#

I have a part of a code someone sent
client.on("message",(message)=>{tmi.send(message.author.name+":"+message.content});
Half the code done in one line lol
Would connect discord.js to tmi.js
Discord and twitch
Both have onMessage and SendMessage events
thats what he said, Apparently he had a private version

#

If you guys are working on this or could work on it let me know via dm please ive spent weeks trying to trackdown a public bot that does this the two bots dwitchcord and streamercompanion are down have a good night for now

obtuse vortex
#

Hi, I' m triying to create a command that shows an embed, and the bot will react with 2 emojis, left and right, in order to change pages of the embed. Does anyone know where can I find more information about this? Thanks : )

earnest phoenix
#

reaction collector

minor kelp
#

How to make my bot tell me how many people are using it

neat falcon
#

lib?

#

@minor kelp

minor kelp
#

Dpy

slender thistle
#

Show server count? amount of users the bot can see?

minor kelp
#

Server count I have

#

I want it so tell me how many users are using the bot

#

to*

neat falcon
#

wouldn't it be what you have for guilds but replace guilds with users?

minor kelp
#

Dm please

#

it dont clutter the chat as much

neat falcon
#

no dms are off, do it in hhere

#

doesn't matter too much

minor kelp
#

Ah, ok then

neat falcon
#

if it's too large put it on hastebin

minor kelp
#
@bot.command(name='users')
async def _users(ctx):
        return await ctx.send(f"{len(bot.members)} members.")

dont work

neat falcon
#

tried bot.users?

minor kelp
#

im playing xbox rn

#

ccan you see that

neat falcon
#

i can, but it makes it harder to help you if you can't test what advise we give

#

i can't test locally myself as i'm in school rn

minor kelp
#

let me test

slender thistle
#

.members is for Guild

#

.users is for Client

pallid zinc
#

how to add Rich-Presence

neat falcon
#

google

pallid zinc
#

nice idea

hybrid raptor
#

any good VPS's ?

#

like sites to buy

pallid zinc
#

VPS ??

hybrid raptor
#

yeah

#

i need to get one

#

Glitch aint cutting it

mossy vine
#

@PenguinxD ♡#1976 check pins

#

@hybrid raptor

hallow folio
#
if __name__ == '__main__':
    Setup().setup()

    for extension in settings.toggle_extensions:
        KonekoBot.load_extension("src.modules." + extension)
    for extension in settings.core_extensions:
        KonekoBot.load_extension(extension)

    # Dry run option for travis.
    if KonekoBot.dry_run is True:
        print("Quitting: dry run")
        close = loop.create_task(KonekoBot.close())
        loop.run_until_complete(close)
        loop.close()
        exit(0)

got this small piece of code implemented for travis-CI so i can test if my code works but recently my builds have been failing with this trace

Quitting: dry run
Traceback (most recent call last):
  File "KonekoBot.py", line 82, in <module>
    loop.run_until_complete(close)
  File "/opt/python/3.6-dev/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "/home/travis/virtualenv/python3.6-dev/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 210, in close
    await super().close()
  File "/home/travis/virtualenv/python3.6-dev/lib/python3.6/site-packages/discord/shard.py", line 293, in close
    await self.http.close()
  File "/home/travis/virtualenv/python3.6-dev/lib/python3.6/site-packages/discord/http.py", line 233, in close
    await self._session.close()
AttributeError: 'NoneType' object has no attribute 'close'
The command "python KonekoBot.py -t "TOKEN" -d 1" exited with 1.

using python ^3.6 + discord.py
anyone got some tips on closing the client session?

sinful lotus
#

@hybrid raptor Contabo

#

for 5 euro you get 8gb of ram and 4 cores, KVM vps as well

#

I tested them myself and hosted there for 4 months and we never had problems

quartz kindle
#

Ive heard bad things about contabo

earnest phoenix
#

Hey I need help

#

How do I make someone queue master??

#

Someone??

spring ember
#

Queue master? Wut

earnest phoenix
#

How do I make someone queue master on scrimius??

spring ember
#

is that a bot

#

If yes go to its support server

pallid zinc
#

hey

hybrid raptor
#

ty

earnest phoenix
#

Anyone know how to do the webhook stuff in js with dblapi.js? For me when i try webhook it just errors about the on thing
||```js
dbl.webhook.on('ready', hook => {
// stuff
});

#

oof

amber fractal
#

Why did you put that in a spoiler

earnest phoenix
#

cuz its a spoiler jk

#

kay

spare glen
#

could anyone help me

#

why doesnt it go all the way to the left too

#

please help

#

never mind

#

i got it

uneven pond
#

not working

document.getElementById("support").innerHTML = "Destek Sunucusu"
document.getElementById("report").innerHTML = "Bildir"
document.getElementById("websitelink").innerHTML = "İnternet Sitesi"
document.getElementById("edit").innerHTML = "Düzenle"
document.getElementById("github").innerHTML = "Github Sayfası"
document.getElementById("createdby").innerHTML = document.getElementById("createdby").innerHTML.replace(/Created By/, "Botun Yapımcıları")

document.getElementsByClassName("votebutton")[0].innerHTML = "Oy Ver"
document.getElementsByClassName("votebutton")[1].innerHTML = "Davet Et"
#

@inner jewel

inner jewel
uneven pond
#

what problem

hazy wolf
#

You need to elaborate on your issue, as saying "not working" provides no information on the issue you are experiencing.

spare glen
#

how would i make this open in a new page

harsh nova
vapid rune
#

step 1. google/duckduckgo cause that's even cooler

harsh nova
#

Littearly the first result

languid dragon
#

@uneven pond only certified developers can use javascript

#

also read the channel description next time, dont randomly @mention people for help

spare glen
#

@harsh nova thats a different one, that will not work

inner jewel
spare glen
#

i dont use window.open

#

i use fricking document.location.href = ""

vapid rune
#

do you actually need certification to use js?

inner jewel
#

how would i make this open in a new page

#

you can't with location.href="..."

#

so you need window.open

spare glen
#

I tried window.open

#

i cant get it to work

#

frick

inner jewel
#

read the docs i sent

spare glen
#

i did

#

i dont understand

languid dragon
#

then you're doing something wrong™

spare glen
#

no U

inner jewel
spare glen
#

it doesnt fricking work

languid dragon
#

where are you doing this?

spare glen
pallid zinc
#

Where to host bot

spare glen
#

what

pallid zinc
#

Any website to host bot

spare glen
#

?

pallid zinc
#

Vps

grim aspen
#

or you could just do it on an unused computer...

#

i mean leaving it running

pallid zinc
#

I can't

grim aspen
pallid zinc
#

My all pc are at work

#

I try on glitch but I cant

grim aspen
#

then vps

earnest phoenix
#

do not

#

use free hosting

#

period

quartz kindle
#

Cough... Google/amazon... Cough....

#

My free 12 months in google expired, now im paying uh.... Like 1$ per month?

pallid zinc
#

Tim thanks

#

My bot work

#

Now I only have to host

rugged linden
#

Uses glitch.com

quartz kindle
#

once again, google or amazon are great vps's and are free for 12 months

#

12 months is more than enough time to both test your bot's feasibility and save some money for another vps or to continue the service

earnest phoenix
#

even if, its not that expensive to pay for a vps, literally dont go to starbucks for one day and you already got enough money to pay a monthly vps

quartz kindle
#

exactly lmao, skip starbucks once a month and you got yourself a vps

keen turret
#
        [Command("echo")]
        public async Task sendEcho([Remainder]string UserMessage)
        {
           // execute some code...
        }

Is it possible to do something like [Command("")] so the bot listens to all messages?

arctic mountain
#

Oops

#

Ok no token leak bot here

earnest phoenix
#

is there a way to get a users username if my bot is not in any mutual servers to that user?

hushed berry
#

JDA#retrieveUserById

#

@earnest phoenix

earnest phoenix
#

dont use JDA

hushed berry
#

oh righht

#

i thought i was in jda

earnest phoenix
#

.JS

#

sorry i didnt specify it right

#

Cannot read property 'username' of undefined

#

^^

hushed berry
#

I believe

#

client.fetchUser

#

perhaps

earnest phoenix
#

ah right

#

ill try

hushed berry
#

yeah

earnest phoenix
#

[object Promise]

#

xd

hushed berry
#

?

earnest phoenix
#

i tried client.fetchUser(user.id).id

hushed berry
#

yeah?

earnest phoenix
#

gave e

#

object

#

promise

hushed berry
#

do you know what a promise is

earnest phoenix
#

yes

#

i got it

#

ty

#

@hushed berry

quartz kindle
#

a promise is something that makes people sad if you break it

earnest phoenix
#
const DBL = require("dblapi.js");
const dbl = new DBL('dbltoken', { webhookPort: 5000, webhookAuth: 'pass' }, client);

// Optional events
dbl.on('posted', () => {
  console.log('sended');
})

dbl.on('error', e => {
 console.log(`Error: ${e}`);
})

dbl.webhook.on('ready', hook => {
  console.log(`Webhook  http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('ready', hook => {
  console.log(`Webhook http://${hook.hostname}:${hook.port}${hook.path}`);
});

@zinc condor

#

try this

spare glen
#

Like i wanna use shards, but how would i do that because i already have port runing in my index file, so i have to connect them some how

#

help^^^^^^^^^^^^^

toxic forum
#

what does a shard and the HTTP port have to do with eachother?

spare glen
#

they collide

#

idk how

#

i get an error saying, the port is already at 3000

amber fractal
#

Youcant run two servers on the same port

spare glen
#

how

amber fractal
#

so only run the server on shard 0 then

spare glen
#

why would i do that

hushed berry
#

he literally just said why

amber fractal
#

Because you cant run 2 servers on the same port

hushed berry
#

or, you know, make your website separate from your bot

spare glen
#

cant have 0

hushed berry
#

shard id

amber fractal
#

no

hushed berry
#

not shard count

amber fractal
#

Lol

hushed berry
#

😑

amber fractal
#

<Client>.shard.id == some id

#

or what nik said

spare glen
#

how do i do that

#

wtf

hushed berry
#

seriously

spare glen
#

yes

amber fractal
#

<Client>.shard.id

hushed berry
#

just dont have your bot and the website in the same process

spare glen
#

i dont understand

amber fractal
#

I think it may be his vote handler

spare glen
#

maybe

hushed berry
#

look at the route he defines

amber fractal
#

what does the web server do?

#

Oh I didnt look at the code :)

spare glen
#

this is the error

hushed berry
#

yes, we realize

spare glen
#

k

#

what do i do

#

i dont understand

hushed berry
#

we've given you multiple ways to fix it friend

amber fractal
#

wait is that the only thing in your index file?

spare glen
#

well, i said i dont understand

hushed berry
#

The most obvious way is to separate your website from your bot

spare glen
#

@amber fractal no

dusky marsh
#

Just use a different port

spare glen
#

how do i change the port for shards

amber fractal
#

...

hushed berry
#

That doesn't solve the underlying problem

amber fractal
#

you cant lmao

#

you just run it on 1 shard, or make the bot and the website different

spare glen
#

how tf do i do that

hushed berry
#

There's no reason for them to even be in the same code

amber fractal
#

you can run things on certain shard id's

dusky marsh
#

Wait, I didn't read all the messages what even is he doing

amber fractal
#

and what nik said

hushed berry
#

He's running separate shards

#

and the shards each are trying to run a website on port 3000

dusky marsh
#

Ah

#

Y tho

spare glen
#

so plz tell me what to do, dont tell me we already told ya mate

amber fractal
#

your bot code and the code for your website shouldnt be in the same file tho

hushed berry
#

Take your website code

spare glen
#

yeah

#

and

hushed berry
#

and separate it

amber fractal
#

take code
put code in new file
node file.js

spare glen
#

do i name the new file file.js

amber fractal
#

it can be whatever you want

spare glen
#

and done

amber fractal
#

if that's all the code for your website yea

hushed berry
#

also

#

are you running this on like

#

glitch or smth

#

heroku

spare glen
#

glitch

hushed berry
#

sigh

#

Yeah, go with tarp's solution then

spare glen
#

kk

#

so just add the website code in a different file

#

and done

hushed berry
#

idek man

#

cos glitch is garbage

spare glen
#

no U

#

its godly

languid dragon
#

no

hushed berry
#

hi ken

spare glen
#

tell me why

amber fractal
#

How's that uptime robot

spare glen
#

good

#

wdym

languid dragon
#

could you imagine if DBL was hosted on glitch?

amber fractal
#

@languid dragon It isnt? mmLol

hushed berry
#

the fact that you have to trick your host into thinking that your bot is a website should be a red flag

#

and that its being "actively used"

spare glen
#

but i need the webstuff in index.js cause of the vote thing

#

the vote thing is listening on the listener

hushed berry
#

The issue is with your structure

#

There's no magical solution here

spare glen
#

so i cant have sharding

#

great

#

thanks

hushed berry
#

What do you want me to do? Wave my wand and say that everything is fixed?

spare glen
#

what do i want you to do, i want you to dont be mad and sacrastic, thats 1

hushed berry
#

I'm not mad, friend

spare glen
#

ok mate

#

so what do i do then

hushed berry
#

Well, what do you do with the votes?

spare glen
#

hehe

#

i have it so every time someone votes it sends in a channel

#

...

hushed berry
#

Does it use a webhook rn?

#

A Discord webhook, I mean

#

not a DBL webhook

spare glen
#

no

#

it just sends in a channel

hushed berry
#

That's the path I would go

spare glen
#

the bot sends it

#

so what

#

can i have the vote thing in the other file aswell

hushed berry
#

That's what I would do

#

Separate out the vote handler and make it use a discord webhook instead of sending through the bot

spare glen
#

this will work right

#

it will take my bot thing in the index and put it in this file

#

so now bot.guilds.size works etc

hushed berry
#

I don't know

spare glen
#

lol

#

k

#

yeah, it worked

junior summit
#

for some reason i got this error

#
    throw err; // Unhandled 'error' event
    ^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
    at Client.emit (events.js:178:17)
    at WebSocketConnection.onError (C:\Users\chill\Desktop\chill\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:374:17)
    at WebSocket.onError (C:\Users\chill\Desktop\chill\discord-bot\node_modules\ws\lib\event-target.js:128:16)
    at WebSocket.emit (events.js:189:13)
    at _receiver.cleanup (C:\Users\chill\Desktop\chill\discord-bot\node_modules\ws\lib\websocket.js:211:14)
    at Receiver.cleanup (C:\Users\chill\Desktop\chill\discord-bot\node_modules\ws\lib\receiver.js:557:13)
    at WebSocket.finalize (C:\Users\chill\Desktop\chill\discord-bot\node_modules\ws\lib\websocket.js:206:20)
    at TLSSocket.emit (events.js:189:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
#

but i got it on 2 bots on the same machine

#

so idk why oof

rugged linden
#

Ugh I hate that error

quartz kindle
#

client.on("error",e => console.log(e))

rugged linden
#

heh I was just about to say that

#

It worked for me

zinc condor
#

explaim someone please

#

im java btw

#
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 7 column 1 path $
        at com.google.gson.Gson.fromJson(Gson.java:899)
        at com.google.gson.Gson.fromJson(Gson.java:852)
        at com.google.gson.Gson.fromJson(Gson.java:801)
        at com.google.gson.Gson.fromJson(Gson.java:773)
        at com.hikaribot.requests.Response.toService(Response.java:41)
        at com.hikaribot.scheduler.jobs.GithubChangesJob.lambda$null$0(GithubChangesJob.java:52)
        at com.hikaribot.requests.Request.handle(Request.java:88)
        at com.hikaribot.contracts.async.Future.lambda$send$2(Future.java:81)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 7 column 1 path $
        at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
        at com.google.gson.Gson.fromJson(Gson.java:887)
        ... 12 common frames omitted```
junior summit
#

so wait

hushed berry
#

Are you trying to decode it to a class?

junior summit
#

do i just do client.on("error",e => console.log(e))

#

and thats it

#

cuz two bots failed

hushed berry
#

@zinc condor

zinc condor
#

the bots dont crash

#

just the error shows on java -jar bot.jar

hushed berry
#

...

zinc condor
#

question

hushed berry
#

is this your code thats erroring

zinc condor
#

well its a combo of two projects

#

im trying to do a merge type thing

#

anyway for my current working project how do i post my server count to the dbl site

#

like it says N/A right now

#

?

spare glen
#

@hushed berry that thing we did, makes my bot shut down randomly

#

fuck

#

everything works, exept it shuts down after 5 min

near aurora
#

{"error":"Unauthorized"} when I try to POST to the API. How do I send the token

#

What does "as an http header" mean

mossy vine
#

you send the token as a header in your POST request

near aurora
#

Ok now Im getting forbidden errors

#

I sent it directly to the URL

#

Ah thanks

zinc condor
#

anybody know how to make guild count show on the site dbl in java?

viscid flame
#

nop use DBM

zinc condor
#

rephrase

kind roost
#

hi

quartz kindle
#

other than that, you can manually send a POST request

zinc condor
#

ok

quartz kindle
#

@kind roost if that is json, starting with[ and ending with ] means its an array

#

so you have to access it using array indexes, for example variable[0] for index 0 (in javascript)

kind roost
#

let me check

keen turret
#
        [Command("echo")]
        public async Task sendEcho([Remainder]string UserMessage)
        {
           // execute some code...
        }

Is it possible to do something like [Command("")] so the bot listens to all messages?

zinc condor
#

@quartz kindle i do not understand that

quartz kindle
#

@zinc condor what is it you dont understand?

keen turret
#

guys why doesn't anyone answer ?

#

I've asked the same question 3 times :/

quartz kindle
#

im not familiar with the language you're using

#

and apparently not many of us are

earnest phoenix
#
let field = 'text'
if (field.length >= 1024) return
.addField(text)
#

That would work ?

#

I want to check if the length of that field = 1024

#

If true stop

#

If false it add the fields

inner jewel
#

no

#

you need to call .addField on something

#

you can't just have .addField randomly

earnest phoenix
#

And how i do that

rose peak
#

RichEmbed.addField(), where RichEmbed is the variable you set the embed to.

grim aspen
#

huh

#

funny how i'm working with that command right now

earnest phoenix
#

@rose peak

#

You mean

#

embed.addField(field)

rose peak
#

As I said, where RichEmbed is the variable you set the embed to.

#

You're not forced to name every embed variable embed

#

So instead, I wrote RichEmbed which is the class for it

earnest phoenix
#

but that would work @rose peak

rose peak
#

Won't work since you're breaking the constructor with other code

earnest phoenix
#

oh true

#

I need to place that in the start of the embed true ?

rose peak
#

Depends what you're trying to do, which I have no clue

earnest phoenix
#

I want do that

#

I want to check if the length of that field is higher than 1024

high lava
#

Wait. I got this

rose peak
#

I know that much

high lava
#

This just makes sure to only put 1021 characters and then it replaces the last 3 with "..."

earnest phoenix
#

oh alright

high lava
#

But the id isn't going to surpass 1024 characters anyway, so that statement is never going to run

earnest phoenix
#

dont use free hosting

quartz kindle
#

.addField("description",field < 1024 ? field : field.substring(0,1023))

high lava
#

^ I need to learn that format, but that is better

quartz kindle
#

its quite easy

#

var1 > var2 ? = if(var1 > var2)

#

response1 : response2 = { response1 } else { response2 }

rose peak
#

condition ? true : false

high lava
#

I've seen it used all the time, but never really understood that's how it was structured. thanks

quartz kindle
#

the difference is that it takes the result and returns it immediately, where a regular if doesnt

#

so you can use it to structure sentences for example

#

the name for it is "ternary opterator" if you want to google it

high lava
#

Ok. I see. This looks like it could come in handy. Thanks

hushed berry
#

Is using arrow functions in browser JS a bad idea?

high lava
#

@quartz kindle field.length btw. Not just field

quartz kindle
#

yup, i forgot xd

#

mb

high lava
#

It's good. lol

#

Helps make a code a lot cleaner though

quartz kindle
#

@hushed berry only if you want to support old browsers

#

if you're like "fuck IE", then go ahead and use them

hushed berry
#

oh awesome

#

okay

#

!

grim aspen
high lava
#

Two instances?

grim aspen
#

oh shit

#

I forgot my other computer's running it too

quartz kindle
#

lmao

grim aspen
#

too bad i can't stop the other computer because i'm at a different house

#

right now

bright spear
#

Just reset the token @grim aspen

earnest phoenix
#

for some reason my websocket connection keep crashing my bot. Do i have this setup right?

dbl.on('posted', () => {
  console.log('Server count posted!');
})

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})
#

and I have my bot under bot instead of client

const bot = new Discord.Client();```

I just want to know how to fix this issue.
#

you say websocket but send code for a dbl webhook

#

🤔

#

this is my error and it has correlations to the webhook

WebSocketConnection.onError(/root/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:374:17)
at WebSocket.onError (/root/node_modules/ws/lib/event-target.js:128:16)   ```
#

what makes you think that they are correlated

#

because webhooks dont touch websockets

#

because today is when I added the webhook and today my bot crashes every hour

quartz kindle
#

show your full dbl code

earnest phoenix
#

you are most likely using free hosting that isnt strong enough to handle so many requests

#
const bot = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('key', bot);


dbl.on('posted', () => {
  console.log('Server count posted!');
})

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})

And I'm not using a free hosting, I'm using my vps

quartz kindle
#

the code looks correct. do you get the server count posted logs?

earnest phoenix
#

yes

quartz kindle
#

you're not using any webhooks anyways

grim aspen
#

lmao

quartz kindle
#

so its not related to webhooks

earnest phoenix
#

alright.

quartz kindle
#

you can try removing the dbl code and see if the error stops

#

so confirm it is indeed caused by dbl

earnest phoenix
#

I tested that this morning and the errors did stop

#

but when I re-added the script above, my errors came back

quartz kindle
#

you can try switching from dbl to manual posting

earnest phoenix
#

alright

kind roost
#

some php developer here?

zealous veldt
#

I have some if statements in an asynchronous function, is there a way to make evaluating the if statement and then (if true) executing the code in a blocking way? In short, is there a way to make the evaluation and execution of an if statement blocking in JavaScript?

pallid zinc
#

I hosted my bot on heroku and it get online but command not working

bright spear
#

Any errors?

#

That doesn't have any useful information

pallid zinc
#

No errors

#

I use to host it my self

#

But when I host on heroku

#

Bot get online but no command working

jagged birch
#

Fix: don’t fucking host on heroku

#

@pallid zinc

pallid zinc
#

You are right

#

I buy a vps

#

And now it's working nice

#

@jagged birch

fluid basin
#

@zealous veldt depends on what you mean by blocking

#

as in the entire node event loop or just that function

#

nodejs is async in design which is meant to be non blocking though

#

thats why promises and callbacks exist

zealous veldt
#

I return an asynchronous promise as part of a message handler, I have an if statement in that to check if the author is a bot. Because it's asynchronous, that if statement is essentially useless.
if(msg.author.bot) resolve();

fluid basin
#

oh then I think you should either throw an error so you can catch it in the message handler

zealous veldt
#

I suppose I could make the checking a blocking function, and pass resolve () as a param

fluid basin
#

or add some return data in the promise

#

what does your message handler even do after resolving

zealous veldt
#

Nothing as of now, I just make it a promise so I can easily await it later when I add more to the message event

fluid basin
#

yeah well like I said you could throw an error

zealous veldt
#

Yeah

fluid basin
#

or just reject the promise if it is a bot

zealous veldt
#

Yeah

fluid basin
#

reject()

#

yup I guess that would solve your problem?

zealous veldt
#

likely, I'll experiment with some solutions in a bit

fluid basin
#
let promise1 = new Promise( (resolve, reject) => {
let dataReceivedSuccessfully = false; 
if (dataReceivedSuccessfully) 
resolve('Data Available!'); 
if (!dataReceivedSuccessfully) 
reject('Data Corrupted!'); }) 

promise1.then( (message) => {
console.log(message); 
}).catch( (message) => {
console.log(message);
})```
amber fractal
#

That would always reject

fluid basin
#

yeah well just an example

#

of passing data from promises

zealous veldt
#

yeah I know how to pass data

#

my original question was just about the possibility of blocking if statements

fluid basin
#

well afaik promises/async functions are async so its either resolve or reject

prime cliff
#

Fix: do you actually have a command handler 🙃 ping command does not create itself

zealous veldt
#

lmao

pallid zinc
#

this is server is only for discord bot

loud salmon
#

just ask your question here @magic sail

#

no need to get someone specifically

#

just post your problem and someone will get to it

pallid zinc
#

ohh

mossy vine
#

Is it possible to send raw svg data as an image in an embed?

pallid zinc
#

Is it possible to make a bot which collect information from different server and show them in a single server

quartz kindle
#

yes

#

as long as the bot is in both servers

earnest phoenix
#

@fossil oxide

dusky steeple
#

I am having a problem with the editPermission I am trying to make a lock channel command and it keeps erroring.

const everyone = message.channel.guild.roles.find(r => r.name === '@everyone');
        const reason = args.splice(0, args.length).join(' ') || `This channel has been locked by ${message.author.username}#${message.author.discriminator}`;

message.channel.editPermission({
            overwriteID: everyone.id,
            allow: 1024,
            deny: 2048,
            type: 'role',
            reason: reason
        });

Am I doing this wrong?
TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
I am using Eris

ruby dust
#

Can someone please explain me how does that event even work

earnest phoenix
#

when the client has been populated that even is fired

#

which means when the client downloads all guilds

ruby dust
#

well this doesn't seem the case for me, if you read my messages at all

inner jewel
#

you receive a READY event if you reconnect (not resume)

ruby dust
#

so it doesn't happen on startup?

mint cradle
#

Dear people; I have python 3.6.5 installed but it won't pip install discord.py

MBA-Leerling-10123:~ ZL109819$ pip install discord.py
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting discord.py
Using cached https://files.pythonhosted.org/packages/97/3c/2a97b47fd8839f8863241857bbd6a3998d1de1662b788c8d9322e5a40901/discord.py-0.16.12.tar.gz
Collecting aiohttp<1.1.0,>=1.0.0 (from discord.py)
Using cached https://files.pythonhosted.org/packages/09/5a/7b81ea8729d41f44c6fe6a116e466c8fb884950a0061aa3768dbd6bee2f8/aiohttp-1.0.5.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/z4/fh92f59s4_7_494pvnk20mmm0000gq/T/pip-install-gvGyeQ/aiohttp/setup.py", line 60, in <module>
raise RuntimeError("aiohttp requires Python 3.4.2+")
RuntimeError: aiohttp requires Python 3.4.2+

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/z4/fh92f59s4_7_494pvnk20mmm0000gq/T/pip-install-gvGyeQ/aiohttp/

#

Anyone has idea what I am doing wrong?

#

Or how to solve

ruby dust
#

in the future, put such long copy-pastes into codeblocks that's easier to read

mint cradle
#

Ofc.

scarlet bane
#

You're on python 2.7

mint cradle
#

No. 3.6.5

#

That's what I installed

scarlet bane
#

Is this osx?

mint cradle
#

It's Terminal

scarlet bane
#

Is this a mac?

mint cradle
#

Yea

scarlet bane
#

They come with 2.7 by default

#

You need to use pip3

#

not just pip

mint cradle
#

Ah, pip didn't worked either

#

Last time it worked, but that's already long ago. But laptop got reset so need to reinstall

scarlet bane
#

try with pip3 install discord.py

mint cradle
#

MBA-Leerling-10123:~ ZL109819$ pip3 install discord.py
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3", line 7, in <module>
from pip import main
ImportError: cannot import name 'main'

#

Otherwise to get voice support you should run the following command:

python3 -m pip install -U discord.py[voice]
#

This worked for me I think

#

This is the right api I hope

scarlet bane
#

cannot import name main that is concerning...

mint cradle
#

Yes, very weird I don't understand

#

Well I try if it works now

#

When I import Discord into Idle

scarlet bane
#

make sure idle isnt using 2.7

mint cradle
#

It's 3.6.5

#

Luckily

#

I hate the rewrite so yes

ruby dust
#

why do you hate it

mint cradle
#

Because of the chances in command and there is less support

ruby dust
#

you mean async is better?

mint cradle
#

Also, I got stuck within the first few lines when I used rewrite

#

You don't have to use async

#

I heard async was bad

#

But idk a lot about that.

#

Well and now it's aiohttp who fucks

#

Uwusum

#
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 924, in _wrap_create_connection
    await self._loop.create_connection(*args, **kwargs))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 804, in create_connection
    sock, protocol_factory, ssl, server_hostname)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 830, in _create_connection_transport
    yield from waiter
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 505, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 201, in feed_ssldata
    self._sslobj.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/ZL109819/Documents/Test.py", line 1212, in <module>
    gopbot.run(Token)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 519, in run
    self.loop.run_until_complete(self.start(*args, **kwargs))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
    return future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 490, in start
    yield from self.login(*args, **kwargs)
solid cliff
#

*ssl

ruby dust
#

@surreal peak

pallid zinc
#

Hey

west spoke
#

Mmh

#

Did yous ask

#

I see it stated in the rules you need to ask to send a invite for your bot @earnest phoenix

#

Or am I wrong

#

Ight

solar crag
#

sb!yardım

#

@pure dock

minor kelp
#

http://prntscr.com/n018md

i wanted it to send a message in a certain channel if the bot was removed from a server, or added to one
hope you can help

Lightshot

Captured with Lightshot

ruby dust
#

I never understood what f stats for

minor kelp
#

honestly

#

me neither, thats why im asking for help XD

mossy vine
#

f is for formatting things in {} isnt it?

ruby dust
#

well I just use .format() in that case

minor kelp
#

Can you help with my command tho?

ruby dust
#

this is async?

minor kelp
#

Yup

mossy vine
#

"if the bot was removed or added to a server"

#

event listeners?

minor kelp
#

well yeah

#

but

#

my friend has a really advanced bot, and he is trying to do that, but he cant do it

#

So

#

im asking here. bcoz its easier?

ruby dust
#

really advanced bot
can't define events

#

nice combo

minor kelp
#

Fair but

#

atleast hes tryi9ng

#

this is what he has for it so far.

    @client.event
    async def on_server_remove(self, server):
        embed = discord.Embed(description=' Neko has been leaved the server `{0}`'.format(server), color=botcolor)
        embed.set_footer(text='This message was requested by Neko')
        embed.timestamp = datetime.utcnow()
        channel = server.get_channel("555533937208852500")
        await self.client.send_message(channel, embed=embed, server="382290709249785857")
#

But, can anyone help me, still

ruby dust
#

I don't think anyone can, considering that you are using the outdated version of the library

minor kelp
#

How?

#

im using rewrite

ruby dust
#

you said that's async, now it's rewrite

minor kelp
#

Boi

ruby dust
#

await self.client.send_message(channel, embed=embed, server="382290709249785857")
I recognize rewrite when I see one, and this is not it

minor kelp
#

I use "guilds"

#

Duuuuuuudee

#

thats not mine

#

thats my friends code

#

XD

ruby dust
minor kelp
#

Sooo

#

can you help me

#

with my code

#

ok guess not then....

rugged linden
#

What language are you using?

minor kelp
rugged linden
#

oof I only know discord.js

minor kelp
#

oof

trim saddle
#

ree async py

earnest phoenix
#

Py for noobs

slender thistle
#

@ruby dust fstrings added in 3.6

#

Helpful when you have too many {} in your code

#

Also afaik its performance is better than on .format()

ruby dust
#

so it basically replaces the .format()?

scarlet bane
#

real shit, what's a websocket close 1001 code

slender thistle
#

Basically yes, it is

#

But with more comfortable visual part

#

1001 indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page. @scarlet bane

scarlet bane
#

right but does discord's WS change that at all or

#

Like, does discord mean something different?

slender thistle
#

That will probably be "Connection lost" from Discord and you can't do much, I believe

#

Do you get 1001 from vc or?

scarlet bane
#

from the actual ws

#

gateway

earnest phoenix
#

i believe thats a cloudflare disconnect

scarlet bane
#

Fug

#

What's the cooldown on resumes?

earnest phoenix
#

isnt

scarlet bane
#

Cus it gets locked in a resumeloop after that happens a few times

#

Like, i get 1001 3 times in a row, and then the only thing i can do is do a full reconnect

#

all future resumes cause a 1001

#

until i reconnect without a resume

white sky
#

hi guys

#

help

#

pip install dblpy
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/dist-packages/pip/init.py", line 215, in main
locale.setlocale(locale.LC_ALL, '')
File "/usr/lib/python2.7/locale.py", line 581, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting

#

when installed libs such error

scarlet bane
#

what is your locale

#

oh, its empty

#

cool.

#

@white sky what operating system is this

grizzled spruce
#

Lol

#

Anyways

white sky
#

@scarlet bane ubuntu 16.04

amber fractal
#

Using spoilers for that isnt the best idea...

loud salmon
#

dont worry

scarlet bane
#

@white sky can you show me the result of locale?

loud salmon
#

its taken care of

white sky
#

locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

#

@scarlet bane

scarlet bane
#

try locale-gen

zenith jetty
#

I got 0 respons while installing apache2 on Raspbian 7, what happened?

scarlet bane
#

@white sky

white sky
#

locale-gen
Generating locales (this might take a while)...
en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8... done
en_GB.UTF-8... done
en_HK.UTF-8... done
en_IE.UTF-8... done
en_IN.UTF-8... done
en_NG.UTF-8... done
en_NZ.UTF-8... done
en_PH.UTF-8... done
en_SG.UTF-8... done
en_US.UTF-8... done
en_ZA.UTF-8... done
en_ZM.UTF-8... done
en_ZW.UTF-8... done
id_ID.UTF-8... done
Generation complete.

#

pip3 install dblpy
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
sys.exit(main())
File "/usr/lib/python3/dist-packages/pip/init.py", line 215, in main
locale.setlocale(locale.LC_ALL, '')
File "/usr/lib/python3.5/locale.py", line 594, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting

scarlet bane
#

hm

#
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
#

and then ```
dpkg-reconfigure locales

white sky
#

en_US.UTF-8&

#

?

scarlet bane
#

yep

west spoke
#

nvm

white sky
#

dpkg-reconfigure locales
Generating locales (this might take a while)...
en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8... done
en_GB.UTF-8... done
en_HK.UTF-8... done
en_IE.UTF-8... done
en_IN.UTF-8... done
en_NG.UTF-8... done
en_NZ.UTF-8... done
en_PH.UTF-8... done
en_SG.UTF-8... done
en_US.UTF-8... done
en_ZA.UTF-8... done
en_ZM.UTF-8... done
en_ZW.UTF-8... done
id_ID.UTF-8... done
Generation complete.

scarlet bane
#

And what if you do the pip install now

white sky
#

eeeee

#

nice

scarlet bane
#

works?

white sky
#

yes

#

thx

scarlet bane
#

👍

white sky
#

hushed berry
#

@quartz kindle oh huh, oddly enough, the arrow functions worked just fine in IE

#

unless my framework is doing some magic

inner jewel
#

it's probably transpiling to older stuff

hushed berry
#

perhaps

#

lemme see what the js looks like on the other end

lofty hamlet
#

if (message.includes("everyone") || (message.includes("here"))) return message.channel.send('No')

#

It's no possible ?

scarlet bane
#

no

#

not like that

lofty hamlet
#

How can I do this?

scarlet bane
#

i forget what @ here looks like in code

#

Just test it in a private server and see

#

but @ everyone and @ here are not normal text

lofty hamlet
#

Hein ?

#

No i just want if my message content everyone return

#

Juste this

#

How can i do this ?

amber fractal
#

Just check for mentions smh

lofty hamlet
#

No i just want if my message content everyone return

#

Just this no mention

#

Who can help me ?

#

if (message.content("everyone") || (message.content("here"))) return message.channel.send('No')

#

I test this but message.content is not a function error of the console

wooden prawn
#

if (message.content == "everyone" || message.content == "here") return message.channel.send('No')

how bout dah?

lofty hamlet
#

?-?

steel heath
#

if (message.mentions.everyone) return message.channel.send('No');

wooden prawn
#

Or that ^ that will probs be 10000000 x better lol

#

Was taking a stab in the dark without reading the context

lofty hamlet
#

@steel heath thanks and for here juste replace everyone / here

#

?

steel heath
#

nope, you don't have to change anything, it sees both everyone and here mentioned if you do that

lofty hamlet
#

How can I see sir is the bot sending? ex : if (messageauthor.bot..mentions.everyone) return

#

It's possible ?

#

And thanks he work @steel heath

steel heath
#

You mean: if (message.author.bot && message.mentions.everyone) return;? This will only catch if a bot mentions everyone/here

heavy agate
#

@lofty hamlet im not sure, is it python?

grim aspen
#

that's nodejs

west spoke
#

its not i dont think

grim aspen
#

i use the same code for my bot

west spoke
#

xd

marble needle
#

nodejs is not a language, never was never will 😩

heavy agate
#

oh okay thx

grim aspen
#

i just learned something new

#

thanks for ruining that moment

scarlet bane
#

@heavy agate for future reference "&&" and "||" don't exist in python

heavy agate
#

@scarlet bane it exists

scarlet bane
#

no

wooden prawn
#

I also didn't know that

scarlet bane
#

it's and and or

steel heath
#

isn't it and & or in py

#

oh yeah