#development

1 messages Β· Page 441 of 1

past pike
#

yeah i know

#

but i want to change it. He needs to send the mentioned user a dm. I already searched for tutorials but no good answers

earnest phoenix
#

try looking at the documentation

knotty steeple
#

just do kUser.send()

#

should work

earnest phoenix
#

and don't expect to be spoonfed

past pike
#

okay i would try

knotty steeple
#

and yes you should look at the docs

past pike
#

I already read some docs

earnest phoenix
#

if you did you would know how to do that

#

please don't expect to be spoonfed, we aren't here to spoon-feed beginners

#

we're here to help beginners

#

and help them understand

past pike
#

I can't know every command

#

but the code works. thnx

earnest phoenix
#

ik, but reading docs about the topic of what you want to do (dm the user) will help you, and you don't have to remember all commands

#

just look at the docs

past pike
#

okay okay

earnest phoenix
#

didnt find this on the docs lol, how can I edit a category's perms?

#

cause categoryChannel.overwritePermissions is the same as guildChannel.overwritePermissions

#

thats discord.js btw

slender thistle
#
save_warn = 'UPDATE WarnLog SET = {} + 1 WHERE UserID = {}'.format(warn_count, member.id)

sqlite3.OperationalError: near "=": syntax error GWcfcThonk
warn_count is equal to 2 GWcfcThonk

knotty steeple
#

technically you are setting nothing

slender thistle
#

Turns out I was SELECTing only one column GWchadThink

spring ember
#

@slender thistle use an SQL prestatment!

#

SQL injections ahem ahem

earnest phoenix
#

One message removed from a suspended account.

#

get a vps

#

One message removed from a suspended account.

#

read one of the pinned messages

#

the one by york

slim heart
#

Which means it keeps like receiving errors while trying to connect to the discord api but idk why

quasi marsh
#

Are you with scaleway?

slim heart
#

Whats that mean?

quasi marsh
#

VPS hosting

slim heart
#

No

#

I use home hosting

quasi marsh
#

Hmm

slim heart
#

oof

tidal parrot
#

@slim heart discord dyin

slim heart
#

No but it happens like every day oof

tidal parrot
#

well then maybe its on ur end

inner jewel
#

that means internet

prime cliff
#

No Discord is indeed broken

#

Embeds are not showing and i recently got internal server errors on my bots

tidal parrot
#

u see

#

im not entirely retarded

prime cliff
real ginkgo
#

Hey

marsh lark
#

how do you enable server count on the web page for your bot or is there certain requirements to enable it?

topaz fjord
#

no

#

you just post to the api

tired rampart
#

Add me

quiet bobcat
#

?

marsh lark
#

ah seen it in the docs now turtle thanks

sick cloud
#

i didn't add any console log πŸ‘€

topaz fjord
#

are u sure

sick cloud
#

yes

earnest phoenix
#

lol

runic cloud
#

pls

prime cliff
#

The error is telling you to use Channel.Send not Channel.SendMessage

#

Also you need to download the ffmpeg library

restive silo
#

what

#

no

#

you dont need that

#

you only need ffmpeg in your path or global with a Enviroment Variable set in windows

runic cloud
#

what do I have to do

#

help plss.sss

slender thistle
#

You have already been told what to do

runic cloud
#

but I do not understand

earnest phoenix
#

Do not expect to be spoon-fed.

#

Yep

#

If you are a beginner, have a will to learn and do not expect to be spoon-fed.

#

Use a course if you want help, or go to a coding server l

#

@runic cloud

spring ember
#

ew ffmpeg

#

am I right @restive silo

earnest phoenix
#

@runic cloud The error is telling you to use Channel.Send, not Channel.SendMessage.
And next time, read the error carefully before going help pls

#

Too true. I did that with my bot and everyone just told me to fuck off. I worked it out myself and learnt.

mental solstice
#

thats all anyone does πŸ˜‚ just post links and pretend they are elite programs and tell people to piss off

earnest phoenix
#

Wait... was it on this server?

#

@earnest phoenix

#

Nope

#

oh ok

#

DW I wassn't bannes

#

maybe they have different rules

mental solstice
#

it happens on this server just as often

earnest phoenix
#

Don’t spoon-feed or attack beginners.

#

They gave me a warning

#

attack beginners

#

Damm attcak is a strong word

#

ikr

#

and it was on this server

#

(the rule)

#

Wait I won't get banned for what I said ^^

#

i don't think so

#

Fewwwwwwww

#

I meant no harm

#

I was trying to encourage

ruby dust
#

in python, how would you allow ascii characters to be printed in the console? cause right now I get this instead:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 116-123: ordinal not in range(128)

earnest phoenix
#

Try stack overflow or a forum maybe? I really don't know. Sorry

spring ember
#

@ruby dust you are trying to decode with ascii utf letters

#

like א

#

which is impossible

#

send code

#

if it's JSON then I faced that

#

like json in python

ruby dust
#

it's not really my fault, I just log command executions in the console, probably a server name or a user name has unicode

#

probably because I convert every name and id as str()

spring ember
#

oh yeah

mental solstice
#

use .encode() instead

spring ember
#

what version?

ruby dust
#

of python?

spring ember
#

of python

#

yes

ruby dust
#

3.6.4

spring ember
#

oof I thought it was fixed in 3.x

#

because the default encoding in Python 3.x is utf

#

umm

#

you should do .encode('utf-8')

ruby dust
#

so I guess str(ctx.author.name).encode('utf-8') should work?

spring ember
#

it will fix the issue

#

but it's weird

earnest phoenix
#

ok.

#

What with?

#

So basicly I am trying to add a bot.

#

ok

#

And it says bot not in discord.

#

This error

#

306949094608338944 is not in the Discord Bots server

#

And I was wondering what that means.

#

Or what do I do.

#

IDK. Does your bot work? Is all the info correct. Ping an admin maybe if this isn;t the case.

#

My bot works.

#

It is being used.

#

Clinet ID and ifo correct?

#

OK

#

Fair

#

IDK then

#

Yes it is right.

#

Ping an admin

#

Or a mod?

#

Or a website admin?

#

IDK, I am new

#

@fossil oxide Help me please.

#

Ok

#

I just tagged one.

#

Maybe a mod?

#

If he doesn't respond

ruby dust
#

What exactly is the problem?

earnest phoenix
#

^^ Look up

mental solstice
#

306949094608338944 is not in the Discord Bots server

#

if your bot is not in the server.. its not in the server

ruby dust
#

But where are you getting that message from?

earnest phoenix
#

What you mean.

#

Not in the server.

mental solstice
#

...

#

what is the name of your bot

ruby dust
#

Where are you getting that message from? πŸ€”

simple bramble
#

