#development

1 messages · Page 414 of 1

quasi forge
#

Can I ask u something @earnest phoenix

earnest phoenix
#

ok

quasi forge
#

how did u make that akinator???

amber token
#

I am waiting for my bot to get approved for 1 decade

earnest phoenix
#

using the api from akinator

amber token
#

-bots

gilded plankBOT
#
Ghoul#6710
Bots

@tame falcon

earnest phoenix
#

there isn’t any docs

quasi forge
#

ooh

earnest phoenix
#

but you can set events and run off it

quasi forge
#

Gotta give it a try

earnest phoenix
#

mhm

amber token
#

@earnest phoenix I have your bot in my server

earnest phoenix
#

o nice

quasi forge
#

most of us do @amber token

amber token
#

IKR

quasi forge
#

It's one of the most widely used ones

amber token
#

I never said everyone did not have

#

Anyways guys

earnest phoenix
#

hopefully my new bot can make it

amber token
#

Lets not chat here and not break the rules

quasi forge
#

though most servers just have Mee6 and Dyno

earnest phoenix
earnest phoenix
#

Can someone help me fix the error.

#

So Basically

#

If I say M>say Hi.

#

The bot says: saysHi.

amber token
#

Oh

#

Try M>Hi

zenith pasture
#

how can i get every player thats in a call?

#

discordjs

#

tag me if you react

lament meteor
#

@earnest phoenix what is args?

#

also do slice(1) try that if it works

lavish mango
#

VoiceChannel.members.map(x => x) maybe @zenith pasture

lament meteor
#

something like that

#

check the docs lmao

zenith pasture
#

yeh @lament meteor but i cant find it..

lament meteor
#

boi

amber token
#

?

slim heart
#

Hey, this is a little strange but it would make life so much easier if I knew anyway if this was a thing... What I want to do is content.match a specific string in a message but then single out the entire word that set of the .match and test if it is something else or the word that's the problem. Just to make it easier to understand I'll describe my exact situation... So it's a censor bot, and right now it content.match the whole string and for example someone says ass, it'll censor, but then it'll censor assassin, what I want to do is to single out the whole word that contains the word that sets off .match so then I can check it and return; if the word matches assassin, but I can't just do it in a list of seeing if it matches assassin then return cuz someone could says assassin, then other curse words so I want a function for each word then test the word in specific...

#

Language: js

#

Tag me if you respond pls

floral stone
#

I'm not reading that whole thing

verbal night
#

^

uncut slate
#

then don't, no one asked you to

verbal night
#

Essentially they want to look for a certain word and delete the message if it has it

floral stone
#

I'm just joking about how long it is.

verbal night
#

without something like assassin for example being deleted for having "ass" in it

floral stone
#

isn't there an in operator in js

#

if word in sentence:

verbal night
#

🤷 i don't use js xD

floral stone
#

you'll probably have to lower case the message content

verbal night
#

^

floral stone
#

you could split the string by spaces

#

and get each word there

#

and check if any of your bad words is in the list

#

you can also do

#

var badw = " ass "

#

instead of

#

var badw = "ass"

#

@slim heart

#

but it be better to split it

shy verge
#
The authenticity of host [ip] can't be established.

wat fak

shy verge
#
var RamUsage = Process.GetCurrentProcess().PrivateMemorySize64;

this returns 0 on my VPS lul

slim heart
#

@floral stone Ass is just one example

floral stone
#

use a list and go through the message

#

for statements

hot sleet
#

