#development

1 messages Β· Page 399 of 1

gusty topaz
#

you might want to Math.floor that ping

tiny turtle
#

I live in wy, most people get a much better one

gusty topaz
#

(round it down)

solemn obsidian
#

u dont unless u dl it

gusty topaz
#

no not that, if you Math.floor it it wont have that ugly 33333333333333333333333332

solemn obsidian
#

dbl! ping

gusty topaz
#

essentially removing stuff after the decimal point

solemn obsidian
#

:(

tiny turtle
#

ohh so it doesnt include after the .

gusty topaz
#

yes

tiny turtle
#

ohh thanks both of you again

#

taking the time to respond

gusty topaz
#

heh

tiny turtle
#

much better

solemn obsidian
#

I'd remove the underlines, it makes it kinda hard to read, bot creator is missing discriminator and move mb part of ram usage to the end of the value

tiny turtle
#

Will do, great ideas btw

solemn obsidian
#

Also probably want to check how it looks without code tags formatting?

tiny turtle
#

yea might be cleaner

#

Do I have to make the bot download every users pic in order to do that :/

#

as far as the side by side edit log?

toxic oracle
#

You can use snekfetch to make a request to the avatar URL, you will be returned with a buffer you can use within canvas

solemn obsidian
#

pretty sure old avatar will still exist for a while

tiny turtle
#

man you guys are so much more helpful then most the discords im in

lament meteor
#

well cause most of the people here uses js and makes discord bots

hot sleet
#

Guys I want to know how to make my not gets info online

#

Because I want to make my bot gets games stats online

#

I want an api example

low rivet
#

lang?

lament meteor
#

coding lang?

low rivet
#

yeah....

earnest phoenix
#

@hot sleet What is the programming language that you're using?

hot sleet
#

Js

earnest phoenix
#

@low rivet @lament meteor Was that so hard?

hot sleet
#

I hate my auto currect

#

......

#

.

#

Kk

low rivet
#

try using snekfetch, i dont use node js personally but its recommended by a few devs i know

lament meteor
#

if u are new to node.js then u can install it via npm install snekfetch

hot sleet
#

i know it

#

but i don't know how to use ot

#

it xD

lament meteor
#

ill give u a fancy small example

#
snekfetch.get("link").then(r => {  
console.log(r.body) //do r.text if it is only text
})```
low rivet
#

the readme has examples

lament meteor
#

he cant read

earnest phoenix
#

I can strongly vouch for Snekfetch as a NodeJS developer (both professionally for work and casually for discord bot) btw ^^^
It really is http requests made simple and without all the bullsh*t other libs require

#

Hey guys, let's say I want to integrate graphs(not real time) in bot response messages.
Is there a way to do it? (besides generating image by another service and including in message)

lament meteor
#

coding language?

earnest phoenix
#

js

lament meteor
#

are u using node.js?

earnest phoenix
#

yep, discord.js

lament meteor
#

no node.js and discord.js is 2 differnt things

#

node.js is a runtime and discord.js a library and it is a npm package

earnest phoenix
#

I know man, ima professional dev =)
included API lib so you know on what base I've built the bot

lament meteor
earnest phoenix
#

@lament meteor ok, but how to integrate in discord message?

#

@hot sleet
as for how to use it, adding to Telky's

const request = require('snekfetch');

request.get('https://xkcd.com/info.0.json').then(res => {  
  if(res.ok) { // is only truthy if you got any of the 2XX HTTP responses
    console.log(res.body)
  }
}).catch((err) => console.error(err))

Although I personally prefer async/await with try/catch coding:

const request = require('snekfetch');

const run = async function() {
    try {
        const res = await request.get('https://xkcd.com/info.0.json');

        return res.body;
    } catch (err) {
        console.error(err);
    }
}

run();
lament meteor
#

message.channel.send({files: {}})

#

something like that

#

@earnest phoenix u know request is also an npm package to grab stuff from websites

earnest phoenix
#

yes but you can assign a require to anything you want

lament meteor
#

yup

earnest phoenix
#

As for drawing can be a lot of hell on NodeJS tbh. I personally used Canvas-Constructor because it's .. well.. it's canvas but a lot easier coz it's a constructor. But that's just for a rectangle, not a graph sweat

#

Well I can use d3 with canvas, and produce png
and that can work as separate service
so it won't overload bot

lament meteor
#

dont rlly use canvas Β―_(ツ)_/Β―

earnest phoenix
#

this is how I build a rectangle

const canv = new Canvas(80, 60)
  .setColor(hex)
  .addRect(0, 0, 100, 60)
  .toBuffer();

hex being a variable of '#FFFFFF' type

#

then I convert that buffer to base64 string (canv.toString('base64')) and upload it to imgur with imgur npm package to embed it into discord (imgur.uploadBase64(canv.toString('base64'))

spring ember
#

Oh image manip

earnest phoenix
#

It's gonna take a lot of fiddling but im sure you can build a graph with that.... the 0, 0 in my addRect are X and Y pos so you can manipulate where the rects go into the total canvas

#

I suppose something like 0, 0, 20, 40 then 20, 0, 20, 60 would work ?_? I forgot which values are X and Y tho but I mean a staircase shaped graph

spring ember
#

If Canvas is like Graphics you'll be able to draw an image on top of an image

earnest phoenix
#

ye it can

spring ember
#

Noice

earnest phoenix
#

if your first image is 50 by 50 and you place the second one of 10 by 10 at position 20 by 20 then it will be over the first one

#

coz well... 50 up from 0 << 20 up from 10

spring ember
#

Have premade templates

earnest phoenix
#

@earnest phoenix the thing I don't understand completely, is what discord will allow me to embed inside message
It doesn't allow me to embed html right?
Only complete files

#

like png, or smth like that

spring ember
#

What?

earnest phoenix
#

no, that's why I upload it to imgur

#

which returns an image URL

#

ok

#

can I upload like 5 images in one message?

spring ember
#

No

#

Only if you send a link to 5 images

#

Like 5 links

earnest phoenix
#

if you want to see the full implementation of those snippets I showed before lmk coz my bot is open sauce

#

@earnest phoenix thanks man, I'll pm you If smth
but for now I don't see image generation as an issue

#

in any case, thank you guys for your time

peak cedar
#

wait so if i got rejected can I fix my bot and re-apply?

#

ping me if someone responsns, or I won't get it

low owl
#

@peak cedar Yes

#

Please double check if you actually fixed the problem though.

hollow palm
#

alright I see to be too dumb to test the discord-bot webhook request thing and I honestly don't see the issue....in a nutshel I want to reward my users with voting for the bot and it seems to be recommended to use a webhook for this. My bot is currently implemented in python and my current approach is to implement a webhook via Flask aka. ```
python
from flask import Flask
import json

app = Flask(name) # Standard Flask app

@app.route('/', methods=['POST'])
def foo():
// TODO: data = json.loads(request.data)
print("YAY")
return "OK"

if name == "main":
app.run(host="0.0.0.0", port=8080)

floral stone
#

I have a code in github you can use.

#

Has a rewrite example and a flaks example.

#

Stores everything in the json.

#

@hollow palm

hollow palm
#

thanks ❀

#

would be helpfull if there would be an ooficial thing maintained / (or even referenced would help)

floral stone
#

I can maintain this.

hollow palm
#

nah like I mean from discordbots

#

in the api? dunno

floral stone
#

idk

hollow palm
#

dont run your bot as root πŸ˜‚

floral stone
#

I know, it's just an example.

#

Is there a way to multi-auth your vps with sms or mobile phone.

elder rapids
#

No... That's not how it works

#

Use certificates

inner jewel
#

@spring ember @earnest phoenix discord allows up to 10 files uploaded/message, as long as the total size of them is smaller than 8 MiB

wise bridge
#
Unclosed connection
client_connection: Connection<('discordbots.org', 443, True)>```
Always getting this and a list of headers on startup
elder rapids
#

I mean it kind of says it. Is it being closed?

wise bridge
#

where should I close it? I use context managers

#

so there should be no need to

elder rapids
#

I don't really know your whole language or library but I'm just giving an educated guess

wise bridge
elder rapids
#

So... python

wise bridge
#

yep

elder rapids
#

I don't really know much of it but my educated guess is a connection is unclosed

wise bridge
#

yeah i am as far as you

elder rapids
#

Maybe look for something that would hint to that

wise bridge
#

it only appeared after I switched to my VPS and turned off the old hosting

solemn obsidian
#

Anyone has experience with RabbitMQ and able to give me a hand?

bleak sapphire
#

anyone of you knows how to get a server id using the server name? im using discord.py

low owl
#

The only thing I can think of is enumerating client#servers

#

You could optimize the runtime performance of that by using a "dictionary", but ah

#

perhaps not worth it for ~1000 objects in the list or however you have

bleak sapphire
#

oh

#

Library discord.py
can anyone help me out on this
so basically i made a command which dms me all the names of the server my bot is in but i want it to include the server id so heres the code that i did

# Servers
@bot.command(pass_context=True)
async def servers(ctx):
    if ctx.message.author.id == OWNER_ID:
        lol = bot.servers
        await bot.send_message(ctx.message.author, "\n".join([blah.name and blah.id for blah in lol]))
    else:
        emd = discord.Embed(title=noperm, color=0xff0000)
        await bot.say(embed=emd)

but its only giving me the server id not the server name

restive silo
#

Does anyone know how to use the C# System.Net.WebSockets and emit events when its connected etc.?

elder rapids
#

I do and have done that

restive silo
#

i actuall found a good example but its using Actions over Events so i currently rewriting it jynEHEH still thanks tho

elder rapids
#

Mkay

abstract mango
#

if anyone knows about ruby and bundler stuff, go ahead and answer this.
i'm setting up a mastodon and one specific dep is causing trouble (charlock_holmes). a specific flag lets gem install it, but bundler refuses to use it. how can i pass compiler flags to bundler?

#

^ nvm, found the option

ashen quail
#

How do I set multiple prefixes? Meaning for example ! and ?

example:
?help = !help

prime cliff
#

Code it

hollow palm
ashen quail
#

no in js please

#

javascript

inner jewel
#

concept should be the same

#

Β―_(ツ)_/Β―

ashen quail
#

ok

prime cliff
#

Its not that hard to implement multiple prefixes

hollow palm
#

I still dont get the shitty webhook working with python ffs

inner jewel
#

get prefixes -> loop through them

low owl
#

Or do it the cool way with O(1)
HashSet<string> hashSet;

if (hashSet.Contains(string))...

inner jewel
#

if you have more than a couple of prefixes you have to worry about way more stuff

#

default, mention, custom

low owl
#

well, true

inner jewel
#

adding to a hashset would be less memory efficient and most likely slower

#

Β―_(ツ)_/Β―

low owl
#

I basically abstracted Prefix

interface IPrefix
{
bool ContainsPrefix(IMessage message)
}

#

Then you don't need to care about the prefix type

hollow palm
#

can someone explain why testing the voting webhook from discordbots.org doesnt result in any visible requests, but when using the same url in hurl.it i can at least see an error message?

inner jewel
low owl
#

and performance doesn't matter anyways for such a simple calc

inner jewel
#

i just do some if-else chains

low owl
#

Oh boi your font

#

How are these things called again.. ligua.. something

inland locust
#

someone speaks Portuguese?

inner jewel
#

ligatures

low owl
#

Yea

inner jewel
#

font's firacode

inland locust
#

I speak Portuguese

low owl
#

I used that too 1 year ago but lost it

#

thanks πŸ˜„

inland locust
#

I learned English for a long time.

#

I hope they are good people.

#

πŸ˜ƒ

inner jewel
#

the colored brackets/etc are a plugin

#

useful for tracking what closes what

inland locust
#

'-'

low owl
inland locust
#

It seems that only I speak Portuguese. 😦

inner jewel
#

i have them too but on some places they're still not enough

inland locust
#

It seems I'm alone.

#

😦

inner jewel
low owl
#

oh, they are kinda hard to see

inner jewel
#

tbh they help more with parens

#

for eg math related stuff

inland locust
#

What are you talking about?

low owl
#

Fonts and lines

inner jewel
#

Math.min(Math.max((all.head.toDouble * GuildMusicPlayer.normalSpeed).toInt, GuildMusicPlayer.minSpeed), 2 * GuildMusicPlayer.normalSpeed/*GuildMusicPlayer.maxSpeed*/)like this for example

low owl
#

🀣

inner jewel
#

colors help in that

low owl
#

True

inland locust
#

my God

#

Desisto de tentar falar inglΓͺs

low owl
#

You should keep this chat English only. For other languages please use #memes-and-media.

inland locust
#

OK

#

It's ok

hollow palm
#

testing the webhook shit doesnt work

topaz fjord
#

it does

inner jewel
#

webhook works for me

topaz fjord
#

sorry caps

inner jewel
#

your code must be broken

hollow palm
#

I'm not even using my code πŸ˜‚

#

ledgit just testing on webhook.site

#

tested with firefox, chrome...simply nothing

inner jewel
#

it just worked for me

#

Β―_(ツ)_/Β―

hollow palm
#

wtf is this then

#

does the "Test" works or the actual voting?

#

cause so far i just tested the "test" webhook

#

and there is simply no request comming in

inner jewel
#

both

hollow palm
#

does it needs to be unlocked for the bot or smth

topaz fjord
#

why use a online tester

hollow palm
#

cause its not working....

topaz fjord
#

its works when you use code

#

it works with my code

#

idk about u

hollow palm
#

it should also work when you use an online tester and no it doesnt work with code either

#

there is simply no request comming in

inner jewel
#

did you save before testing?

hollow palm
#

yup doesnt change anything

topaz fjord
#

yup it works for me

#

using webhook.site

hollow palm
#

OOF

#

testing with windows

#

....

topaz fjord
#

i am too

hollow palm
#

no I'm going to test with windows....currently on linux (which should not matter at all)

hushed oyster
#

snooozer I think you're doing something wrong

hollow palm
#

Well i honestly don't see what i can do wrong with the testsite

floral stone
#

I accidentally delete a folder by mistake

#

with my bot

#

can I recover

topaz fjord
#

@floral stone

#

windows?

floral stone
#

ubuntu

#

AHHHHHHH

#

i want to scream

topaz fjord
floral stone
#

ON A VPS

#

NOT OS

#

fuck

#

ASHAHAHY

#

13 day old backup

#

HA

hollow palm
#

voting webhook works now (including with the testsite); havent changed a single bit so no clue what changed to get it working

ashen quail
#

each time I do shelp it is equivalent as -help anyone know how to fix it? dm me and I will dm you main.js prefix.json and help.js so that you can help me figure out WHY

topaz fjord
#

Show code

#

@ashen quail

ashen quail
#

Ok

#

well your not responding

#

anyone else?
'

earnest phoenix
#

send me

gilded thunder
#
@bot.event
async def on_server_join():
    await bot.change_presence(game=discord.Game(name="arc!help | {} users and {} servers!".format(len(set(bot.get_all_members())), len(bot.servers)), type=3))
    embed=discord.Embed(title="I've just joined a server!.", description="New statistics", color=0xff0000)
    embed.add_field(name="Guilds", value=len(bot.servers), inline=True)
    embed.add_field(name="Members", value=len(set(bot.get_all_members())), inline=True)
    server = bot.get_server(" 378463469038469141")
    await bot.send_message(bot.get_channel("436750375220150283"), embed=embed)

@bot.event
async def on_server_leave():
    await bot.change_presence(game=discord.Game(name="arc!help | {} users and {} servers!".format(len(set(bot.get_all_members())), len(bot.servers)), type=3))
    embed=discord.Embed(title="I've just left a server!.", description="New statistics", color=0xff0000)
    embed.add_field(name="Guilds", value=len(bot.servers), inline=True)
    embed.add_field(name="Members", value=len(set(bot.get_all_members())), inline=True)
    server = bot.get_server(" 378463469038469141")
    await bot.send_message(bot.get_channel("436750375220150283"), embed=embed)``` These should print to my server but nothing sends and I don't get an error in the terminal.
muted oxide
#

How do I set a Listening activity in discord.py async?

gilded thunder
#

It has the channel specified, just won't send.

frail harness
#

@gilded thunder rewrite branch uses on_guild_join and on_guild_leave

#

and it should be activity=discord.Game(...

gilded thunder
#

I'm on async.

muted oxide
#

@gilded thunder, switch to rewrite, your discord.py async code may not work soon, get Rewrite by doing pip install --upgrade https://github.com/Rapptz/discord.py/archive/rewrite.zip.

#

I guarantee you making a bot command for you (bot developer) is easy.

gilded thunder
#

I did the asnc2rewrite tool and the code doesn't work.

muted oxide
#

Did you switch to rewrite?

frail harness
#

no he didnt

gilded thunder
#

Still on async.

frail harness
#

why

#

your bot has 10 commands

gilded thunder
#

I started off with async and I know that best.

#

30, actually.

frail harness
#

why is it hard to trans to rewrite

muted oxide
#

is_owner() and is_nsfw() exists on rewrite

#

except for async

#

they dont exist in async

#

maybe make a file and import that

#

I need to stop with the bad answers before I get muted

gilded thunder
#

I need to stop asking for help when I don't get any.

hot sleet
#

Which language you use

#

@fossil osprey

fossil osprey
#

I am not sure what that means. Like Java? C#? Etc etc? Because if so, I don't really use any.

hot sleet
#

JavaScript is good

spring ember
#

Learn js, it's the easiest and cleanest

hot sleet
#

everything and anything use it

spring ember
#

I use java lol

hot sleet
#

i use javascript

fossil osprey
#

So, how do I actually set it up, I have a bot in discord, but I'm lost on how to actually access any code for it.

hot sleet
#

script is good

low rivet
#

python :/

hot sleet
#

Mybot.js file

fossil osprey
#

Where do I find that?

hot sleet
#

npm install discord.js --save

low rivet
#

@spring ember lol py is cleaner

fossil osprey
#

Also I'm sorry for the stupid questions :x

spring ember
#

Ok when you code a bot, you are creating an instance that responds to commands

low rivet
#

@fossil osprey learn a language first. and then think about bots.

hot sleet
#

@fossil osprey watch youtube

#

i learned js after working on my bot lol

spring ember
#

@fossil osprey get to know the language, see examples and build a bot not public but for you to get experience

fossil osprey
#

Will do, I just didn't know how to access the coding was all. I have it set to a private discord, but didn't know how to actually work on it with the if thens or what not. All I wanted it to do was mention someone if a specific input was met.

#

But yeah, I'll go youtube it or something, thanks.

hot sleet
#

if you will learn js use IntellJ Idea

spring ember
#

Good luck

#

@hot sleet lol I have jetbrains student but I prefer vs code for js

hot sleet
#

intell j is jetbrains app

#

it's ultimate version

earnest phoenix
#

VS Code is probably your go to IDE when it comes to Javascript/Typescript

spring ember
#

I know I use idea for java

#

Vs code is better for js

hot sleet
#

JS is like if (some thing ) do something
java like #if function not at all (something.and.something) wait then say and wait then sleep then do something
xxD

#

@spring ember

#

πŸ˜‚ πŸ˜‚ πŸ˜‚ πŸ˜‚

spring ember
#

That's bullshit Java's if statements are the same. At least it would be relatable... Also let's not start a conversation in development

hot sleet
#

it was a joke

spring ember
#

Ik but it's not funny because it's too far from the truth that it's not relatable

abstract crystal
#

@earnest phoenix does it work in other servers and not this one or it doesn't work at all?

earnest phoenix
#

Yeah I will check other servers

abstract crystal
#

Because your bot doesn't work in this server yet, because it wasn't approved yet

earnest phoenix
#

It's not working anywhere

#

Lol

#

I checked like four including mine

abstract crystal
#

Any errors?

earnest phoenix
#

It's working now

#

:D

abstract crystal
#

ok

#

lul

earnest phoenix
#

Lol

#

Thanks anyways.

abstract crystal
#

np uwuwu

earnest phoenix
#

Nah it was showing just loading. And wasn't turning yellow or green as it wasn't coming online.

#

But now ...it's working just fine.

abstract crystal
#

library?

prime cliff
#

🀦

abstract crystal
#

pls

mental solstice
#

anyone have any idea how long rate limit bans last? lol

low owl
#

Ratelimited from?

mental solstice
#

discord

inner jewel
#

depends on the route

mental solstice
#

not sure which rate limit just getting 4008 rate limit exceeded

inner jewel
mental solstice
#

the people in .net api told me to ignore the preemptive rate limit, lol got 25 servers last night, and woke up banned.. its been 5 hours

inner jewel
#

oh

#

4008 is WS ratelimit

#

that means you sent more than 120 payloads in 60s

low owl
#

Ah, usually you can ignore the preemptive ratelimits

inner jewel
#

voice channel join/leave/move/presence updates are WS

low owl
#

It's possible that someone abused your bot or you did something weird

mental solstice
#

i dont have voice stuff, idk

#

the 4008 doesnt have anything to do with sending/modify messages or reactions?

inner jewel
#

no

#

those are REST

#

RL would be 429

mental solstice
#

ok, idk.. ill have stop my bot from joining any voice channels i suppose

#

i emailed discord about it, just recently though.

low owl
#

Don't you love big ass switches

earnest phoenix
#

I never liked the ```stuff
stuff
{

}``` style

low owl
#

Well, preference

#

what bothers me is that I have to use these switches in order to restructure a bullshit JSON

inner jewel
#

i have a 300 line match statement somewhere

#

for optimizing an AST

low owl
#

https://s.put.re/t8GZ5bc.png who thought it is a good idea to have these mappings.
I literally have 20 of these code blocks, everything stays the same but ""StackableRangeName":" changes to reflect a new property

inner jewel
#
def simplify(n: Node): Node = n match {
    case Neg(Neg(x)) => simplify(x)
    case Mul(_, Int(0)) => Int(0)
    case Div(Int(0), _) => Int(0)
}```and etc
low owl
#

Oh, I avoid state machines

#

But props for keeping your head clear if it is that big 🀣

inner jewel
#

it's not really that hard tbh

#

Mul(Int(0), _) => multiplying 0 with anything

#

so it just replaces with a 0

low owl
#

Oh shoot, I gotta go sorry. I was supposed to be somewhere in one minute.

mental solstice
#

How long can my bot be offline before its removed?

low owl
#

It won't get removed unless certified

mental solstice
#

Its not certified, but thank you.. Currently banned from discord for breaking RLs :(

ashen quail
mental solstice
#

Embed Title cant be empty

ashen quail
#

Yeah well what do I put in it?

mental solstice
#

A string

abstract crystal
#

yes it can be

ashen quail
#

just an empty one? LIke this (" ")

mental solstice
#

Sure.. cant be ("")

ashen quail
#

okay lemme try that

mental solstice
#

Nani says it can.. but i had the same issue in c#

ashen quail
#

Okay well it works! Thanks guys!

#

really?

abstract crystal
#

Title of the embed can be empty, but a title or value of the field can't

#

You probably have a null value somewhere here:javascript .addField("Bot Name", bot.user.username) .addField("Created On", bot.user.createdAt);
@ashen quail

ashen quail
#

well it works

#

I thinl

#

wait lemme test it

abstract crystal
#

okay, just keep in mind that you probably want a string there at all times

last summit
#

hello any developer here - developed a tipbot walletbot for simplewallet cryptonote/cryptonight ?
please message me -i want a bot for my coin

dusty sandal
#

yo for discord.js, how would i test to see if a person has a role?

spring ember
#

Member object?

dusty sandal
#

?

spring ember
#

I think it has roles

dusty sandal
#

ok

spring ember
#

guildMember.roles

dusty sandal
#

i shall try that

#

@spring ember how would i list the roles? like guildMember.roles() or guildMember.roles[]

night imp
#

It is better to check permissions imo

topaz fjord
#

That's not how you get a guild member

night imp
#

If it isn't an exclusive role

spring ember
#

It already returns a list

#

And it's not a method

dusty sandal
#

im trying to see if a member has a specific role

spring ember
#

member.roles

#

member.roles.contains(role)

night imp
#

if(member.roles.includes(role))

spring ember
#

Includes whoops

night imp
spring ember
#

Java GWvictoriaMeguFace

topaz fjord
tepid laurel
#

@night imp .has() actually

earnest phoenix
#

@dusty sandal it'd be .has not .includes or contains

tepid laurel
#

Ye

dusty sandal
#

so .hasRole?

tepid laurel
#

No

#

roles.has(<someroleid>) forgot if the object worked aswell

dusty sandal
#

ok thanks

tepid laurel
#

Np

ashen quail
gilded blaze
#

use message.member.permissions.has()

ashen quail
#

Ok I will try that

earnest phoenix
#

I need help with images with my bot, I have all the code I think I need, some code for the image (that worked before) and code for the embed (that my bot uses all the time) and I need help figuring out how to put them together to make a working image command for my bot

ashen quail
earnest phoenix
#

code?

tepid laurel
#

@ashen quail as it saysπŸ€”

#

Probably a callback is not adync

#

Async*

#

Fml typos

steel mountain
#

e!help

quiet bobcat
sand vale
#

is the id the bots id

topaz fjord
#

no

sand vale
#

what is it then

topaz fjord
#

its the id of who voted for the bot

inner jewel
#

user id

sand vale
#

ok

topaz fjord
#

hi natan

inner jewel
#

henlo turtle

topaz fjord
#

heck

gilded blaze
#

How do I wait for someone to react with Eris?

uncut slate
#

Eris doesn't have builtin reaction collectors, you'll have to write your own

gilded blaze
#

wew

uncut slate
#

not very hard to do, you can use one of the many message collector mixins and adapt it

#

alternatively you could hook up a listener and then discard it immediately

const listener = (reaction) => {
  Client.removeListener('messageReactionAdd', listener);
  // whatever else u wanna do
};
Client.on('messageReactionAdd', listener);

but I'd suggest just using a normal collector

gilded blaze
#

so like settimeout then get the new messages?

#

@uncut slate

earnest phoenix
#

does anyone know how to get total user count in all guilds with Discord.NET?

elder rapids
#

Loop the guilds and get the total member count. Don't remember member count api top of head

#

About the best I can tell you

restive silo
#

it should be SocketClient.Guilds.Count

earnest phoenix
#

Thats Guild count, im looking for Client count

restive silo
#

you mean User Count

earnest phoenix
#

well

#

basically lol

restive silo
#

well then do what Novus said

#

most likely the only way iirc

prime cliff
#

Int Users;
Foreach (guild)
Users += Guild.Users.Count

#

Too eazy

elder rapids
#

Wrong

#

Use MemberCount

#

Or whatever that api is, not the guild.users.count

earnest phoenix
#
client.user.setActivity(`=help | On ${client.guilds.size} Servers With ${client.users.size} Users!`);
elder rapids
#

The guild.users is a cache not a reliable item

earnest phoenix
#

that but in c# πŸ˜ƒ

prime cliff
#

I have my client config set to cache all users so idc LUL

elder rapids
#

I don't

#

Although I should

gilded blaze
#

How would I go about making a reaction collector

#

in Eris

#

is there something to wait for an event

prime cliff
#

Discord.net is pretty good on memory usage even when catching all users

ashen quail
hybrid dirge
#

.

inner jewel
#
function x() {
    await y(); //BAD
}

async function x() {
    await y(); //good
}```
elder rapids
#

new Promise()

ashen quail
#

ooo

#

i fixed it

#

yeeee

ivory jolt
#

I need help

elder rapids
#

Just ask the question if you need help

earnest phoenix
#

either im blind or im on the wrong site but i cant seem to find my bot

#

was the ui updated recently?

#

nvm

prime cliff
#

Leaves the server

floral stone
#

I have nginx on port 80 and flask on port 5000. I can't remember how I did it, but how would I set port 5000 as my default one like

to just
x.x.x.x```
#

I'm using a namecheap domain if I can set a specific port for my main domain.

inner jewel
#

use a reverse proxy

#

with nginx

#

there's no such thing as "default port"

#

the browser uses 80 (http)/443 (https) if you don't specify one

floral stone
#

Got an example of a reverse proxy?

inner jewel
#
server {
    listen 80;
    listen [::]:80;

    server_name your.domain;

    location / {
        proxy_pass http://127.0.0.1:YOURPORT$request_uri;
    }
}```
floral stone
#

Should I set the domain as my IP or my site domain.

inner jewel
#

domain

floral stone
#

Ah ok, so set @ and www records for my ip on namecheap

#

then do this

#

ty

#

It worked! @inner jewel

#

@inner jewel I have a problem. It mostly works, but after I login from discord into the dashboard, It rediects to the proxy_pass localhost:port url.

inner jewel
#

your redirect uri on discord

floral stone
#

In developers?

#

oh

#

no

#

It's set to the domain.

topaz fjord
#

you need to make an application

#

and set the redirect uri

floral stone
#

I mad eone, have one.

topaz fjord
#

to that

floral stone
#

Same domain

#

it's is

#

It logins fine.

#

Once I login though, it should redirct back to dashboard but the domain is in place of the proxy_pass. @inner jewel

inner jewel
#

Β―_(ツ)_/Β―

floral stone
#

Once I login though, it should redirct back to dashboard but the domain is in place of the proxy_pass. @inner jewel

#

@topaz fjord

#

with the localhost and ip

earnest phoenix
#

Tutorial on how to use webhooks on discord bots?

earnest phoenix
#

is anyone gonna help me with code for images in embeds (discord.js)

rose hazel
#

@earnest phoenix

earnest phoenix
#

ty

#

ty so much

#

do you have a node.js one I could use? I kinda use both (it works but it is annoying to work with at times)
this is the code I have for embeds:

client.on('message', message => {
  if (message.content === 'Ny.about') {
message.channel.send({embed: {
  color: 0xff33cc,
author: {
  name: client.user.username,
  icon_url:   client.user.avatarURL,
},
fields: [{
  name: "About Nyro",
  value: `Nyro is a Discord bot developed by 2 main developers named Safyre Lyons (the owner) and Logan.\n\Safyre: Hating Life576#6532 | Logan: Logandev_#9999`
      }
   ],
  }
})
}
});``` (taken from my about command)
#

and it doesn't seem that discord.js code I have (I been told it is discord.js code by the friend helping me)

#

I might go to him for help

rose hazel
#

all .setImage does it set the value 'image' in the embed options

#

that's all you need

earnest phoenix
#

oh ok

#

ack it is creating errors, I don't like discord.js, I am gonna wait until tomorrow to see if my friend (who is helping me) is online so he can help me, this is confusing af,

heady zinc
#

if you use an object like js embed: { description: 'whatever', image: { url: 'link-to-the-image' } }

#

well description doesn't even needs to be here

#

but anyway yeah there's a image property

#

check this out for reference

earnest phoenix
#

ok thank you

earnest phoenix
#

I got it to patially work, had to edit the code a lot

earnest phoenix
#

Hi, I started a bot using heroku, but when i deploy using heroku, the bot never runs

#

It does this:

-----> Installing requirements with pip
-----> Discovering process types
       Procfile declares types -> worker
-----> Compressing...
       Done: 44.3M
-----> Launching...
       Released v27
       https://peep-bot.herokuapp.com/ deployed to Heroku```
but then the bot never runs
#

halp pls

#

and yes the bot does work with the bot.py i set it up with

low rivet
#

turn on worker? @earnest phoenix

#

in resources

earnest phoenix
#

worker is on

#

yep

#

it's on

#

i doublechecked

low rivet
#

check logs

earnest phoenix
#

what logs?

low rivet
#

heroku logs

earnest phoenix
#

oh ok

#

the build log?

low rivet
#

no

#

click on the 3 dots beside run or open browser

#

and click View logs or similar

earnest phoenix
#

Found the bug!

#

thanks a lot

low rivet
earnest phoenix
#

Yeah!!!

#

it works now!

potent anchor
#

i need help with js

#

not working

#
  if (message.content.startsWith(prefix + 'prefix')) { 
    var args = message.content.split(' ').slice(1);
    var prefix = "gco";
      guildConf[message.guild.id].prefix = args[0];
    if (!guildConf[message.guild.id].prefix) {
    }
     fs.writeFile('./prefix.json', JSON.stringify(guildConf, null, 2), (err) => {
         if (err) console.log(err)
    });
    }```
twilit wolf
#

Developed

potent anchor
#

@twilit wolf what

twilit wolf
#

The room is for development

#

I just wrote developed

neat falcon
#

thonk

#

@potent anchor send error

upper ember
#

how do I setup the webhook?

lilac path
#

My bot.js file throws the error in the image below when I attempt to run it and the log window shows 'Value cannot be null.
Parameter name: solutionDirectory'

#

Are there any pointers for this issue? Thanks! ^_^

inner jewel
#

how are you running it?

lilac path
#

double-clicking the file in File Explorer

#

but I got the log window readout from Visual Studio as well

inner jewel
#

you need to use node for it

quiet bobcat
#

^

lilac path
#

you mean open node.exe and like console command it to run kind of thing?

quiet bobcat
#

what?

#

Do you have node.js installed?

lilac path
#

yes

quiet bobcat
#

open the commandpromt

#

then go to your folder

#

and write node bot

lilac path
#

cmd.exe or node.exe?

quiet bobcat
#

Well the windows commandpromt

#

so cmd.exe

lilac path
#

ok

#

so navigate to the proper folder and then just write 'node bot'? That's not seeming to do anything.

#

node bot.js as a command isn't doing anything either

spring ember
#

Is node installed in the path?

#

Like can you do node help

lilac path
#

ahhhh that might be it; node needs to be installed in the same path as the bot's project folder? I've got node in Program Files and bot.js somewhere down in a Documents subfolder

#

there's what I get for trying to be organized

earnest phoenix
#

@spring ember node help LUL

spring ember
#

Lol I couldn't think of something else

lilac path
#

is it alright if I pester you folks for help with what the file structure/relationship between the two should look like? I've got them in the same area-ish now but it's still not right.
Like now I've got Documents/nodejs and I've got Documents/SurvivalGuide (bot folder)

sinful lotus
#

do anyone here can check heapdumps xD and tell me what they think or if there is a leak on it

trim plinth
#

@lilac path try using node -v to check if node is installed in your system, if it doesn't work, uninstall node.js then re-install it, but just don't change anything in the installer

lilac path
#

@trim plinth successful response - v9.11.1

trim plinth
#

ok it's installed fine

lilac path
#

that's why I asked about how the folders/files should be arranged in relation to each other

trim plinth
#

now just change directories to your bot folder and type node bot.js

#

or whatever your file is called

lilac path
#

@trim plinth ```C:\Users\Dayne>cd /d C:\Users\Dayne\Documents\nodejs

C:\Users\Dayne\Documents\nodejs>node -v
v9.11.1

C:\Users\Dayne\Documents\nodejs>cd /d C:\Users\Dayne\Documents\SurvivalGuide

C:\Users\Dayne\Documents\SurvivalGuide>node bot.js
'node' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Dayne\Documents\SurvivalGuide>```

trim plinth
#

hmmmmmmmmmmmmmmmmmm

#

weird

#

wait a minute

topaz fjord
#

Are u in poweshell

#

Powershell

trim plinth
#

did you switch the node.js folder into documents bloblul

inner jewel
#

oh

#

it's not in the PATH env var

trim plinth
#

^

inner jewel
#

so when you run node -v in C:\Users\Dayne\Documents\nodejs

#

it uses the node.exe in that folder

topaz fjord
#

Powershell goes gay when you try node

lilac path
#

right, Natan

topaz fjord
#

But yeah what natan said

inner jewel
#

do you know how to modify environment variables?

trim plinth
#

the env vars are looking for node.js in the original path, not in documents GWempOof

#

that probably explains it

lilac path
#

I don't, my dev experience is "some classes in college" and what I do fiddling around until 6am. Either way, it's installed in Documents to keep it close to the bot location.

inner jewel
#

you could add it either to system or user environment variables

#

i'd recommend user since it's on your user folder

#

you'll also need to close cmd and reopen after you update the variables

digital fractal
#

Can someone tell me how to send Messages with Java in Youtube Livestreams?

lilac path
#

alright lemme see if I can manage to follow instructions πŸ€”

#

I've gone and done that- added it to user environment variables. And still, it acts up. ```C:\Users\Dayne>cd /d C:\Users\Dayne\Documents\SurvivalGuide

C:\Users\Dayne\Documents\SurvivalGuide>node bot.js
'node' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Dayne\Documents\SurvivalGuide>```

earnest phoenix
#
{ Error: Still spawning shards.
    at ShardingManager.fetchClientValues (C:\Users\frisby\node_modules\discord.js\src\sharding\ShardingManager.js:187:70)
    at Shard._handleMessage (C:\Users\frisby\node_modules\discord.js\src\sharding\Shard.js:138:22)
    at ChildProcess.emit (events.js:180:13)
    at emit (internal/child_process.js:783:12)
    at process._tickCallback (internal/process/next_tick.js:178:19) name: 'Error' }
#

having this error in my discord bot

#

:/

#

probably trying to interact with shards like broadcastevak something while they are still spawning

#

maybe theres an event when they are done so just wait for that

#

okay thanks

#

@earnest phoenix you're trying to fetch values or broadcastEval while the bot is still spawning shards

#

its just giving me this error while im doing nothing πŸ€”

#

stats command?
ready event? (it'll be emited each shard)

#

bot is working fine but just giving me this error.

#

i dont know why

#

ofc it will work fine but you're using client.fetchClientValues somewhere before all shards are ready.

#

lemme check

#

which one could be giving errors ?

#

i need to learn more JS .-.

topaz fjord
#

Are I running any of them

#

U*

earnest phoenix
#

Probably this one

#

Fixed The fetchClientValues Issue Thanks !

#

now getting this great !

#

any good porn json apis?

trim plinth
#

πŸ‘€

earnest phoenix
#

cuz im proper horny rn

trim plinth
earnest phoenix
#

but seriously is there actually any good ones?

kind quiver
#

no

earnest phoenix
#

i got you guys another error

#

my bot is dying ...

trim plinth
#

click on that path there

earnest phoenix
#

^ when i try to execute some commands it gives this error

trim plinth
#

that is what is causing the error most likely, or is at least linked to it

earnest phoenix
#

oky thanks

ashen quail
upper ember
#

help here blobwave

topaz fjord
#

whats wrong

upper ember
#

idk

#

it doesn't work :/

#

I can't find the error

mental solstice
#

const stats = profile..

#

should that be const stats = data.getStats?

earnest phoenix
#

Error: Please install sqlite3 package manually <--- how to fix that ?

#

Full Error If It Helps

Error: Please install sqlite3 package manually
    at new ConnectionManager (C:\Users\frisby\Desktop\Bastion-master\node_modules\sequelize\lib\dialects\sqlite\connection-manager.js:31:15)
    at new SqliteDialect (C:\Users\frisby\Desktop\Bastion-master\node_modules\sequelize\lib\dialects\sqlite\index.js:14:30)
    at new Sequelize (C:\Users\frisby\Desktop\Bastion-master\node_modules\sequelize\lib\sequelize.js:239:20)
    at Object.<anonymous> (C:\Users\frisby\Desktop\Bastion-master\bastion.js:43:20)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
#

fixed nvm

dusty sandal
#

i need some help for js. How do i get a bot to add a role to the person who typed in the command? If i do message.author.addRole() it doesn't work

night imp
#

Use a guildmember

trim plinth
#

message.member.addRole();

dusty sandal
#

ok

earnest phoenix
night imp
#

Docs

#

Try using this to make it

#

@earnest phoenix

earnest phoenix
#

it still doesn't work

#

it sends the same error message

floral stone
#

@inner jewel i got it working

umbral pelican
#

🀦🏽

vital gorge
#

Hey guys, could anyone help me code this Discord API thing on Python? I tried to install the discord api via PIP, I'm using python 3.6, when I tried to tdo it, It said my aiohttps needed to be 3.4.2+ -----

minor elm
#

Does anyone know how to make commands case insensitive?

grizzled isle
#

command.toLowerCase(), command being how you defined the command

#

iirc

minor elm
#

Line number?

#

Or placement, whatever

regal hemlock
#

!help

solid cliff
inner jewel
#

what's the output of java -version?

solid cliff
#
root@ns391207:~# java -version
openjdk version "10.0.1" 2018-04-17
OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-1ubuntu2)
OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-1ubuntu2, mixed mode)```
spring ember
#

Use openjdk 8

#

And java 8

inner jewel
#

no

#

use 9 for lavalink

spring ember
#

10 is not supported for sure

inner jewel
#

that's a certificate error

solid cliff
#

ok

inner jewel
#

could be spring for all i know

topaz fjord
#

try without open-jdk?

inner jewel
#

personally i never had issues with oracle jdk

dusty sandal
#

can anyone help me with some js? I want to be able to only run a command in one specific server. Basically it would detect - if command run is in correct server, run the command :: if command run in any other server, give an error message

ashen quail
trim plinth
#

wot

ashen quail
#

My say command wont work!

trim plinth
#

easier say command:

if (message.content.startsWith(prefix + "say")) {
  if (!message.member.permissions.has("MANAGE_MESSAGES")) return message.reply("You do not have enough perms!");
const sayMessage = args.join(" ");
message.channel.send(sayMessage);
minor elm
#

How do i add variables into my commands?

trim plinth
#

wat

#

@minor elm wdym

minor elm
#

Like "&command [variable]"

minor elm
#

@trim plinth

topaz fjord
#

that would be ur args

minor elm
#

Could you put an example?

#

@topaz fjord What do you mean? And could you give an example?

olive ridge
#

I'm trying to make my bot react to messages with cmds that dont exsists

#

like s.ehfywufg

#
var botCommands = ['purge', 'kick', 'ban', 'say', 'help', 'info', 'aha', 'ping', 'flip', 'd4', 'd6', 'd8', 'd10', 'd12', 'd20', 'lonely', 'sapou', 'rsapou', 'communism', 'ussr', 'no u', 'whisper', 'sdr', 'rules sdr']

if (message.content.startsWith(config.prefix + !botCommands)) {
  message.react("437741493835530260");
  message.channel.send(":x: Invalid Command :x:");
}
topaz fjord
#

no

#

dont

olive ridge
#

No err message

topaz fjord
#

youll get your bot muted that way

#

never react to unknown command

olive ridge
#

dueutil does that

#

but okay then

#

But why does it not work?

minor elm
#

someone told me to watch a tutorial and i used the code

const Discord = require("discord.js");
const client = new Discord.Client();
​
client.on("ready", () => {
  console.log("Booted up");
});
​
client.on("message", (message) => {
  if (message.content.startsWith(prefix + "ping")) {
    message.channel.send("pong!");
  }
});
​
client.login("lol reset the token anyway");
topaz fjord
#

because your trying to see if message does not equal <prefix><array>

#

@minor elm reset your token

olive ridge
#

lol

topaz fjord
#

never show people your token

minor elm
#

god damn

shy verge
#

good job

minor elm
#

good job me

olive ridge
#

get a config file

trim plinth
#

time to haxor bot!!!!!!1!!

#

jk

olive ridge
#

the tut will prob cover that soon

#

REE

minor elm
#

anyway

shy verge
#

@minor elm paste your stacktrace

minor elm
#

this?

shy verge
#

wait, you have no definition for prefix

#

wtf

olive ridge
#

where is ur prefix defined?

#

yeah

#

lol

#

u used prefix without defining it

minor elm
#

o

#

explains a lot

shy verge
#

good job

minor elm
#

good job

olive ridge
#

naisu naisu

minor elm
#

still

#

:^)

olive ridge
#

Is it api abuse to make a cmd that sends a message to my cmd line?

elder rapids
#

wot

olive ridge
#
client.on("message", (message) => {
  if (!message.content.startsWith(config.prefix) || message.author.bot) return;
  
  if (message.content.startsWith(config.prefix + "whisper")) {
    console.log(message.content.slice(10, message.content.length));
  } 
});
#

It's a modified say cmd, where the bot says what u said

trim plinth
#

hmmm

olive ridge
#

im surprised it worked

elder rapids
#

mmmm

trim plinth
#

hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

#

@olive ridge I would limit it to yourself (aka your id) because that can be abused easily

olive ridge
#

its only my cmd line being flooded

trim plinth
#

yeah but still

olive ridge
#

i say that sarcasticaly

#

but then the cmds boring

trim plinth
#

extremely subtle sarcasm

olive ridge
#

can i add a cooldown

trim plinth
#

probably

olive ridge
#

so it only accpets a message evry 2 minutes

trim plinth
#

yeah you can

olive ridge
#

how i do that

trim plinth
#

using Sets and setTimeout

olive ridge
#

GOOGLE TIME

elder rapids
#

Wait this command just repeats what the person said into your command line?

olive ridge
#

i should make it delete the message

#

its just a dm basicly

#

but one sided

#

yeah it is pretty useless

elder rapids
#

but why

#

Your command line should just be full of logs

#

What's the point of that

olive ridge
#

i was just bored

#

why is setTimeout so confusing

elder rapids
#

It's not

#

It tells the computer to run this function after X amount of time

olive ridge
#

hmm

#

i have to adda function nao

ashen quail
inner jewel
#
  1. don't save data in json
  2. don't save data in json
  3. don't save data in json
  4. don't save data in json
olive ridge
#

Natan i want ur pfp gif

ashen quail
#

But this is how a guy in youtube did it and it worked xD

inner jewel
#
  1. if(!coins[message.author.id]) -> if(!(coins[message.author.id] && coins[message.author.id].coins))
ashen quail
olive ridge
#

i only use simple embeds ;-;

floral stone
#

In mysql, how would I change all columns in a table default value to " "

#

or just all columns in general to a certain default valuer

#

Or set a default value for a table? Dobnt that

#

doubt*

olive ridge
#

I can't answer your question so I will refer to my childhood friend: "Google".

floral stone
#

Tried that.

terse badger
#

has anyone here made a website on which you login via discord in js?

floral stone
#

Can some explain to me autocommit in mysql in a dumb down fashion.

#

So, I recently moved to a newer version of ubuntu on my host and upgrade to latest version of rewrite. Apparently, aiomysql errors are loggin in on_command_error event unlike last time.
Therefore, breaking commands half way.(edited)
It returning a default value error and I do not want to assign a default value.
Is there any way I can get around this?

#

literally upgrading messed thibfs up

ashen quail
#

Guys im having an error in my console: UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'xp' of undefined

#

i did define xp so....

floral stone
#

Nvm, I think I got it

ashen quail
#

Please help

floral stone
#

You can't expect help without sharing some of your code./

ashen quail
#

OK then

floral stone
#

What's ya code?

ashen quail
#

here ya go @floral stone

floral stone
#

Oh

#

js

#

i use python

dusty sandal
#

what

ashen quail
#

yeah

#

I guess you cant help then

#

anyone else?

mental solstice
#

TypeError.. line 71?

#

is xp defined?

ashen quail
#

yes it is

#
let xp = require("./xp.json");
mental solstice
#

idk java well.. but can u add integers onto a string?

#

oh i see xp: 0

ashen quail
#

meaning what should I change? sorry im not that good with coding xD

mental solstice
#

meaning you would have to make a ulong variable and add too that

ashen quail
#

?

mental solstice
ashen quail
#

sorry I don't understand coding words xD

floral stone
#

In python terms, you need format the variable into the string

#

xp[message.author.id].xpThat works in javascript?

mental solstice
#
let curxp = xp[message.author.id] + xpAdd;
ashen quail
#

so instead of

xp[message.author.id].xp = xp[message.author.id] + xpAdd;

I do that?

floral stone
#

Ahh I see

ashen quail
#

on nvm

#

not that one

#

so instead of

let curxp = xp[message.author.id].xp;
#

i do that?

mental solstice
#

no that will make a string

ashen quail
#

so then what?

mental solstice
#
let curxp = xp[message.author.id] + xpAdd;
xp[message.author.id].xp = curxp.ToString(); // only if youre saving it again
ashen quail
#

brb and thanks

mental solstice
#

and...

#
if(nxtLvL <= curxp){
  xp[message.author.id].level = curLvl + 1;
}```
#

oh that wont work because xp[...].level is a string

dusty sandal
#

can anyone help me here (js)? I want to send an error message if a command is used in another server that's not the correct server (a command that only works in one server)
if(message.guild.id !== "425703997844881419") return message.channel.send('Sorry boyo! The `$buy` command only works in the **Official Boyobot Testing Server**!'+ '\nJoin the **Official Boyobot Testing Server** by using this invite\nlink') here's my code and i dont know what's wrong here

mental solstice
#

quotes around the guild id i can see off the bat

#

idk about JS syntax.. other than a semi colon on the end and the "'s the guild id number

#

i dont see why it wouldnt work

dusty sandal
#

ok

elder rapids
#

JS doesn't need semi colon and guild ID has to be a string

#

iirc JS doesn't support unsigned longs

mental solstice
#

oh πŸ˜„

dusty sandal
#

so how do i do the guild id as a string?

#

like this if(message.guild.id !== 425703997844881419)?

mental solstice
#

with the quotes would check it as a string

shy verge
#

"425703997844881419"

#

there you go

mental solstice
#

thats how he had it first

dusty sandal
#

that didnt work

mental solstice
#

whats the error youre getting

topaz fjord
#

@elder rapids js doesnt even support longs

elder rapids
#

That's why I said I don't think it supports unsigned longs

#

Those are unsigned long number

dusty sandal
#

it just skips over it uncle,

#

it ignores the return

#

that's all

#

i want it to not ignore the return

topaz fjord
#

are u sure ur using the right id

dusty sandal
#

im positive

mental solstice
#

what if u use !=

dusty sandal
#

i tried that already

earnest phoenix
mental solstice
#

your command requires parameters.. delete them/it?

dusty sandal
#

if i do this if(!`${message.guild.id}` === "425703997844881419") return message.channel.send('error') then it returns this error TypeError: Supplied parameter was neither a Role nor a Snowflake.

topaz fjord
#

you cant do !<id>

night imp
#

also please post it in codeblocks mmLol

dusty sandal
#

please help im very lost

topaz fjord
night imp
#

@dusty sandal Hi Lost, I am saddy. Please post your question and I'll help

mental solstice
dusty sandal
#

would message.guild work

topaz fjord
#

no

night imp
#

message.member.guild

#

is what you are looking for to get the guild of the message author

dusty sandal
#

yes

#

i want to make sure the command can only run in one server

topaz fjord
#
if(message.guild.id !== "id") return message.channel.send("yadadadada");
dusty sandal
#

my issue is that the thing skips the return

topaz fjord
#

it wont if your doing it right

dusty sandal
#

thanks @topaz fjord i got it to work

earnest phoenix
#

they never work...

fleet epoch
#

You know your bad when it takes you 30 mins to add color to console

glass linden
#

How can I make it so a command only runs on a certain server? js

elder rapids
#

By checking the origin guild id

lilac path
#

I've been fiddling with it all day, but navigating to the bot's project folder and then executing node bot.js doesn't do anything

ashen quail
earnest phoenix
#

Because the DiscordAPI discord is such a toxic place, I'm going to try to find help here!
How does one check if the member is streaming? I tried now a couple things such as: member.activity == 'Streaming', member.streaming and member.activity.type == 'Streaming'but I seem to not figure it out. 😦
(I use the last version of the discord.py Rewrite branch)

#

@earnest phoenix never just copypasta code, if you have no idea how to use them

#

@glass linden usually you can like make a check; for python for example:

if guild.id == IDHERE:
    #dosomething
else:
    pass

also a couple message above your question, is an example for another language

glass linden
#

Oh

#

Thanks

earnest phoenix
#

Yw

#

Thing is like, you didnt mention what language you use, so I cant really help much

#

And also I'm not a pro, but these are just simple examples to do it

glass linden
#

I thought I said js

#

But I think I didn’t

earnest phoenix
#

You just edited it? ;3

glass linden
#

Oh that was before not rn

#

Like when u didn’t reply

#

That was like one min after I sent it

earnest phoenix
#

Hmm then my mistake, next time mention it more then just ? js

glass linden
#

Ok

earnest phoenix
#

Just like I did (I use the last version of the discord.py Rewrite branch)

#

haha

glass linden
#

Oh

earnest phoenix
#

If one miss that, they are blind

#

hahahahha

glass linden
#

I see

#

XD

earnest phoenix
#

But with Js I cant help you much

glass linden
#

I’m going to text a few codes

earnest phoenix
#

I never really worked with JS and Discord

glass linden
#

That I may know

earnest phoenix
#
if (msg.guild.id === guildid) {
    //do something
} else { }
#

Not sure, but that can might work ;3

glass linden
#

Hmm

alpine lark
#

For anyone doing node bot.js to have there bot up I suggest using forever instead of node

earnest phoenix
#

why would you put an empty else block there

fluid basin
#

Thonk How do you find ws ping for eris

solemn obsidian
#

client.shard.latency

fluid basin
#

Yeah I found it

bleak sapphire
#

guys im using discord py and im trynna use the discord bot list api
is self really required even though im not using rewrite?

gilded thunder
#

Are you using Async or rewrite?

bleak sapphire
#

async

gilded thunder
#

If you're using Async, you don't need self.

#

Same here.

bleak sapphire
#

oh ok ty

gilded thunder
#

All good.

bleak sapphire
#

nothing bad will happen right if i reduce the sleep timeout?

gilded thunder
#

Might get ratelimited.

#

Doesn't need to be live though.

bleak sapphire
#

oh ok

gilded blaze
#

Anyone else have had VueJS make html elements smaller?

#

idk why it's happening

spring ember
#

I wanna make a web dashboard, what framework of JS should I use?

gilded blaze
#

u could use express

bleak sapphire
#
       Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-eznnyo0l/logging/

 !     Push rejected, failed to compile Python app.

 !     Push failed

what on earth

#

nvm i think i fixed it

#

@gilded thunder it wont work idk why

logger = logging.getLogger('bot')

def __init__(bot):
    token = environ.get('DBL_TOKEN')
    dblpy = dbl.Client(bot, token)
    bot.loop.create_task(update_stats())

async def update_stats():
    while True:
        logger.info('attempting to post server count')
        try:
            await dblpy.post_server_count()
            logger.info('posted server count ({})'.format(len(bot.servers)))
        except Exception as e:
            logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
        await asyncio.sleep(1800)
#

still not showing the server count on dbl

gilded thunder
#

Β―_(ツ)_/Β―

bleak sapphire
#

can u show me ur code (without the token ofc)

earnest phoenix
#

@gilded blaze nope i haven't

gilded thunder
#

I haven't implemented it either.

spring ember
#

I meant what framework for gui

earnest phoenix
#

frontend? Vue

spring ember
#

Thx

bleak sapphire
#

im making a rainbow role command and i wonder whats the max interval i can give without getting my bot banned

#

anyone knows a good interval?

uncut slate
#

don't make a rainbow role command regardless

#

that's a good interval

bleak sapphire
#

:/

#

fk

#

ts height

#

ts height me

#

fk

#

i forgot im in dbl