namespace AssistantJoe.Core.Commands
{
    public class Ask : ModuleBase<SocketCommandContext>
    {
        [Command("ask")]
        public async Task HelpAsync(SocketSystemMessage userMessage)
        {

            EmbedBuilder embed = new EmbedBuilder();

            embed.WithTitle("You have asked a question to the staff members! This is your question:");
            embed.WithDescription(userMessage + "\n \n" +
                "*Your question has been sent to <>!*");
            embed.WithFooter($"{DateTime.Now}");
            embed.WithColor(Color.DarkBlue);

            await ReplyAsync("", false, embed.Build());

        }
    }
}
``` What this is supposed to do is that you would type the command ``ask`` and after ask, you type whatever you want (eg hello!) and it will put it in the embed, but it gives me an error with "message not found" idk how to fix
mental solstice
#

you just need to get the message as 1 argument

#

HelpAsync([Remainder] String message) {

simple bramble
#

ok

mental solstice
#

remainder gets all the arguments as 1

simple bramble
#

k

mental solstice
#

if you needed like a severity argument, you could do (String severity, [Remainder]String message)

#

would allow them to .ask important this is my question

simple bramble
#

it gives me an error of the input text has too many parameters

mental solstice
#

can i see the code

simple bramble
#

namespace AssistantJoe.Core.Commands
{
    public class Reply : ModuleBase<SocketCommandContext>
    {
        [RequireUserPermission(GuildPermission.Administrator)]
        [Command("setup")]
        public async Task HelpAsync(SocketGuildUser user, String severity, [Remainder]String message)
        {

            EmbedBuilder embed = new EmbedBuilder();

            embed.WithTitle("You have replied to a question! Here is your answer to <@" + user.Id + ">'s question:");
            embed.WithDescription(message + " \n \n" +
                "*Your answer has been sent to <#" + ">!*");
            embed.WithFooter($"{DateTime.Now}");
            embed.WithColor(Color.DarkBlue);

            await ReplyAsync("", false, embed.Build());

        }

    }
}
#

i left out what its using, do you need that as well

mental solstice
#

because youre asking for a guild user aswell?

simple bramble
#

wait

#

oops wrong one

mental solstice
#

thats in the setup command

simple bramble
#
{
    public class Ask : ModuleBase<SocketCommandContext>
    {
        [Command("ask")]
        public async Task HelpAsync(String severity, [Remainder]String message)
        {

            EmbedBuilder embed = new EmbedBuilder();

            embed.WithTitle("You have asked a question to the staff members! This is your question:");
            embed.WithDescription(message + "\n \n" +
                "*Your question has been sent to <>!*");
            embed.WithFooter($"{DateTime.Now}");
            embed.WithColor(Color.DarkBlue);

            await ReplyAsync("", false, embed.Build());

        }
    }
}
#

ill have to think about the setuo as well

mental solstice
#

you only need a minimum of 2 arguments passed by the user for that to work

simple bramble
#

i got it to work

mental solstice
#

you get too many parameters when someone types their ask message? and if you arent doing severity levels.. you dont need it.. thatwas just an example

simple bramble
#

i got rid of string severity

earnest phoenix
#

How would I create a leaderboard for this? ```

'USERID': {

'id':USERID,
'profile':{
'xp':0,
'level':5,
'coins':50
}
},
'UserID':{

'id':USERID,
'profile':{
'xp':50,
'level':20,
'coins':250
}

}```

#

try using embeds

#

im talking about putting them into the order

#

try comparing to see what is the biggest

#

but how could I do that with all the users?

#

idk

#

what language are you using

#

node.js

#

Well you're out of luck, try looking for someone else.

civic fulcrum
#

You can't sort an object in JS; you'd have to convert it to an array and sort that

keen drift
#

Objects have no index, so there's really no order

novel topaz
#

is there an example for using webhooks to receive vote updates for python like there is in the README.md of dblapi.js?

quartz kindle
novel topaz
#

but there is no example for vote updates with webhooks

quasi marsh
#

I don't think the python lib can do that atm

novel topaz
#

just the server count thingy

#

isn't there a way to get vote updates with python without using the dbl python lib?

#

because python can do webhooks, I believe

#

and when your bot gets over a thousand upvotes per month you need to use webhooks anyways

night imp
#

You could take in the request without the lib iirc

#

just listen for it

novel topaz
#

well, gonna look into all of that

#

i've never really worked with web stuff in programming

night imp
#

Can't remember it fully but pretty sure it sends a post request - don't quote me - so if you listen for a post request to the path it will have the info

novel topaz
#

yeah, that's what I understood by just reading what DBL writes on that: DBL sends some kind of request to a specified URL and I just need to listen for it

#

if i got this correctly

night imp
#

Yeah

novel topaz
#

now i just need to work out how i listen for that in python and implement it in the bot

earnest phoenix
#
namespace AssistantJoe.Core.Commands
{
    public class Reply : ModuleBase<SocketCommandContext>
    {
        [RequireUserPermission(GuildPermission.Administrator)]
        [Command("setup")]
        public async Task HelpAsync(SocketGuildUser user, String severity, [Remainder]String message)
        {

            EmbedBuilder embed = new EmbedBuilder();

            embed.WithTitle("You have replied to a question! Here is your answer to <@" + user.Id + ">'s question:");
            embed.WithDescription(message + " \n \n" +
                "*Your answer has been sent to <#" + ">!*");
            embed.WithFooter($"{DateTime.Now}");
            embed.WithColor(Color.DarkBlue);

            await ReplyAsync("", false, embed.Build());

        }

    }
}```
mental solstice
#

?

#

Just send embed... not embed.Build ()

spring ember
#

@mental solstice it's an embed builder

vernal crow
#

Does anyone know what region this server is in?

spring ember
#

Us west

vernal crow
#

Okay. thank you.

spring ember
#

Eu west

#

Whoopsie

novel topaz
#

has someone already implemented listening for upvotes in their discord.py bot using webhooks?

#

i'm kinda confused

#

i can't figure out how to listen for post requests

mental solstice
#

I know what it is @spring ember you arent required to use that method to pass it into the SendMessage method

sick iron
#

So I'm a little frustrated currently. https://hastebin.com/judoqemuza.vbs When a user levels up I want to add a role but when I retrieve the role from my database, id of: 462357480824111123 it returns 462357480824111100.... i have no clue why. I'm not asking for a fix but does anyone know why I'm not getting the correct value even though 462357480824111100 isn't even in my database

#

I can retrieve values just fine in other tables but this one. I've tried a new table, different column names, different guilds, and nothing returns correctly

#

For the roles

mental solstice
#

That does .test do?

#

And what part is showing u the wrong id?

sick iron
#

.test is the column which stores the ID of the role.

#

when I message.channel.send(rowww.test); it sends the wrong value

mental solstice
#

Is the console.log showing the correct id?

sick iron
#

nope

mental solstice
#

Ok. It shouldnt.. Just wondering

sick iron
#

The value it logs and sends isn't even stored anywhere in my database so that's why I'm so confused.

mental solstice
#

Its stored in your db properly?

sick iron
#

Yes.

mental solstice
#

I havent used JS very much.. but it looks right. Only thing i can think, is the type conversion is taking off the last 2 numbers then converting back long.. but its unlikely

#

Are you using VSCode by chance?

sick iron
#

I am

mental solstice
#

Can you put a breakpoint at your sql.get statement and debug it

sick iron
#

yah give me a bit

sick cloud
#

What language/library?

#
if (<message>.channel.type !== 'text') return;

Add that at the top of your message event, and replace <message> with whatever your message variable is (msg, m, message..)

#

in DMs? πŸ‘€

#
if (message.guild) {
    let mod_role = message.guild.roles.find('name', settings.modrolename);
    // add any guild-needing code here..
}
// other code..
#