how to make my bot send random question then when the message author response the bot check if he answered right or no (i know how to send random message and how to wait for messages but don't know how to check if the response === random message answer)

floral stone
#

maybe try assigning the variable to the wait for

slim heart
#

Is it maybe possible to go word by word and test over and over?

#

Like "hello there" it'll scan hello then do whatever, then do the same to there but seperately

#

Actually nvrm that's what you said before lmaoo, how exactly would I split each word and like make it a variable or some crap idek

#

So that I can test it over and over

slim heart
#

Like would i have to do message.content.slice().trim().split(/ +/g)
And then just arg[0-Like A Million] each time cuz that'd be really annoying there's gotta be a better way of doin it

earnest phoenix
#

would

if(message.content.has("www"));
``` work?
spring ember
#

no

#

use a regex

earnest phoenix
#

?

spring ember
#

if I send www normally it shouldn't count as a link

elder rapids
#

www is a nice name

#

(oh no I got moderated)

earnest phoenix
#

this doesn't explain anything

spring ember
#

it does

earnest phoenix
#

Not for me

spring ember
#

you should use regex

earnest phoenix
#

you've told me that three times, I got it the first time

#

Now, if you're not actually going to help, pls stfu

spring ember
#

better tutorial

#

and listen this is the way of doing it, everyone here uses regex for links, and I do try to help by pinpointing you to websites that you can learn from

earnest phoenix
#

Sending the same one three times and having me tell you it don't work and sending it again ain't helping

spring ember
#

it's a different link

#

it's an actual tutorial of regexes

earnest phoenix
#

Either way its fine the way it is

#

it shouldn't get muted for that

#

because it deletes links

spring ember
#

it should be disabled by default

earnest phoenix
#

Ok

slim heart
#

ive already figured it out on mi own lmaoo

spring ember
#

oof resource hungry

slim heart
#

It's rlly messy but it works so i mean whatever lmaoo

topaz fjord
#

why not combine them into 1 if statement

#

with lots of ||

slim heart
#

thats what i already have

#

but lets say i say assassin

#

it'd pick up "ass"

#

so what im doing is if it finds "assassin" in that one word then it'll return; and then not censor it cuz its not bad

topaz fjord
#

is that just a bad word filter

spring ember
#

umm you shouldn't use a regex

topaz fjord
#

that is regex

slim heart
#

LMAO

spring ember
#

like " ass "

slim heart
#

.match

spring ember
#

so it is a word

slim heart
#

also then someone could just say "hi assassin"

#

bam censored

spring ember
#

nope

slim heart
#

yes

knotty steeple
#

no

spring ember
#

there is a space

topaz fjord
#

bad word filters are stoopid

slim heart
#

cuz it has a space in front

spring ember
#

so it is a word

topaz fjord
#

ew

slim heart
#

this is my current regex

spring ember
#

oh no

topaz fjord
#

bad word filter

spring ember
#

very bad word filter

slim heart
#

no

#

u

topaz fjord
#

nice way to get bot muted here :^)

slim heart
#

but fr it keeps messing up so i wanna make it bettor

#

Yeah i have it ignoring dbl

#

also im pretty sure it is already muted LMAO

topaz fjord
#

you should make it optional

slim heart
#

Yeah i do

#

i haz mysql

#

thats what i mean by ignore

#

i made it 0

spring ember
#

mysql isn't related at all thonkku

slim heart
#

it looks for 0 or 1 in my mysql server and if it's 0 then it skips over everything (aka disable)

spring ember
#

that's not smart

#

because then it will check on every message

slim heart
#

yes..

spring ember
#

you should use a hashmap (or dict or whatever)

slim heart
#

no idea what that is hehe

topaz fjord
#

i run 7.6 mysql queries a second kek

slim heart
#

ofc it checks over every msg cuz it has to?

spring ember
#

it doesn't

#

overchecking the database is not how it should work

elder rapids
#

If you're checking something on a database every second I sure damn hope you're using a mem cache

spring ember
#

you should have cache in case the bot is rebooting

elder rapids
#

No you just have cache in general

spring ember
#

umm yes

topaz fjord
#

i haven't cached my db yet

#

spring ember
#

what language are you using?

#

lol you shouldn't cache the db

slim heart
#

if it's 0 it doesnt censor

elder rapids
#

ok...?

#

That's not what we're talking about

slim heart
#

That's what we WERE talking about tho

#

be4 u came oof

elder rapids
#

Uh

#

Donkku was mentioning it before I even appeared in this channel

slim heart
#

idek whatever idrc lmaoo

spring ember
#

What lib are you using?

elder rapids
#

You'll care about caching eventually

slim heart
#

science turtle said it should ignore this server

elder rapids
#

Just wait

slim heart
#

Ur prolly right but i have no clue even what it is now thonkku

spring ember
#

It will have problems in dbl

slim heart
#

wym

spring ember
#

Bothell will overkill it

slim heart
#

cough
if(message.guild.id == "264445053596991498") return;
cough

spring ember
#

Lol

topaz fjord
#

theres no way i can cache something if its constantly chaging

spring ember
#

It doesn't

#

Oh wait you are talking about yourself

elder rapids
#

DBL isn't your main problem anyways

topaz fjord
#

its the big ones

elder rapids
#

Are you just going to if (guildid == VERY_LARGE_GUILD) return to EVERY one of them?

#

You possibly can't

spring ember
#

Also even small guilds can make enough noise

elder rapids
#

Depending how often they chat in it/do stuff

topaz fjord
#

^

elder rapids
#

Some people even like to spam messages for fun, RIP bot

slim heart
#

how would i store a function in another file so it can be called by multiple seperate programs

glossy sand
#

in what language

slim heart
#

js

glossy sand
#

there's a global object called module.exports independent to a js file

#

and the value you assign to it is the value returned when you require() that file

slim heart
#

so i can make a seperate .js file and then call it as a module in both programs?

glossy sand
#

e.g. you could have a file called thing.js that contains the code ```js
module.exports = function(x) {
console.log('Hello, world!');
};

#

then you could, in another file, go

#
const f = require('./thing.js');
f();
#

and it would print Hello, world!

slim heart
#

Alright dope thanks

slim heart
#

Okay new problem with that, is there anyway i can define some of the things outside of the export? cuz it wont even define message on its own none the less some of the things i need to define other then it

#

its just a bunch of ReferenceError's

#

@glossy sand

slim heart
#

Nvrm

#

but also now is there a way to like break a forEach thing

#

Cuz if two args match the things i specify it'll do the function twice, so is there a way to like break or whatever the whole forEach statement

glossy sand
#

you can require stuff in your file too lol

knotty steeple
#

how would i go making a poll command using reactions

topaz fjord
#

send the message -> add the reactions -> create a message collector for the reactions -> profit?!?!?!?!?! @knotty steeple

knotty steeple
#

can i get like an example or something

indigo notch
#

Google it

verbal night
#

^

static lynx
#

yo, can someone that uses discord.py, dm me? thanks!

topaz fjord
#

why not ask your question here

static lynx
#

because im stupid asf and rather than showing it to more people, ill just show it to one person

#

ok ill just do it here haha

#

so

#

my bots were all red bots

#

and now i wanna start making a bot from scratch

#

and i am having trouble running the code to turn on the bot

#

ill gist my code

#

i got it to be in the console, but keep on getting the Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x0374AB10> error

#

thanks c;

next bluff
#

Your token is in that

#

Careful

mental solstice
#

@knotty steeple what lang

static lynx
#

oh yeah

ruby dust
#

Change your token while it's not too late

static lynx
#

lmfao there

knotty steeple
#

for wat

mental solstice
#

U said u need reaction polling

knotty steeple
#

oh

#

js

#

discord.js

mental solstice
#

Eh.. there should be a ReactionAdded event. Or similar

indigo notch
#

Eris is better but in djs you have reactionCollector

mental solstice
#

If u use a command. Assign the message id of the poll message to a variable. In the ReactionAdded event, keep the tally depending on, if (emote.name == .....) voteYes++.

indigo notch
#

Or do what i did

#

Way bettah

mental solstice
#

Or if these guys who know discord.js know a better solution

next bluff
#

@static lynx is that the only error in the logs?

indigo notch
#

Im a eris guy but i do know djs

static lynx
#

yes

wanton walrus
#

Are embed edits just broken on Discord or something

#

Im so confused

mental solstice
#

No issue modifying in c#

next bluff
#

@static lynx TBH I haven't used discord.py but are you sure you need to be passing in the client ID to start the bot? Seems like you should be passing the token

static lynx
#

well i’ve been reading this guide, and already asked 2 people

next bluff
#

It seems like you're not using the token anywhere

#

That is the only thing that jumps out at me

static lynx
#

okok

#

thanks

#

OH MY

#

AHHH
HAHH

#

ITWS WOORK]

next bluff
verbal night
#

:p

static lynx
#

wait wtf

#

guys

#

im creeped tf out

#

i turned on my bot and as soon as it was on, it replied to my messages

earnest phoenix
static lynx
#

like randomly it said "oof", "rip in the chat", and "hi" in random channels

gilded blaze
#

How would I go about turning html into a jpg in java?

next bluff
#

You mean like downloading a jpg from a url in the html?

gilded blaze
#

nono

#

i mean i have a string containing html and I want to take a capture of how it would look in a browser

next bluff
#

oh I see

#

selenium?

gilded blaze
#

hmm

#

not sure

next bluff
#

that's the only java library I know off the top of my head that can render HTML into an image

gilded blaze
#

o ya i tried that

#

it had a problem with formatting and external css

#

actually it had a problem with css all together

next bluff
#

gotcha

#

selenium might be your best bet then

gilded blaze
#

ye ima try it

static lynx
earnest phoenix
slim heart
#

ik this might sound kinda stupid but how would i make it so that an error doesnt put up a gigantic message in console? cuz in order for my bot to work it has to throw a noncrash error so it just kinda spams

earnest phoenix
#

try catch

#

depends on what language you're using

#

what are you coding in?

slim heart
#

js

earnest phoenix
#
try {
// ... code that throws error here ...
}
catch (e) {} // void error
#

or if you're using promises

slim heart
#

Okay so heres the thing

#

I can't void the error

earnest phoenix
#
errorousStatement().catch(e);
slim heart
#

I need the error to occur

#

But i dont want it saying it occured

earnest phoenix
#

you can just log the error

#

so console.log(e.message)

slim heart
#

I DONT want it to say the error

#

I want it just to ignore it in the console windows but still do whatever error things it does in the background

#

It's weird but basically I need to break a forEach statement and it can only happen under and error

mental solstice
#

Well if u know what the error is, write a condition in the loop for it.. null reference,.. etc

slim heart
#

no idea how 😮

mental solstice
#

Do you know why the error is happening?

slim heart
#

Yes cuz im trying to console.log something undefined (on purpose)

mental solstice
#

You can put your try/catch inside your loop... try { console.log(logThis) } catch { console.log ("custom log message when error happens"); continue;)}

#

Or before you log something that isnt null... in c#.. if (var == null) { console.log ("null message"); continue; }

slim heart
#

but that voids the error

mental solstice
#

What do u want to happen when it errors?

slim heart
#

I want it to do its normal thing but not say anything in the console window

mental solstice
#

Thats what that code would do.. continue would simply skip that iteration of the loop, and move to the next

#

U dont have to log anything

slim heart
#

But I don't want to continue on to the next loop

#

I want to break the entire forEach statement

mental solstice
#

If (var == null) break;

slim heart
#

illegal break oof

#

here let me just send u the code and hopefully explain it better

mental solstice
#

K

slim heart
#

Alright, so, line 8 has the error

#

which is in a function that is run everytime an arg matches all the stuff

#

What i need is ONCE the arg is matched and the function is ran, i dont want it to keep checking all the other args

mental solstice
#

Line 8 is a console log

slim heart
#

So i have to error

#

in order to stop the forEach from continuing

#

Yes i console.log a non existent variable to crash the statement but not the entire bot

mental solstice
#

Stopped is not a loop

#

What u can di

#

Do

#

Make stopped set a bool value

halcyon abyss
#

or change foreach

#

and instead use Array.find()

mental solstice
#

Then make all your conditions in your arg checks require that bool to be false. Or do what gpw said, if that works

halcyon abyss
#

it will return first element matched by testing function specified

#

But you'll have to adapt a little your func

slim heart
#

Alright now the error isnt even do it IDEK im to tired ima go to sleep sorry for bothering gn lmaoo

static lynx
#

HELO

#

HelP*

#

raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))

frail harness
#

what's your problem lol

#

and provide your code

static lynx
#

wait

#

do you know .py

frail harness
#

yes lmao

static lynx
#

ok haha

#

tried it a million times but

glossy sand
#

but?

#

what are you trying to accomplish and what's happening instead?

static lynx
#

trying to just get simple commands to run on my bot. its not sending anything to the channel

#

i even tried the copy online, still got the error

glossy sand
#

ah

#

I have no experience with the python framework

#

hopefully someone will show up who does

frail harness
#

what's your error

#

give me the entirety of it

static lynx
#

k hold on