Try that, that might work.

heady zinc
#

i was going to say that

#

if you want to check for dms, you just have to check if the guild property exist

#

if it doesn't, then it's a dm

sick cloud
#

uhh

#

Your setup confuses me to say the least, dunno why that isn't working..

#

Restrict owner commands to ID? >.>

#

And honestly, there are ways to get around it.

heady zinc
#

yee

#

owner commands should be strictly restricted to IDs

sick cloud
#

I'm having some issues with canvas.. I have this code:

const canvas = Canvas.createCanvas(700, 250);
const ctx = canvas.getContext('2d');

const background = await Canvas.loadImage('./background.png');
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

// avatar
ctx.beginPath();
ctx.arc(145, 125, 100, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const { body: buffer } = await snekfetch.get(i.user.displayAvatarURL);
const avatar = await Canvas.loadImage(buffer);
ctx.drawImage(avatar, 45, 25, 200, 200);

// text
ctx.font = '55px sans-serif';
ctx.fillStyle = '#BE3EFA';
ctx.fillText(i.user.tag, canvas.width / 2.5, canvas.height / 1.8);

const welcome = new Attachment(canvas.toBuffer(), 'welcome-image.png');
client.channels.get('462311344558047232').send(`**${i.user.username}** has joined us! :wave:`, welcome);

However, when a user joins.. it only shows their avatar, no username/text; am I doing something wrong here?

mental solstice
#

Is tag the correct function for getting usernames?

fluid basin
#

hmm

#

depends wut library you are using

sick cloud
#

πŸ‘€
Fixed now, turns out the image was taking too long so I put text before it.

slender thistle
#

Any Python libraries to work with images?

blazing star
#

yeah @slender thistle pillow is one

slender thistle
blazing star
#

when you need to use it its

from PIL import Image
img = Image.open("somefile.png")
#  do stuff
slender thistle
#

πŸ‘Œ

buoyant needle
#

so you could do

blazing star
#

...

buoyant needle
#
img = Image.open("triggeredface.png")
#  do stuff```
slender thistle
#

Enough explaining, I will figure out the other stuff myself GWchadThink

blazing star
#

xd

slender thistle
#

Thanks, though @blazing star

blazing star
#

np

sick cloud
#

Anyone here good with CSS? I need some help, but I'm not posting it publicly since its private thing πŸ‘€

buoyant needle
fluid basin
#

ken

earnest phoenix
#

How do I make the bots icon float?

#

on my page?

#

Fortnite

#

I mean how the hell do you even animate with html?

earnest phoenix
#

anyone know is there a npm similar to aws-sdk?

#

nope

#

idk

earnest phoenix
#

no one know how to animate bot icon on my bot page?

ruby dust
#

@earnest phoenix css in long description

novel topaz
#

has someone implemented listening for upvotes for their bot in discord.py using webhooks?

stable tide
#

How do we send ping using a Photo like this bot does:

#

@river compass does

#

Developed by Ken#0027

quartz kindle
#

you need an image manipulation lib

#

popular ones are canvas and jimp

#

i think canvas is simpler for that

stable tide
#

Yep but can we do that using js

#

Nvm

quartz kindle
#

with canvas yes

stable tide
#

I m dumb i use canvas

quartz kindle
#

the same way you would do in html5 canvas

stable tide
#

Thnkz

stable tide
#

I host on glitch currently and i wanna make a command that would update the code when i run command t!wha

#

The code:

#
const { Command } = require('klasa');const { exec, spawn } = require("child_process");module.exports = class extends Command { 	constructor(...args) {		super(...args, {			aliases: ['details', 'what'],			description: 'Provides some information about this bot.'		});	} 	async run(msg) {		 msg.channel.send("Updating..."); exec("git pull", async (error, stdout) => { // why are you in this file? xD if (stdout.toString().startsWith("Already")) { return msg.channel.send("Nothing changed since the last update."); } else { await msg.channel.send(`\`\`\`xl\n${stdout.toString()}\`\`\``); this.client.destroy(); spawn("node", ["index"], { cwd: process.cwd() }); } });	} };```
compact haven
#

not even sorting your own code

#

I don't know anything about klasa either GWsabianPepoHmm

stable tide
#

πŸ˜‚ πŸ˜‚

earnest phoenix
#

t

onyx summit
#

What is a good editor for editing on sftp? plz tag

spring ember
#

how is sftp related to editors @onyx summit

#

also what programming language do you use?

onyx summit
#

node

#

I mean atm I have to do this:
Download the file I want to edit, open with editor, save it, upload it again
I know there are editors that do that itself

#

@spring ember

uncut slate
#

you probably mean ssh

#

writing code over SSH isn't exactly a good idea, the latency is going to be noticeable

#

ideal setup would be using git

#

create a repository (gitlab has infinite private repositories, github gives you one) and clone it on your VPS

fluid basin
#

I don't think github has private repos at all without a plan

quartz kindle
#

well i use mobaxterm

#

which does what you want

#

it has an sftp window where you can browse remote files, double click them and they will download and open automatically in your editor

#

and be uploaded automatically on save

onyx summit
#

My bot can play music now
nearly any bot has that, but I still feel great about it

topaz fjord
#

how is that development related zoomeyes

onyx summit
#

Dunno

inland verge
#

i have a music bot

onyx summit
#

cool

#

can bots send emojis from servers there are not on?

#

no right?

inland verge
#

i dont think so

#

wait

#

do u use node/python/.... ?

slender thistle
#

@onyx summit They can't

onyx summit
#

node

inland verge
#

oh

#

python

#

its easier πŸ‘Œ

onyx summit
#

I never programmed with python but with js so I prefer js

earnest phoenix
short siren
#

I get that with canvas like apparently it's something to do with guild tools being out of date maybe see of yours is updated

earnest phoenix
#

guild tools?

#

I think its something to do with python not being in path

short siren
#

Build*

earnest phoenix
#

yeah

#

:/ I thought it was fixed but it wasnt

#

use

inner jewel
#

what language?

earnest phoenix
#

well its an object

#

just give him the array

#

javascript

#

<json>.username_history

#

will give you this

#
[
        {
            "name": "Roblox",
            "changedToAt": 1463692529000
        },
        {
            "name": "rObLoX",
            "changedToAt": 1460501855000
        },
        {
            "name": "roblox",
            "changedToAt": 1457309480000
        },
        {
            "name": "Roblox",
            "changedToAt": 1453693653000
        },
        {
            "name": "roblox",
            "changedToAt": 1437522392000
        },
        {
            "name": "Deprive",
            "changedToAt": 1434807110000
        },
        {
            "name": "deprive",
            "changedToAt": 1430861254000
        },
        {
            "name": "Candies",
            "changedToAt": 1428269202000
        },
        {
            "name": "Autocliq",
            "changedToAt": 1425658817000
        },
        {
            "name": "Sensual",
            "changedToAt": 1423057400000
        },
        {
            "name": "CrushedGrape"
        }
    ]```
inner jewel
#
for(const entry of JSON.parse(...).username_history) {
    doStuffWith(entry.name);
}```
earnest phoenix
#

or that

inner jewel
#

where the ... would be the string with that data

earnest phoenix
#

if never seen "of" used in an for statement

#

@earnest phoenix i just want
Roblox
rObLoX
roblox
Roblox
Deprive
deprive
Candies
Autocliq
Sensual
CrushedGrape

#

ah yes.. henry some mod's code is what you want

#

yeah

#

thank you natan

#

and thank you lose, you tried :v

#

i have this error

#

SyntaxError: Unexpected token h in JSON at position 0

inner jewel
#

what's the whole code?

earnest phoenix
#
const Discord = require("discord.js");
const got = require("got");
exports.run = async (client, message, args) => {
const res = await got(`https://mc-heads.net/minecraft/profile/${args}`, { json: true });

for(const entry of JSON.parse(`https://mc-heads.net/minecraft/profile/${args}`).username_history) {
    message.channel.send(entry.name);
}

};```
inner jewel
#

you need to actually make the http request

#

JSON.parse needs json data

#

you're giving it an url

#

which is not valid json

earnest phoenix
#

k

earnest phoenix
#

Okay i made this

const Discord = require("discord.js");
const got = require("got");
exports.run = async (client, message, args) => {
const res = await got(`https://mc-heads.net/minecraft/profile/roblox`, { json: true });

for(const entry of res.body.username_history) {
    message.channel.send(entry.name);
}

};```
#

is possible to get all names in one line?

#

user1, user2, user3

uncut slate
earnest phoenix
#

TypeError: entry.name.join is not a function

uncut slate
#

that's not how you'd use it

earnest phoenix
#

entry.name.join(,)

#

incorrect?

uncut slate
#

yes, that's incorrect

#

you want to use it on an array

earnest phoenix
#

i want to put all of them together

#

is possible?

uncut slate
#

yes

#

it is

earnest phoenix
#

how?

uncut slate
inner jewel
#

res.body.username_history is the array

for(const entry of ARRAY) {

}```loops through the entries on it
grizzled totem
#

so uhm, is there a way to efficiently detect invite links in messages?

blazing star
#

regex

grizzled totem
#

can you generate those easily? since ik that regex is really annoying to use

civic plank
#

s+say im here

#

why isn't my bot here

#

its serving 6 servers

sullen path
#

@grizzled totem what programming langauge?

night imp
#

just find some regex code online if you don't want to deal with making it

#

what I do

sullen path
#

but yes, regexes are the best way

velvet sapphire
#

I don't know how

earnest phoenix
#

if i have images on a website that i use to pull from for an attachment how would I pull images that have names with hyphens?

sullen path
#

you put the hyphen in the url?

keen drift
earnest phoenix
#

but the url is my website

#

and it points to a directory

sullen path
#

um

keen drift
#

you still put a hyphen in it?

sullen path
#

I still don't see the issue

keen drift
#

lol

earnest phoenix
#

there are multiple images in this directory as well

sullen path
#

so?

#

it works with the hyphen

keen drift
#

I don't see the issue either lmao

earnest phoenix
#

.setImage('http://gamercord.com/pokemonimages/all_gifs/'

sullen path
#

no issues

earnest phoenix
#

so where would i put this hyphen at then?

keen drift
#

whatever it's suppose be

sullen path
#

ok, put it in and show us the line again

#

I have a feeling you mean an apostrophe

keen drift
#

would it make a difference GWfroggyUWot3 with apostrophe

sullen path
#

yes bc it might break the string

earnest phoenix
#

see thats what I am saying you are asking me to put it in.. Im not trying to pull just one image.. this is a spawn command for a pokemon bot

sullen path
#

oh

#

you are trying to get all the images in a directory in 1 request?

#

🀦

earnest phoenix
#

yes that have a hyphen

sullen path
#

welp

earnest phoenix
#

in addition to the ones i already have spawning

sullen path
#

so, you want all the images, as long as they have a hyphen in their name

earnest phoenix
#

why is my name hoister no hoisting?

#

yes

keen drift
#

Because you were hoistering

earnest phoenix
#

what the hell is hoisting lol

sullen path
#

there is a way to do it, but it's kinda messy

keen drift
#

Using low value character like ! to bring you to the top

earnest phoenix
#

messy is ok as long as I can do it lol

#

ahhh ok i see what you are saying fishy because of the stuff in my name

sullen path
#

enable directory listing for that folder, get the raw HTML by accessing it (just the folder, not any images), scrape the HTML for links, check to see if the filenames in the links have a hyphen, then use the links that do in your requests. You need to get each file one at a time

#

I'm not sure I explained that well

earnest phoenix
#

oof ok that is pretty messy lol but thank you

sullen path
#

np

earnest phoenix
#

shit literally skyrocketing πŸ€”

#

theres no way somebody is trying to dos my bot or something, right? πŸ˜‚

languid dragon
#

inb4 ur graphs are backwards and ur just using mad CPU

earnest phoenix
#

πŸ˜‚ nah its accurate

#

i figured out i was on the front page cos the votes werent reset fully

#

somehow I was number 2 on front page lol

earnest phoenix
#

What bot is it

earnest phoenix
#

its not there anymore, just my music bot

earnest phoenix
#

can anyone recommend a server host?

gusty topaz
#

click on the pinned message list

#

and scroll down a bit

earnest phoenix
#

i see the sticky

#

1 year for $40

#

thats cheap!

#

pls help

spring ember
#

Individual I think

#

If your server runs out of memory it might be a leak

#

How many guilds do you have?

#

@earnest phoenix

earnest phoenix
#

it only had 512mb

#

and im running apache on it aswell

#

and some other boths

#

but ill investigate if its a memory leak

neat falcon
#

apache angryeyes

spring ember
#

apache is ok for php

blazing star
#

True

neat falcon
#

php angeryBOYE

fluid basin
#

lul

fervent oyster
#

Ok question, I'm using nodejs, and I'm wondering how I can eval multiple lines of script with out it crashing, how do I do that?

earnest phoenix
#

can't fully understand your question

ruby dust
#

discord.py

if I defined a timeout of 60 seconds in bot.wait_for event, do I catch a discord.TimeoutError or just TimeoutError?

earnest phoenix
#

Declined

ruby dust
#

nvm it's neither of those

fervent oyster
#

When I use multiple lines in scripts for eval the bot crashes, how do I prevent that?

spring ember
#

@ruby dust yeah it's annoying af, I couldn't catch it but then I found out

ruby dust
#

I wonder if it's even in docs

#

cause asyncio.TimeoutError is what it needs to be

earnest phoenix
#

yes, generate

quartz kindle
#

you mean, without the background and profile images? xD

earnest phoenix
#

for real

#

that shit

#

takes only less than 200 lines of code

#

to process and send

#

and it takes from about 300 to 600ms

inner jewel
#

canvas has memory leaks btw

quartz kindle
#

my canvas takes < 100ms to generate

#

it doesnt use background images

normal perch
#

What does enabling rich presence on my bot do? I know what it does typically but im confused how it works with a bot?

inner jewel
#

bots can't have rich presence

#

when you enable it, you enable for the application

#

applications can have both rich presence and bots attached to them

normal perch
#

okay.... So your application would be linked to a program/game? I still dont see how they are related.

inner jewel
#

https://discordapp.com/developers/applications/me

#

that page lists your applications

#

for all applications, you can create a bot user and enable rich presence

#

when you enable rich presence, you can create RP with icons from that application (even if you don't use any icons you need an application with RP enabled)

normal perch
#

so oh so the code attached to the game is using the app as a connection to discord?

knotty steeple
#

how to send an image with my bot? discord.js

earnest phoenix
#

message.channel.send("message", {files:[{attachment: image, name: 'name'}]})

#

@knotty steeple

knotty steeple
#

ok

earnest phoenix
#

anyone here uses ovh?

earnest phoenix
#

I don't anymore but I have used it before for quite a while, what's up?

sick iron
#

stupid question how can I tell if a mentioned user is a bot. (discord.js)...

#
let target = message.mentions.members.first();
if (target.bot) return message.channel.send("ERROR");

Above doesn't work. Am I doing something wrong?

torpid vale
#

target.user.bot since you are using a guildmember

#

it appears anyway

hard python
#

Can someone help me?

sick iron
#

k I'll try that nick.

hard python
#

how to i active fortress bot?

#

it doesnt delete server invites

sick iron
#

That fixed it. Thanks!

hard python
#

@torpid vale

#

@gilded plank

#

@uncut slate

uncut slate
#

don't ping random people

#

ask their support server

hard python
#

How do i activate the

#

fortressbot

uncut slate
#

ask their support server

tidal parrot
#

-canvas
-memory

PICK ONE

hard python
#

oh

compact haven
#

canvas hmmm

earnest phoenix
#

@tidal parrot Jimp

tidal parrot
#

blocking

earnest phoenix
tidal parrot
#

i didnt mean blocking you, i meant Jimp is blocking in node.js

earnest phoenix
#

i know bro

tidal parrot
#

just makin sure

earnest phoenix
#

Does anyone know if node-canvas supports jpeg?

#

I'm trying to edit a jpeg with it but it won't load

#

How i create a channel that just a user can see?

tiny dune
#

in discord4j, is it possible to know if the bot joins a guild for the first time? Im thinking about UserJoinEvent but i dont know how to check my bots user id. any thoughts?

inner jewel
#

GuildCreateEvent

tiny dune
#

Ahhh. So does this fire for every guild that the bot is in after connected to the gateway?

topaz fjord
#

GuildCreate Event fires whenever the bot joins a new server

keen copper
#

Hey folks, I was wondering where people actually host their bots, regardless of what language it's written in, are folks just spinning up VMs on random cloud providers?

topaz fjord
#

@tiny dune

#

i set mine up on a vps

#

if you want to find some vps's there is a pin in this channel

keen copper
#

ahh fantastic

tiny dune
#

Ahh ok thanks

keen copper
#

Any chance you could tell me a bit about your deploy process? When you're ready to ship a new version of your bot do you just SSH in, pull down your code and run it?

quasi marsh
#

Me I just SCP the code over from local and reload from the bot

keen copper
#

Cool cool, you have a similar setup, just a random VPS?

quasi marsh
#

Yeah

buoyant needle
#

What color is it to make embed invisible?

quasi marsh
#

#36393E

buoyant needle
#

ah thanks

sick cloud
#

What's this?

tonymusicbot@ubuntu:~$ node polybot.js
events.js:188
      throw err;
      ^

Error: Unhandled "error" event. ([object Object])
    at Client.emit (events.js:186:19)
    at WebSocketConnection.onError (/home/tonymusicbot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:374:17)
    at WebSocket.onError (/home/tonymusicbot/node_modules/ws/lib/event-target.js:128:16)
    at emitOne (events.js:116:13)
    at WebSocket.emit (events.js:211:7)
    at WebSocket.finalize (/home/tonymusicbot/node_modules/ws/lib/websocket.js:185:12)
    at ClientRequest._req.on (/home/tonymusicbot/node_modules/ws/lib/websocket.js:635:10)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketErrorListener (_http_client.js:387:9)
tonymusicbot@ubuntu:~$ 

(discord.js latest-stable, didn't make any changes to code, it just suddenly started doing this)

quasi marsh
#

I had some WS issues too, maybe it's something with your server?

sick cloud
#

Dunno, my other bots are running on the same server perfectly.

sick iron
#

I has some issues with that error when i has my β€œbad” internet

austere meadow
#

first of all i’d recommend updating to master if it wouldn’t be too much work for you
and secondly have you got an event listener for client.on(β€œerror”...?

#

voice connections on stable are really janky

sick cloud
#

I don't have an error listener, should I add one?

#

And I know about that, going to be working on updating all my bots to master soon.

austere meadow
#

i think you should to see if that will catch the error

sick cloud
#
client.on('error', (err) => { log('error', err); });

something like that?

austere meadow
#

yeah that should work

sick cloud
#

(log is my custom function)

#

alright

#

wot, adding the error thing made it login

#

πŸ‘€

austere meadow
sick cloud
#

derp

#

thanks though lol

austere meadow
#

all good

sick cloud
#

Also, isn't master breaking for some code?

#

Like it changes a lot

young cradle
#

master is constantly updated, consider it as a beta of discord.js

#

But it is a lot stable

#

My bot has been running for months in master with no issue

sinful lotus
#

Master is better in a lot of aspects than 11.3 stable

drowsy lily
#

nightlies or bust

sick cloud
dusk thorn
#

lol

sick cloud
#

@dusk thorn :L

neon schooner
#

@sick cloud you need to have like two divs overlayed onto each other and stuff

sick cloud
#

I tried that just then, its worked buut it makes the button stretch over the entire page

neon schooner
#

Wierd

sick cloud
#

and the text is also sidewards

neon schooner
#

put it into a third div and limit the size? πŸ˜›

drowsy sentinel
#

Why not CTRL + U in Google Chrome. Search "Create a Server" and see how they did it.

#

Β―_(ツ)_/Β―

sick cloud
#

Thats copying

drowsy sentinel
#

No. Copying is if you copy.

#

Learning how they did it, is learning.

sick cloud
#

Β―_(ツ)_/Β―

neon schooner
#

uh

sick cloud
#

Though the text is also skewed

#

(it ain't advertising >:3)

neon schooner
#

Nono

#

Hm

#

Why is it applying to the text too

#

is my question

#

I'm obviously not staring at the code, but that's strange

sick cloud
#
div.button.outline {
    transform: skewX(-15deg);
    padding: 10px 21px;
    border: 2px solid #FFC302;
    max-width: 220px;
    text-align: center;
}
a.button.outline {
    padding: 12px 23px;
    background: transparent;
    text-decoration: none;
    color: #f2f2f2;
    transform: skewX(-0deg);
}
    <div class="button outline">
        <a href="/" class="button outline">mc.polycraftia.net</a>
    </div>

thats the code I'm using if it helps

drowsy sentinel
#

Probably cause it's wrapped in the same Div class.

#

You don't need ShewX in a.button.outline

sick cloud
#

I tried that to make it reset lol

earnest phoenix
#

is ovh down?

#

lmao

#

my bot is off

earnest phoenix
#

<command> "line here" "second line here"
(discord.js) Thonk

obtuse wagon
#

hi im new

#

this stuff looks so cool

vagrant creek
#

Hello, How to create a role with permission in js ?

stable juniper
#

https://anidiotsguide_old.gitbooks.io/discord-js-bot-guide

vagrant creek
#

oh thx

earnest phoenix
#

uhm

#

i need a key/value database

#

any recommendations?

blazing star
#

mongodb

restive silo
#

for NoSQL Databases Rethink and Mongo are common but i would probaly use SQL anyways because consistency and speed

#

Postgres blobhero

neon schooner
#

Postgres ❀

#

But yea, that or Mongo probs

fluid basin
#

SQLite for portability

blazing star
#

No mongo

neon schooner
#

Mongo yes

#

sorry

blazing star
neon schooner
#

I've just gotten so used to using postgres at this point

blazing star
#

Ew

fluid basin
#

cassandra when

#

fyi discord uses it

#

but doesn't mean you should use it though

neon schooner
#

that's fine

#

I'm not trying to scale as big as they are tho

topaz fjord
#

Mongo good

blazing star
#

yes

spring ember
#

@restive silo ayy since when do you use postgresql?

restive silo
#

since like 2 months

#

πŸ‘€

normal perch
#

I'm using sqlite because it was convenient but I know I'm gonna regret it later

young cradle
#

Depends on your necessity

#

And some things are just limited, like node for example not being able to handle 64bit integers (I totally do not have 4.3k reports of that in my bot because people have over 1b of currency)

quartz kindle
#

im using flat json files :D

young cradle
mellow plume
#

Hey I Created A Bot And How I Upload That Bot If Anyone Knows Dm Me

marsh lark
#

you have to wait for verification after upload

earnest phoenix
#

message.channel.send('@everyone') doesn't work even though the bot has enough perms... What shud i do?

compact haven
#

uh

#

take the @everyone role id

earnest phoenix
#

lol wtf

compact haven
#

and do message.channel.send("<@&idhere>")

earnest phoenix
#

server id?

slender thistle
#

Yep

compact haven
#

no

slender thistle
#

everyone role ID is server ID

compact haven
#

oh

earnest phoenix
#

i did <@&id>

#

not like this

#

it's <@id>

slender thistle
#

That way the mention doesn't work

inner jewel
#

no

compact haven
#

<@&id>

inner jewel
#

<@id> and <@!id> are user mentions

#

<@&id> is role mention

compact haven
#

yeah

inner jewel
#

<#id> is channel mention

earnest phoenix
#

hm

#

so why didn't it work

compact haven
#

well what's the server id of the place you're trying to ping

earnest phoenix
#

i did $eval message.channel.send("<@&326237705828564993>")

slender thistle
#

I got the same output GWchadThink

earnest phoenix
compact haven
#

@@everyone GWseremePeepoGGERS

earnest phoenix
#

yeah idek what the bot's on

#

probably high

inner jewel
#

<@&id> doesn't mention

earnest phoenix
#

so what does?

inner jewel
#

a literal @ everyone

ruby dust
#

if the role is set to not mentionable in server settings, then it won't mention

earnest phoenix
#

it definately has enough perms

slender thistle
#

In JS, there is a parameter disableEveryone, isn't there?

earnest phoenix
#

Ohh

#

ill check that

compact haven
#

I got rid of disableEveryone

#

I didn't think it was necessary

earnest phoenix
#

$eval message.channel.send(' @everyone', {disableEveryone: false}) boom it works!

#

thanks

fluid imp
#

How do I add a ban,kick, and warn system. I use Discord.js

earnest phoenix
#

<GuildMember>.ban()

inner jewel
#

no one here will spoonfeed you

uncut slate
#

I would rather just you send me the whole thing

frail harness
#

lmao

short siren
#

Same with .kick

#

For warn system you need database

#

So if you don't know js just try and make kick and ban for now

earnest phoenix
#

mute can be done too w/o a DB

#

use sets

floral stone
#

What is the command in ubuntu used to view the latest log for a running service app

#

It's something with journal

#

just don't know thye parameters

inner jewel
#

journalctl -n amount -f -u service

#

where service is the name

#

and amount is the last n lines to show

#

-f means any new lines will be printed as well

floral stone
#

wasn't there a way to see it live?

inner jewel
#

-f

floral stone
#

is that live!?

#

nvm

#

it is

earnest phoenix
#

How i get a list of channels

sick cloud
#

If you run a command that has incorrect args, and it reacts with an πŸ‘€ emoji to your message, how do you make the bot show a message with the info if the user reacts?

topaz fjord
#

i would personally tell the user they did the command wrong

#

but no it wouldnt count afaik

inner jewel
#

i'd have a listener (preferably a global one with a map of message id -> reaction handler) to listen for reactions on that message

#

if user adds that one you send the info message

sick cloud
#

Sounds pretty complicated, eek. alright though

young cradle
#

@inner jewel

earnest phoenix
#

does anyone know how to change bot's status type to watching in discord.py

austere meadow
#

if i'm sharding, should i open one database connection for each shard, or just one database connection across all shards?

tidal parrot
#

One database connection means no concurrency for database queries. You need multiple connections if you're going to be querying a database a lot.
It's best to use connection pooling for that (either a global pool shared by all shards, or a separate connection pool for each shard) which keeps connections open allowing you to reuse them without opening a new connection every time.

shy rose
#

jsut pool

#

from my experince could get ~10 queries per second per connection

tidal parrot
#

But that depends on the time it takes for a query to execute

shy rose
#

true but pooling removes that issue

#

removes/lightens

#

can still bottle neck its jsut harder

tidal parrot
#

Not really, it just means you can support A LOT more

inner jewel
#

also you should take care when pooling with a high number of connections

#

if the DB has per-connection resources allocated

#

too many connections = memory wasted

austere meadow
#

i'd say i query the database at a medium level, i query the database if the user doesn't exist when i need it, and then cache that user

#

i am noticing a few deadlocks here and there however

tidal parrot
#

What DB are you using?

austere meadow
#

@tidal parrot so sorry for the late reply i went out for a bit, im using postgres

sick cloud
#

Are there any good websites out there for bot documentation? (Apart from GitBook, I can't use it x.x)

tidal parrot
#

What are you doing to get deadlocks on postgres with a single connection

#

Afaik postgres is row level locking

#

And even then with a single connection that's impossible

#

I think

austere meadow
#

i dont even really know
it happens about once every one or two hours, im not really sure what's causing it though
i do query the database on (nearly) every message event for the user's settings (for stuff like adding experience, adding currency, etc.) but i cache the user after doing that so im not sure why i'd be getting deadlocks

earnest phoenix
#

can bot token join server discord with invite link? :v

ruby dust
#

it should say that in every docs

#

an instant invite link is used by user accounts, an oauth link is used by bot accounts

spring ember
#

how do I get the IntPtr of float[][] in C#?

spring ember
#

more specifically, how do I get the pointer to an array of arrays

onyx summit
#

@spring ember Dude that's not really good to ask in a Discord bot server

#

Maybe in a c# server

#

Can someone give me ideas for my bot? I have the classics and some extras, but I don't know anymore

spring ember
#

a. it's a development channel, b. I did in multiple servers

sullen path
#

am I doing this wrong?

    private static boolean updateStats(int payload) {
        try {
            URL url = new URL("https://discordbots.org/bots/461938818627665940/stats");
            Map<String,Object> params = new LinkedHashMap<>();
            params.put("server_count", String.valueOf(payload));
            StringBuilder postData = new StringBuilder();
            for (Map.Entry<String,Object> param : params.entrySet()) {
                if (postData.length() != 0) postData.append('&');
                postData.append(URLEncoder.encode(param.getKey(), "UTF-8"));
                postData.append('=');
                postData.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8"));
            }
            byte[] postDataBytes = postData.toString().getBytes("UTF-8");


            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
            conn.setRequestProperty("Authorization", dblToken);
            conn.setDoOutput(true);
            conn.getOutputStream().write(postDataBytes);

            Reader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));

            StringBuilder sb = new StringBuilder();
            for (int c; (c = in.read()) >= 0;)
                sb.append((char)c);
            System.out.println(sb);
            return true;
        }
        catch(Exception e) {System.out.println(e);}
        return false;
    }
#

it keeps throwing a 403 forbidden error

#

I feel like I'm not setting the auth header correctly

#

I'm doing the print stuff at the bottom so I can see the response

languid dragon
#

🀦

#

a decent on-topic answer

#

@sullen path

#

how's that

tidal parrot
#

a decent on-topic answer

languid dragon
#

see, now two people replied

sullen path
#

wishes bots can speak in this channel and runs !help

tidal parrot
#

or you could wait for someone who knows how to help you

languid dragon
#

are you feeling annoyed?

tidal parrot
languid dragon
#

Β―_(ツ)_/Β―

earnest phoenix
#

I have a question

#

How do i program my bot to ban, kick?

knotty steeple
#

I have a question

#

What library?

earnest phoenix
#

Discord.js

knotty steeple
#

<GuildMember>.ban()

#

iirc

earnest phoenix
#

Thanks

#

check docs first tho

#

before asking

#

How do I access a message's second mention with Discord.js?

#

I know you can access the first mention with msg.mentions.members.first()

quiet orbit
#

I would say try .second() xd
But that is most likely wrong

topaz fjord
#

.second is not a thing

earnest phoenix
#

I checked the docs

#

And yeah nope

quiet orbit
#

xd knew it

restive silo
#

it takes a number of elements it should return from the start

topaz fjord
#

@restive silo reworked docs ?!?!?!?

restive silo
#

what no

topaz fjord
#

mine doesnt look like that

restive silo
#

its my own custom css on the website

earnest phoenix
#

Different versions

restive silo
#

no

topaz fjord
#

@restive silo send

restive silo
#

only custom css

earnest phoenix
#

I use the master branch

topaz fjord
#

@restive silo put it on stylish kthx

restive silo
#

its the same on stable and master @earnest phoenix

#

@topaz fjord its on stylish

topaz fjord
#

why didnt u tell me u weeb

earnest phoenix
restive silo
#

its not mine btw

#

but some friend of me made it for me

earnest phoenix
#

Doesn't the website have a dark theme

#

By default

restive silo
#

yea but this one is better imo

earnest phoenix
#

I don't visit the docs as much these days but I still use the default theme though

restive silo
#

thats fine

earnest phoenix
#

Hey... uhh.

#

I'm a newbie in these things of making bots.

#

I don't know how to put ban, mute, kick options to my bot

kindred epoch
#

what language and library are you using?

karmic parcel
#

Doesn't stylish steal your browsing data?

earnest phoenix
#

I use Javascript and i'm using discord.js

#

@kindred epoch

jade flower
#

Who know python bot development ?

kindred epoch
#

@earnest phoenix look at member.ban() member.kick() for ban and kick

earnest phoenix
#

Okay

#

i'll try

#

Thanks

kindred epoch
#

np

earnest phoenix
#

i'm really noob in this

#

Look

#

if (message.content == ',.ban') {

#

What do i put next?

#

@kindred epoch

kindred epoch
#
const client = message.client
        if (!message.member.hasPermission("BAN_MEMBERS")){
            return message.reply("You don't have permissions to ban users.");
        }
        
        if (!message.mentions.users.first()) {
            return message.reply("You need to mention a user first.");
        }
        
        const member = message.guild.member(message.mentions.users.first());
        if (!member.bannable) {
            return message.reply("I can't ban that user due to a lack of permission or invalid role hierarchy."); 
        }
        
        member.ban().then(() => {
            message.reply(`I banned ${member}`).then(msg => msg.delete(5000));
        }).catch(err => {
            message.reply("I was unable to ban that user.");
});
earnest phoenix
#

Holy

#

thanks a lot man!!!!

kindred epoch
#

np

topaz fjord
#

why are you giving code

earnest phoenix
#

@kindred epoch why you are using const member = message.guild.member(message.mentions.users.first()) when you can just do const member = message.mentions.members.first()? lol

kindred epoch
#

idk

onyx summit
#

Is it worth it to make a Website for the bot?

stable juniper
#

Yea

#

Not for a small bot tho

onyx summit
#

80 Servers bloblul

#

Pretty smallthonkku

earnest phoenix
#

I can't get on my bot

sick cloud
#

@earnest phoenix walking or getting on your bot might hurt it, thats like me irl standing on you or something. don't be mean to your bot :(

#

seriously though, whats your issue? :p

earnest phoenix
#

No, nothing

sick cloud
#

πŸ‘€

earnest phoenix
#

Oh

#

I have a question

#

How do i declare an argument on js

bold pewter
#

πŸ€”

sick cloud
#

look into strings but

#

message.content is your start

earnest phoenix
#

I don't know

bold pewter
#

Just write your bot in Go instead :^)

earnest phoenix
#

In go?

#

What's tha

night imp
#

He wants to write in js.

#

@earnest phoenix you would want a JavaScript array
https://goo.gl/E0wYJp
JavaScript Arrays - W3Schools

from message.content

earnest phoenix
#

@night imp Thankyou!!!

night imp
#

Which you can get be splitting it seeing as it is a string

earnest phoenix
#

OH my god

#

I can't anymore

#

I have been all the goddamn day trying figuring out how tf i declare arguments

quartz kindle
#

what do you mean with arguments?

stable juniper
#

@earnest phoenix in what language/library

earnest phoenix
#

Js

#
console.log('El bot esta listo');
const Discord = require('discord.js');
const bot = new Discord.Client();

bot.on('message' , (message) => {
  if(message.content == ',.help') {
    message.channel.sendMessage('***Commands:*** \n \n ,.avatar => Shows your profile picture \n \n ***Version: 1.0.0***');
 }
  if (message.content == ',.avatar') {
    message.reply(message.author.avatarURL);
  }
  const content = message.content.split(" ").slice(1);
    const args = content.join(" ");
    if (message.content == ',.8ball') {
      var rpts = ["SΓ­", "No", "ΒΏPor quΓ©?", "Por favor", "Tal vez", "No sΓ©", "Definitivamente?", " Β‘Claro! "," SΓ­ "," No "," Por supuesto! "," Por supuesto que no "];
      if (!args) return message.reply(`Escriba una pregunta.`);
      message.channel.reply(message.member.user+' a su pregunta `'+args+'` mi respuesta es: `'+ rpts[Math.floor(Math.random() * rpts.length)]+'`');
 }
});
bot.login('*')
#

As you can see that's an "8ball"

#

So when i put ,.8ball and the question. Nothing appears

#

When i type ,.8ball only. It says "Write a question"

quartz kindle
#

your 8ball command wont get triggered if you write anything

#

if (message.content == ',.8ball') is only triggered if the content of the entire message is ,.8ball

#

if you write anything else, the message.content no longer passes that if

earnest phoenix
#

Oooooh

#

So i replace message.content for if message.startsWith

quartz kindle
#

yes

earnest phoenix
#

AAaaaaah

#

Thanks

quartz kindle
#

idk if message.startsWith works, but message.content.startsWith

earnest phoenix
#

Thank a lot man

sick cloud
#

How do you delete something from a discord.js collection?

quartz kindle
#

collection.delete(key) ?

earnest phoenix
#

Oh my

#

@quartz kindle It does not work :/

quartz kindle
#

what doesnt work?

lapis stirrup
#

Yo does anyone have a fix to (node) Error: connect ETIMEDOUT on Ubuntu?

earnest phoenix
#

Check internet connection

lapis stirrup
#

Its on a VPS

#

I can ping websites fine, but when I go to run the bot, it gives me that error

earnest phoenix
#

I'm pretty sure that it does not work with VPS

lapis stirrup
#

Using Vultr Cloud compute

earnest phoenix
#

Nope.

lapis stirrup
#

?

earnest phoenix
#

Try disabling that VPS

#

And try again

heady zinc
#

your first bet would be to get more information about the error itself

#

do you have a listener for the error event?

hot sleet
#

How to make a database in mysql like a queue
when i use a command it give me the next thing

stable juniper
#

Can someone please assist me in getting the bot to create an invite for a specific guild (discord.net c#).

frail harness
#

rtfm

stable juniper
#

i did rtfm but all i found was a function to find invite details, not create one.

sick cloud
#

channels usually have some kind of invite create function right?

#

discord.js has textChannel#createInvite

restive silo
#

Pretty sure D.Net has SocketGuild#CreateInviteAsync

cinder stratus
#

I Want To Create Bot Which Talks With Users

stray wasp
#

what programming language would you like to use?

cinder stratus
#

js

stray wasp
#

ok the easy one or hard way?

cinder stratus
#

Both

stray wasp
#

what I mean by looking at pins

#
#

thats discord js

cinder stratus
#

Yes

stray wasp
#

ya

#

enjoy.

#

Eris

#

Eris if you read is harder for less experienced programmers

cinder stratus
#

no discord js is easy for me because i am a noob

stray wasp
#

ok use that then.

cinder stratus
#

thnx

earnest phoenix
#

Guys help plz! I have my bot on github, hosting heroku. But there is a problem in file index.js there is my token

quiet bobcat
#

reset your token then? @earnest phoenix

earnest phoenix
#

uhm

#

im not really into web development

#

but if i were to create a website for myself/bot

#

where'd i start lol

#

i know html and css but thats about it

#

actually it just needs text i can probably do it

earnest phoenix
#

if you have enough knowledge of html and css you can get a html/css theme off themeforest and edit its contents out / re-adjust it a bit (?) to fit your needs otherwise use a cms like wordpress or w/e with a theme

earnest phoenix
#

are this code this.bot.guilds.map not working anymore?

stiff juniper
#

@earnest phoenix what lib?

earnest phoenix
#

@stiff juniper node js

stiff juniper
#

yes but what library?

#

@earnest phoenix

earnest phoenix
#

@stiff juniper discord.js

stiff juniper
#

gotcha

#

what's the code used for?

earnest phoenix
#

get all guilds use the bot

#
      message.channel.send(`Guild: ${guild.id}
Name: ${guild.name}
Owner: ${guild.owner.user.tag} (${guild.owner.id})
Default Channel: #${guild.defaultChannel.name} (${guild.defaultChannel.id})
Members: ${guild.members.size}
Humans: ${guild.members.filter(u => !u.user.bot).size} (${Math.floor(guild.members.filter(u => !u.user.bot).size / guild.members.size * 100)}%)
Bots: ${guild.members.filter(u => u.user.bot).size} (${Math.floor(guild.members.filter(u => u.user.bot).size / guild.members.size * 100)}%)`)
    })```
stiff juniper
#

why this

#

first of all

#

lemme test your code tho

#

one sec

glossy mason
#

A .forEach would be more appropriate than .map in this case.

stiff juniper
#

^

#

that too

earnest phoenix
#

btw

stiff juniper
#

.forEach isn't shown in the docs but is defined in the Map class

earnest phoenix
#

its working without this

#

hehe

stiff juniper
#

yes

#

this

#

is unnecessary

earnest phoenix
#

thankyou... ^^

#

solved

stiff juniper
#

np πŸ‘πŸ»

earnest phoenix
#

@stiff juniper ok

glossy mason
#

.map is more for transforming lists like

var listOfUserNames = listOfUsers.map((user) => {
    return user.username;
});
earnest phoenix
#

can Discord Rich Embed resize image?

#

or multiple image?

fleet mason
#
ok.getCharacters = function(user) {
  var fameData = "ok";
  var options = {
    method: 'POST',
    uri: 'https://nightfirec.at/realmeye-api/?player='+user,
    body: {
        some: 'data'
    },
    json: true // Automatically stringifies the body to JSON
  };

  rp(options)
    .then(function (data) {
      if(!data.player){
        return 'Player not found';
      }

      fameData = 'Alive :fame:: **' + data.fame + '** | Account :fame::**' + data.account_fame + '**';
      console.log(fameData)
      return fameData;
    })
    .catch(function (err) {
        // POST failed...
        console.log(err)
    });
  return fameData
}``` How do i get it to return the correct fameData?
inner jewel
#

return the promise

#

or await it

wintry bobcat
#

Oof I have an error with my bot

#

Now when I want to upload an image, it says "client not defined"
The funny thing is that I use client.command a lot, and it works

abstract crystal
#

what do you mean you use client.command? @wintry bobcat

#

can you show us an example?

wintry bobcat
#

Yeah

#

I'm on mobile rn so I cant

abstract crystal
#

oh rip

#

if you are actually importing client (which you shouldn't) you should always import discord.ext.commands and from there add decorator @commands.command()

wintry bobcat
#

I do have did import discord.ext.commands, but I don't have the decorator

#

K thanks

abstract crystal
#

you can get your client object from the ctx attribute ctx.bot

wintry bobcat
#

K

sick cloud
#

Sooooo, why doesn't this work?

client.on('guildCreate', async (guild) => {
    await r.table('servers').insert({
        id: msg.guild.id,
        prefix: '>'
    });
    const logChannel = client.channels.get('461369688576753664');
    logChannel.send(`I have joined **${guild.name}**! (now in ${client.guilds.size} servers) :tada:\nServer ID \`${guild.id}\`\nMembers/bots/total count \`${msg.guild.members.filter(u => u.user.bot !== true).size}:${msg.guild.members.filter(u => u.user.bot === true).size}:${msg.guild.memberCount}\`\nOwner \`${msg.guild.owner.user.tag}\` (ID \`${msg.guild.ownerID}\`)`)
    client.user.setActivity(`over ${client.guilds.size} servers. >help`, { type: 3 });
});
#

It won't insert to the database, send to the channel or update the activity. Like it never fires.