#
Traceback (most recent call last):
  File "C:\Users\---\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "C:\Users\---\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 367, in invoke
    yield from self.prepare(ctx)
  File "C:\Users\--\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 345, in prepare
    yield from self._parse_arguments(ctx)
  File "C:\Users\---\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 304, in _parse_arguments
    transformed = yield from self.transform(ctx, param)
  File "C:\Users\---\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 212, in transform
    raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: self is a required argument that is missing.```
frail harness
#

why do you have these two args

static lynx
#

first it was ctx, first it was that and then..

frail harness
#

you're using rewrite, correct?

static lynx
#

yep

frail harness
#
  1. i don't get why you have a self argument, the function is not a method in a class
  2. why is user an argument, i dont see it being used
  3. the only argument should be ctx
shy verge
#

wait are users also channels in py?

#

like in the other libs?

static lynx
#

updated the gist

#

getting the same warning hm

#

error*

frail harness
#

you're getting the same error?

#

show me

static lynx
#

same error

#

updated the gist

frail harness
#

you got the same exact error?

#

send it here

static lynx
#
Traceback (most recent call last):
  File "C:\Users\---\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "C:\Users\---\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 367, in invoke
    yield from self.prepare(ctx)
  File "C:\Users\--\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 345, in prepare
    yield from self._parse_arguments(ctx)
  File "C:\Users\---\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 304, in _parse_arguments
    transformed = yield from self.transform(ctx, param)
  File "C:\Users\---\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 212, in transform
    raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: self is a required argument that is missing.```
static lynx
#

@ me when you’re back

#

ty

earnest phoenix
#

did you actually save the py file before running it again @static lynx

earnest phoenix
#

Does anyone know how DBL/Dbots/Discord generate tokens?

#

i know it starts with id

gilded blaze
earnest phoenix
#

thank

gilded blaze
#

👍

earnest phoenix
#

welp

#

why does DXFGrQ not decode properly

native narwhal
#

Because it doesn't decode it to decimal?

lament meteor
#

@earnest phoenix happens to same for me idk why

#

sends a lot of

earnest phoenix
#

use .toString("ascii") but still doesnt decode to what i want 😐

bitter sundial
#

@earnest phoenix is that the timestamp part?

earnest phoenix
#

ye

bitter sundial
#

it's not ascii so thats your problem

#

it's a decimal

earnest phoenix
#

okay

#

but

#

wth does that mean, lel

bitter sundial
#

try one of the Buffer.readInt methods

lament meteor
#

o

bitter sundial
#

i dont remember if it was 16 or 32

lament meteor
#

just try both

earnest phoenix
#

Well since you're here Tonkku, how does dbl generate api tokens?

bitter sundial
#

there's this nice standard called jwt

earnest phoenix
#

that is true OMEGAlul

#

when all readInt methods take integers

#

oh

#

wait

lament meteor
#

so dbl tokens are timestamp, id and if it is a bot or not

#

i find the last part funny lmao

quasi forge
#

I do to lol

#

too*

bitter sundial
#

it's kinda like if it's the new bot token thing

#

since it was user tokens before lol

lament meteor
#

o

fluid basin
earnest phoenix
#

has anyone made subcommands in discord.py before? I am wondering how i am able to show those subcommands in the discord.py help command.
Cause mine is only showing the main command

Is it even possible?

toxic hearth
#

Does someone know how can I convert YouTube stream using ffmpeg?

sly panther
#

i want to do !clear but then the music bot rythm takes over the command how to fix that

lament meteor
jagged birch
#

change one of the bot's prefix to something else @sly panther

static lynx
#

@earnest phoenix yeah

earnest phoenix
#

-botinfo @timber junco

gilded plankBOT
#
Bot info
ID

415384977686003712

Username

ChatDefender

Discriminator

1859

Short Description

Need a timer? Need to ban people on chain messages? Need custom commands? ChatDefender has all of that!

Library

discord.js

Prefix

cd! | mention | Customizable

Upvotes

70

Server Count

58 Servers

Owner(s)

@grizzled isle

earnest phoenix
#

@grizzled isle links get deleted by default smh

austere obsidian
#

-botinfo @gilded plank

gilded plankBOT
#
Bot info
ID

264811613708746752

Username

Luca

Discriminator

0393

Short Description

Luca is a bot for managing and informing members of the server

Library

discord.js

Prefix
  • or @Luca#0393
Upvotes

83

Server Count

2 Servers

Owner(s)

@fossil oxide dblAdmin
@languid dragon dblAdmin
@bitter sundial dblAdmin

floral stone
#

who's the third owner

topaz fjord
floral stone
#

what a mod

fluid basin
#

OwO

knotty steeple
#

can bots use emojis from other servers they are in?

restive silo
#

Yes bots have the Nitro Emoji feature, although thats the only feature they have from nitro

knotty steeple
#

oh ok

trim saddle
#

@knotty steeple its harder for non-nitros to grab animated emotes but i found a way around that

#

since most libraries allow summoning emotes from id's and you can

lament meteor
#

just list all the emotes

trim saddle
#

ack

#

i just use dev tools

lament meteor
#

meh

#

its easier to get emote by name send the id

trim saddle
#

but if you don't have nitro you can't \:animote:

fluid basin
#

lol

#

¯_(ツ)_/¯

trim saddle
#

so use dev tools on animated emotes

fluid basin
#

I don't think bots can use animated emojis I guess?

trim saddle
#

they can

fluid basin
trim saddle
#

owo eval bot.get_emoji(393548363879940108)

fluid basin
#

Yeah I see

lament meteor
#

@fluid basin i think i know why u think that bots cant use animated emojis

#

normal emote: <:name:id>
animated emotes: <a:name:id>

fluid basin
#

well I get it now

#

It all okay

lament meteor
#

:ablobwinky:

fluid basin
#

xD

trim saddle
#

oh and the async branch of d.py won't let you react animated emojis

floral stone
#

ewe async

grizzled isle
#

@earnest phoenix those are the default settings. You have to set it up in the server.

trim saddle
#

i switched to rewrite for that one reason

#
  • no nsfw support on async
earnest phoenix
#

@grizzled isle i don't like the default settings and I'm sure others don't like them either

grizzled isle
#

That's why its configurable 😛

tardy hatch
#

Hello

#

How can i make cogs?

#

On python

#

Pls help me

grizzled isle
#

We can help you if you read the channel topic

tardy hatch
#

How can i make cogs on a python bot?

molten pewter
#

What's a good way to have a clean, non-cluttered command list without using something like Gist?

#

Like, for example, if you have many commands and don't want them all in one message

trim saddle
#

write out each command by hand in a custom help command :^)

molten pewter
#

I already have a command list on Gist

#

I just want a better way

trim saddle
#

isn't your bot js?

verbal night
#

I personally use a paginated help command 🤷

lament meteor
#

per category help command is the best

verbal night
#

I have yet to add something like that to my command system ._.
still missing permissions as well >.>

#

but yea that's also good >.>

shy verge
#

My boat isn't large enough to need pages lul

earnest phoenix
#

Can I get some discord.js-commando help?

earnest phoenix
#

How do I disable the default commando help command?

lapis crystal
#

im not sure sorry

shy verge
#

there should be an option in the commando client options

#

nope nvm

#

try asking the djs server

frigid thistle
#

@fluid basin discord.js supports animated emojis

#

h!invite

earnest phoenix
#

What do you guys use to script a bot?

#

Python?

topaz fjord
#

A variety of coding languages

#

Peoole use what their comfortable with

ruby dust
#

I like how people assume the first guess after questioning

wispy spear
#

Who knows how to store just the amount of servers in an embed, no formating

#

My Bot Server Count ----> DBL ----> Embed

solid cliff
#

What

wispy spear
#

So I can store the emount of servers my bot is in using a widget, but how do I store It without the formatting, just the value

earnest phoenix
#

?

#
data.solo.mode.kills.value
``` is what I have
wispy spear
#

@earnest phoenix Are you using TRN?

earnest phoenix
#

?

#

Discord.js node.js, fortnite are the packages for this

solemn obsidian
#

Mode is just the class, it isn't an actual key

#

data.solo.kills

wispy spear
#

yea but which database are you getting your ststs from?

earnest phoenix
#

but data.solo.kills.value don't work either

#

or data.solo.kills

#

I've tried those

#

I am getting it from the fortnite database

wispy spear
#

ok

solemn obsidian
#

where are you getting value from? And provide error

wispy spear
#

mine works..

earnest phoenix
wispy spear
#

I use that

earnest phoenix
#

current error

#

same @wispy spear

wispy spear
#

Where did you get the documentation for it?

solemn obsidian
#

You are still using the old code you sent

#

data.solo.kills

#

Not data.mode...

earnest phoenix
#

I am fixing it rn

#

Imma send haste bins

#

code then error

solemn obsidian
#

Console log data, show me it completely

earnest phoenix
#

its my friends fortnite btw

#

shoot

#

ignore the id

#

that's the hastebin

#

should I be doing data.user.solo ?

solemn obsidian
#

data.stats.current_solo.kd and so on

earnest phoenix
#

oh

#

stats

solemn obsidian
#

Probably want to look into how js objects work

earnest phoenix
#

thx

#

I will

shy verge
#

A question for .NET devs: on your VPS, do you compile your bot, pull to VPS, and run with just the runtime, or do you pull source to your VPS and run with the SDK?

elder rapids
#

I publish it and run the compiled dll

earnest phoenix
#

Who has the time to help me out with embeds?

ruby dust
#

sure?

earnest phoenix
#

@ruby dust Know a lot about them?

topaz fjord
#

Just ask your question and someone will come and help

ruby dust
#

I had a bot listed here that used only embeds in all responses, so yeah

earnest phoenix
#

What is wrong with this code? Don't really understand anything about this.

ruby dust
#

the indentation is incorrect, I assume

earnest phoenix
#

So what do I need to space out?

ruby dust
#

it can also mean that you are using both spaces and tabs in the same code, check if that is true

mental solstice
#

phil

earnest phoenix
#

I don't understand that? Am not the pro(est) as this sort of stuff.

mental solstice
#

Startswitch.. prob not a method?

topaz fjord
#

lmfao

mental solstice
#

Elif message.content.startswitch

ruby dust
#

I remember when I was dumb enough to define commands in on_message event

earnest phoenix
ruby dust
#

I heard it's as good as heroku

earnest phoenix
#

Hmm someone said to me once that glitch is better than heroku

ruby dust
#

honestly, there is no such "free vps", if you found a free one it means it's terrible

earnest phoenix
#

Yeah kinda

#

Some "free" providers have the thing that there is free option and a paid one that is a lot better than the free one.

ruby dust
#

skysilk is so far the only actual vps that has a free plan that's enough to host a discord bot for up to 500 servers

#

and maybe more

#

you should look into that instead

#

but you do need a credit card regardless, that is just to verify your identity

shy verge
#

@earnest phoenix IDLE is... not very good. I'd use VSCode or PyCharm, which are also both free.

brave bolt
#

I recommend PyCharm cos I'm a JetBrains fan boy

shy verge
#

same kinda

#

i use Rider

#

but VSC for everything else

frail harness
#

vsc best

low owl
#

@shy verge I put the source on a private repo, let Travis CI compile it and do some docker magic and then I put the Docker image on a private Docker repo which my VPS pulls from every few minutes and then runs the docker container.

mental solstice
#

How's mongodb for large bots? And input

uncut slate
#

I use the same mongo connection for 4 bots, the biggest two being in ~4k and ~1k guilds

#

it's pretty great

solid lodge
#

wh

mental solstice
#

I may try it out. Queries are a pain for me.

uncut slate
#

what are you struggling with

#

pretty simple for me

#

I find myself looking at the docs when I need an obscure operator, but that's about it

inner jewel
slim heart
#

Alright I have a errorous statement on purpose however, but it doesn't crash it only breaks the statement which is what I want, however, I am now incorporating mysql meaning that it crashes the entire bot which is not what I want, is there either a way to make my error not crash fully or is there a type of error mysql doesnt fully crash on

#

Just fyi, the error is attemping to console.log a non existant variable

low owl
#

Just try catch it or prevent the error from happening in the first place

slim heart
#

I need it to actually happen @low owl

#

I need an error to occur to break a forEach statement

weak turret
#

hey ive been getting this error when im trying to run my executable jar the bot works in intellij. This is the first project in gradle and im completely lost

low owl
#

@slim heart I think you are using exceptions wrong 🤔

slim heart
#

Wym?

low owl
#

What does your code look like?

slim heart
#

currently with what i need is working

#

What I want to work (has mysql)

#

It's a little different in some places, cuz one is the actual one running and the other is my testing file

#

But the only difference im focusing on is the second one has mysql and is full crashing while the 1st only ReferenceError and continues on

inner jewel
#

@weak turret how are you building the jar?

weak turret
#

@inner jewel Running the build in intellij

inner jewel
#

use the shadowJar plugin

#

if you used the jda example build.gradle you already have it

weak turret
inner jewel
#

no

#

the example is this ```gradle
plugins {
id'java'
id'application'
id'com.github.johnrengelman.shadow' version '2.0.2'
}

mainClassName = 'com.example.jda.Bot'

version '1.0'

sourceCompatibility = 1.8

repositories {
jcenter()
}

dependencies {
compile 'net.dv8tion:JDA:3.6.0_366'
}

compileJava.options.encoding = 'UTF-8'```

#

notice the plugins block

#

you just need to have that and mainClassName

earnest phoenix
#

how long it take for the Bot awaiting approval!

knotty steeple
#

+10 hours since you asked

earnest phoenix
#

😭

topaz fjord
#

@earnest phoenix 1 hour to 1 week

earnest phoenix
#

😭 😭 😭 😭

topaz fjord
#

asking makes it worse

knotty steeple
#

^

earnest phoenix
#

never mind its alredy approved

topaz fjord
#

its not?

#

if it was approved you would have dark green role

weak turret
#

@inner jewel Thank you so much you just saved me hours of headaches

earnest phoenix
#

anyone know some alternatives to the context object pattern (excluding singletons)?

earnest phoenix
#

I have an issue

#

I normally do msg.content.split(' ')

#

How can i do that with the spread operator?

#

the spread operator does .split('')

lament meteor
#

wat u mean

#

.split() is splitting a string on what u ask it to split

#

so "hi my name is Telk".split(" ") will give ["hi", "my", "name", "is"...]

earnest phoenix
#

can someone help me send the server count

#

to the site

#

@here

weak parrot
#

LOL

earnest phoenix
#

im starting in coding

#

and i am terrible at understanding at things

weak parrot
#

Okay just to let you know it's best to not just ask for help. Say what you need help with/post the code you need help with in this channel say the lang and lib of the bot and then wait for someone who knows said lib to respond

#

Cause otherwise they'll have to wait for you to get back to them to even know if they can help you at all since you didn't say what lang the bot is in

wild tide
#

hmm

quasi forge
#

@wild tide u can use fs.writeFileSync('quotes.json',JSON.stringify(quotes))

#

after importing the fs module i.e.

wild tide
#

then quotes could be the const quotes = message.content.split(" ")

quasi forge
#

yes

wild tide
#

ah ok

#

thank you so much ❤

quasi forge
#

np

wild tide
#

I was confused lmao,

quasi forge
#

happens

wild tide
#

ik that now lmao

quasi forge
#

Try to make some changes to it if it doesn't do it correctly

wild tide
#

i will

last marten
#

This feels like a stupid question but is there a way i use the markdown this markdown in something like message.channel.send('Pong! Took: ${response}ms'); but i want this markdown around ${response} and the ' are `. Or do i do it another way?

quasi forge
#

it'd the same

#

it's*

#

u use `` there too

last marten
#

??

halcyon abyss
#
 message.channel.send(`Pong! Took: \`${response}\`ms`);
last marten
#

thank you i'm dumb lmao

quasi forge
#

IDK if u r dumb or not

#

but this sure confuses devs

tardy hatch
#

Hey there

#

How can i set BOT PREFIX in a python bot

#

And add {prefix} for example at cmds

#

For example i have '&&help' i want to delete && from all commands and to save only in main file

earnest phoenix
#

@tardy hatch May i suggest reading the discord.py documentation, They explain it all there and they even have examples.

#

Discord.py has more then one version. So the answer to your question comes down if you are using the latest or rewrite version.

tardy hatch
#

@earnest phoenix i solved

#

But i have a problem at cogs lmao

earnest phoenix
#

What problem?

tardy hatch
#

Main file not load cogs

#

Idk if is an error maded by me

quasi raptor
#

how can i get channel id automacilly with my bot through this command:
!SAY-CHANNEL #general HELLO!

earnest phoenix
#

What language?

#

@quasi raptor

quasi raptor
#

C++

earnest phoenix
#

(Can't help you with that one :))

quasi raptor
#

JS?

earnest phoenix
#

Just try to get #general in the arguments.
In the code the output looks like <# 1234567890 >

#

Just remove the <# and > and you got yourself a id.

quasi raptor
#

@earnest phoenix ok thanks

#

i just need to know the step to get id, but i can write script by myself.

earnest phoenix
#

Ye i know some languages, but some languages i completely forgotten as it was to stressfull in my head to remember all the different methods 😛

#

So this is my code: https://hastebin.com/exekutiwot.js but I don't see no error but still the bot won't respond when I use the command.
The language Node.js
The library Discord.js
Also I only installed one of the packages cheerio do you think that might be the error??
Tag me if you think you can help me.

#

No one?

uncut slate
#

you have your code wrapped in a function you never invoke

earnest phoenix
#

?

#

Meaning?

#

Sorry I don't really much about scripting.

#

I am good with packages.

#

And like admin command.

uncut slate
#

consider the following function

function foo () { // module.exports.run
  console.log('foo is called');
}

foo(); // logs
#

that is what you are supposed to have

#

what you have is

function foo () { // module.exports.run
  function bar () { // async function googleCommand
    console.log('foo is called');
  }
}

foo(); // does not log
#

you're moving all of your code into a nested function and never invoking that function

earnest phoenix
#

Oh I see.

#

Ok gtg.
Can you explain it to me in my Dms so I can read it all when I get back?

#

But now when I do that I get a lot of errors.

uncut slate
#

can't help you if you don't tell me what the errors are 🤷

tardy hatch
#

Lmao

#

I have a biiiig problemmm

#

How can i load cogs?

#

And what need to be in cog file

earnest phoenix
#

nvm fixed it.

tardy hatch
#

I don t knoww howwww

earnest phoenix
#

is there a way to make two bots tell each other things

tardy hatch
#

Ignoring exception in command pula
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 367, in invoke
yield from self.prepare(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 345, in prepare
yield from self._parse_arguments(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 304, in _parse_arguments
transformed = yield from self.transform(ctx, param)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 212, in transform
raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.

#

Help me with this

earnest phoenix
#

guys

#

i have the commands down but discord.js isnt working

#

it wrote npm install discord.js

#

this is what it came out with

topaz fjord
#

That's fine

#

Those are just warmings

earnest phoenix
#

how dose it work then

#

i have the commands

#

i need help putting them onto the bot

#

atm

#

Ok so umm you have winSCP?

#

winSCP?

#

What are you gonna put all the commands and everything in?

#

idk

#

im new to this

#

ik commands and shit

#

You have an account right?

#

on what

#

What is your host?

#

IDFK

#

im trying to find one

#

ill just use winSCP

#

ill download it and make an account

#

Ok.

#

But,

#

Make an account?

#

im using discord.js btw

#

I ma pretty sure that cost money but ok.

#

Yeah I know I saw the pic.

#

winSCP is free it says

#

Oh ok.

#

im downloading rn

#

Downloading is free.

#

Account is paid.

#

I think.

#

it says its free software

#

Ok tell me when you made an account.

#

Im not sure what to do here Savitar50

#

?

#

:/

knotty steeple
#

once you have the main bot file just do node bot.js

#

assuming your main is bot.js

earnest phoenix
#

You can’t make an account on winscp

#

You have to buy a VPN from Ubuntu I think.

knotty steeple
#

he doesnt need winscp if his bot is on his pc

earnest phoenix
#

True.

#

Ok go back to windows power shell.

#

Type cd app.js

#

Assuming there is no directory leading to those.

#

Ok so there is a directory leading to those files.

#

What did you press to get to those files?

#

Or actually.

#

Try node app.js

#

Or you can do node FettBot/app.js

#

If node app.js doesn’t work.

tardy hatch
#

Het

#

Ignoring exception in command pula
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 367, in invoke
yield from self.prepare(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 345, in prepare
yield from self._parse_arguments(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 304, in _parse_arguments
transformed = yield from self.transform(ctx, param)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 212, in transform
raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.

earnest phoenix
#

Hello.

tardy hatch
#

Can anyone help me?

#

With this

earnest phoenix
#

Python.

tardy hatch
#

Python

earnest phoenix
#

Sorry I cannot help you as I don’t know python.

tardy hatch
#

XD

earnest phoenix
#

Try node FettBot/app.js

#

i did from the last pic i sent

#

Ok.

#

Anyone wanna step in?

lament meteor
#

try cd <drag the bot folder here> then node <main file name>

earnest phoenix
#

Drag it where?

#

so what would be that for me

knotty steeple
#

into powershell

earnest phoenix
#

cd FettBot

#

node commands.js

lament meteor
#

cd drag the folder

earnest phoenix
#

Oh so for him it would be :

#

cd drag the folder node app.js

lament meteor
#

something like dat

knotty steeple
earnest phoenix
#

Right?

tardy hatch
#

Anyone can help me with python

#

Please

knotty steeple
#

no sry

lament meteor
#

isnt app.js a folder? if it is then lmaoaaaaoo

earnest phoenix
#

It is.

#

No.

#

No it isn’t.

knotty steeple
#

it should be a file

earnest phoenix
#

Wait.

#

It should be,

tardy hatch
#

Anyone can help

#

Me

#

Pleaseeeee

lament meteor
#

look at the picture... the icon is a folder icon not a file icon

earnest phoenix
#

il lchange

knotty steeple
#

@tardy hatch if we can help we will help

#

but we cant so stop asking

earnest phoenix
#

And config.json should be a file to.

knotty steeple
#

yes

tardy hatch
#

Ignoring exception in command pula
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 367, in invoke
yield from self.prepare(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 345, in prepare
yield from self._parse_arguments(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 304, in _parse_arguments
transformed = yield from self.transform(ctx, param)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 212, in transform
raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.

lament meteor
#

but they have a file icon lmao

tardy hatch
#

I have that error

earnest phoenix
tardy hatch
#

At embed

earnest phoenix
#

No.

knotty steeple
#

WE DONT KNOW PYTHON STOP

earnest phoenix
#

Now they are text docs.

#

what files?

tardy hatch
#

......

#

ffs

earnest phoenix
#

WHAT TYPE OF FILES

#

Js

knotty steeple
#

.JS FILES

earnest phoenix
#

how do i make a js file ffs

lament meteor
#

@knotty steeple i told u.... it was a folder not a file

knotty steeple
#

it was a folder before tho

earnest phoenix
#

can someone tell me how to make a js file pls

knotty steeple
#

bot.js

earnest phoenix
#

where do i put that?

#

in powershell

#

Samurai

knotty steeple
#

open it with a code editor

earnest phoenix
#

i use visual studio

#

App.js is bot.js

knotty steeple
#

ok

lament meteor
earnest phoenix
#

Jut app.js has more stuff in it like commands too.

knotty steeple
#

i recommend visual studio code for js files

earnest phoenix
#

app.js is here my commands are in

knotty steeple
#

visual studio is for C# and stuff

earnest phoenix
#

Yeah,

lament meteor
#

package.json.... unless u hide the extension

earnest phoenix
#

do i change that

knotty steeple
#

it is a json file

#

already

earnest phoenix
#

uhhuh

#

Make package.json a json file.

lament meteor
#

oh nvm

knotty steeple
#

it already is

lament meteor
#

it has a hidden ext

knotty steeple
#

^

earnest phoenix
#

package is a json file

#

what about config change that to a json?

#

Yes.

#

ok ill try to change it

knotty steeple
#

he has hidden ext tho

#

enable it

#

View > File name Extensions

earnest phoenix
#

umm ok

lament meteor
#

why not.... u learn js

knotty steeple
#

yea

earnest phoenix
#

ive got the commands and everything

#

just need to do the rest

knotty steeple
#

discordie

earnest phoenix
#

idk that was in a tutorial for discord.js

knotty steeple
#

wait thats the package.json for discordie

earnest phoenix
#

i think so idk

knotty steeple
#

ok

lament meteor
#

Just pls step away and learn js and get familiar with node.js cause this is taking us no where as.......

knotty steeple
#

delete that .json

#

and do npm init

earnest phoenix
#

yup

knotty steeple
#

i think

earnest phoenix
knotty steeple
#

wait

#

do ctrl+c

#

cuz your not in the folder the bot is in

earnest phoenix
#

oh

knotty steeple
#

when you do that then npm init

earnest phoenix
#

Init?

lament meteor
#

it makes a package.json for u

earnest phoenix
#

Oh.

#

You are still in the wrong one.

#

Do control c

#

how i did shift click on FettBot folder

#

it says package name

#

what do i name the package?

#

Package.json?

knotty steeple
#

no

earnest phoenix
#

Idk

#

i have to name tghe packagae

knotty steeple
#

just do npm init where your app.js file is

earnest phoenix
#

IT IS IT

knotty steeple
#

well do it

#

then

earnest phoenix
#

what do i name the package!!!!!!!!!!!!!!!!!!!!

knotty steeple
#

JUST DO npm init WHERE YOUR FILES ARE AND CONTINUE WITH IT

earnest phoenix
#

Anakin are you still in npm?

knotty steeple
#

@earnest phoenix google learn node.js

#

the package name is your bot name essentially

earnest phoenix
#

it says package name (fettbot)

#

so i type FettBot

knotty steeple
#

just press enter

#

there cant be caps

#

also

earnest phoenix
#

done i finished making the package

#

what now?

knotty steeple
#

run your bot

#

do you even have a token

earnest phoenix
#

yes

#

node app.js

#

bot user token

#

Do node app.js

knotty steeple
#

node app.js

#

also get visual studio code

earnest phoenix
#

Yeah.

#

If you are using JS use VS Code.

#

VS is for C# and other stuff like C

#

is it free?

#

Yes,

#

ok ill download it rn

knotty steeple
#

that error means you dont have config.json

#

in the same folder your app.js is

lament meteor
#

he does iirc

earnest phoenix
#

config.json is a txt file

#

how can i change it to a json?

knotty steeple
#

iirc

earnest phoenix
#

iirc?

lament meteor
#

iirc = if i recall correctly

earnest phoenix
#

ok

#

how do i change it to a json

knotty steeple
#

pls

earnest phoenix
knotty steeple
#

remove .txt

earnest phoenix
#

ok

knotty steeple
#

then node app.js

earnest phoenix
#

ahh done

#

ill try node .js

#

Wrong token,

#

oh

#

is it the bot user token?

knotty steeple
#

go to your app

earnest phoenix
#

yup

#

is it the user token?

#

for the bot

#

bot user token?

knotty steeple
#

copy that token

earnest phoenix
#

ahh yep

knotty steeple
#

in your app

#

then generate a new one

earnest phoenix
#

generate a new one

#

why

knotty steeple
#

so you wont get the error you got before

earnest phoenix
#

i said this

#

omfg it worked

knotty steeple
#

ok

earnest phoenix
#

thanks

#

my commands

#

+warn

knotty steeple
#

no

earnest phoenix
#

wait

#

my commands

#

@knotty steeple

knotty steeple
#

pls dont just ping me

#

also if you mean client.token() yes

earnest phoenix
#

oh ok srry and ty

#

Samurai in the bot list on discordbots.org do you want me to add u to help users as you helped alot

#

and i really thank you

knotty steeple
#

yeah ok

#

your welcome

earnest phoenix
#

it says (config.token) i put my token for bot in and did node app.js and it came up with unidentiefied token

#

do u know why?

knotty steeple
#

did you put your token in the config.json

earnest phoenix
#

yup

knotty steeple
#

wait whats the error

earnest phoenix
#

to update bot you do node app.js right?

knotty steeple
#

might wanna generate a new token