#development

1 messages · Page 627 of 1

earnest phoenix
#

noice

#

bots cant have rich presence

#

no

#

what you set was regular presence, aka activity

#

idk

#

but ok

static matrix
#

internal/modules/cjs/loader.js:58410:53 AM
throw err;10:53 AM
^10:53 AM
10:53 AM
Error: Cannot find module 'snekfetch'10:53 AM
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)

#

On glitch

#

What can i do

knotty steeple
#
  1. dont use glitch
#
  1. if u cant find a module install it
static matrix
#

Oh my bot worked for 1 week

#

But now

#

.. ok i will try

earnest phoenix
knotty steeple
#

also snekfetch is depreciated i think

#

@earnest phoenix ok

earnest phoenix
#

ok

static matrix
#

What can i do now

earnest phoenix
#

i testing this thing

#

dont use free hosting

#

problem solved

#

i think it's a correct id in array

#

i did console.log and yes it's my id

knotty steeple
#

read the error

earnest phoenix
#

TypeError: client.fetchUser(...).send is not a function

at Timeout._onTimeout (/app/server.js:116:47)

at ontimeout (timers.js:498:11)

at tryOnTimeout (timers.js:323:5)

at Timer.listOnTimeout (timers.js:290:5)
#

/app/server.js:116

            client.fetchUser(ingame[i-1]).send(`You have 8 seconds to make a choice:
#

oh wait

#

oh yeah you're right

#

it returns a promise

#

so do I do:

var utst = client.fetchUser(ingame[i-1])
utst.send('my thing here')
```?
#

Still errors, so I guess not

lament meteor
#

smh fetchUser is not a function

earnest phoenix
#

what

#

it is

#

and that's still a promise

#

so what do I do now?

#

learn how to work with promises

#

thank you

#

oh

#

.then()

#

right

#

works

#

thanks

static matrix
#

Help pls

knotty steeple
#

thats not how you install modules with glitch

earnest phoenix
#

you have a hello-express project right?

#

go into package.json

static matrix
#

Yes

earnest phoenix
#

and click add package

#

and look for your package there

static matrix
#

Ok wait

earnest phoenix
#

add package is on top left of the package.json file

static matrix
#

How can i install snekfetch

#

Module to glitch

quartz kindle
#

why do you need snekfetch?

#

snekfetch is outdated and deprecated, you should use something else instead

static matrix
#

bot was working until yesterday

#

But now it cant start

quartz kindle
#

to install packages you have to click this

earnest phoenix
#

i use snekfetch ha

static matrix
#

i installed

earnest phoenix
#

then use require('snekfetch') in ur bot

static matrix
#

Which package do i need

#

Ok

#

Errors errors error

#

i never use glitch

#

-_-

unique nimbus
#

Coding is full of errors

#

thats life

#

also I don't use glitch

#

so

#

¯_(ツ)_/¯

wet juniper
#

ay

#

how to dissalow command?

night imp
#

what language

quartz kindle
#

disallow under which condition?

#

for a guild, for a person, for everyone?

night imp
#

He wants to only allow it in #bot-commands

quartz kindle
#

oh lmao

indigo geyser
night imp
#

I told you that wasn't what he needed

indigo geyser
#

I know it was that, he needed the Bots not to work in a certain channel

slender sphinx
#

anyone know how to remove a users reaction to a message in js?

#

im making a reactive help command and need to remove the users reaction but keep the bots once the page has been changed

quartz kindle
#

you dont need to remove it if you use v12 or if you backport some v12 files

slender sphinx
#

then what would i need to do if i were using v12?

quartz kindle
#

create a reaction collector and listen to both reactionAdd and reactionRemove events

slender sphinx
#

okay thanks ill look into it

static matrix
#

What is the simplest bot scripting language

#

Guys

slender sphinx
#

JS

mossy vine
#

javascript or python

slender sphinx
#

Ive heard c# but it seems to be a pain

slender thistle
#

Depends on how experienced you are in programming

knotty steeple
#

lua

slender thistle
#

But yeah, JS and Python are quite simple for the beginners

static matrix
#

discord.js vs discord commando.js or phyton

#

Which

knotty steeple
#

preference

mossy vine
#

imo the only time you would use C# for a discord bot, is if you are already experienced with it or need something very language specific

slender thistle
#

JS first

#

Then d.js

static matrix
#

Ok

slender thistle
#

Python first, then d.py

mossy vine
#

discord.js-commando is just discord.js but with a built-in command handler

knotty steeple
#

but pls dont use commando

static matrix
#

would i need node .js ?

mossy vine
#

yes

#

do you know anything about programming?

slender sphinx
#

im lost where can i get v12?

static matrix
#

Some

mossy vine
#

do you know literally anything about javascript and node.js?

static matrix
#

Not really

quartz kindle
#

@slender sphinx npm install discordjs/discord.js

mossy vine
#

then please do not jump into discord bot development

slender sphinx
#

thanks

static matrix
#

Ok i must learn1. Js and2. node js and 3.dc js

slender sphinx
#

well really only js and Discord.js but yea

mossy vine
#

node.js lets you run javascript code on your computer instead of a browser environment

static matrix
#

Ok

fading wigeon
#

nodejs is different than regular js thi

mossy vine
#

just please do not start making bots without knowing the language properly first

fading wigeon
#

tho*

quartz kindle
#

its not different

mossy vine
#

a very little

fading wigeon
#

@mossy vine why not?

quartz kindle
#

the environment is different, the language is not

fading wigeon
#

its a perfect project for getting to know js

mossy vine
#

@fading wigeon because its a horrible idea and you wont understand anything and even if you get anywhere your code will be absolute shit

#

wtf no

#

it isnt

#

im talking from experience, it isnt

fading wigeon
#

if you only do copy paste

#

then ur right

mossy vine
#

do you expect beginners that dont know shit about programming not to copy paste all the time?

fading wigeon
#

it's all about the goals they set themselves

#

if they set themselves the goal not to copy they wont

mossy vine
#

beginners literally cant and wont do that

slender sphinx
#

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

fading wigeon
#

they can

mossy vine
#

no

#

you overestimate the knowledge of a beginner

fading wigeon
#

well how did i do it then? :P

#

we werent born with coding skills

slender sphinx
#

CAN is the KEY WORD but they WONT

mossy vine
#

^^^^^^

fading wigeon
#

CAPTAIN CAPS DIDNT TAKE OVER THE INTERNET YET

quartz kindle
#

G2 Caps did tho

slender thistle
#

Ngl you don't want to expect shit from beginners

#

They'll fuck up the most basic without knowing the basics and they won't bother Googling

fading wigeon
#

it wont be their only project though

#

and they will improve with the next

slender thistle
#

Discord bot as first project is a bad idea

#

There are already enough fucked up ones

fading wigeon
#

depends on what it does imo

slender thistle
#

We don't need any more

fading wigeon
#

doesnt have to be on dbl tho

earnest phoenix
#

.

slender thistle
#

Did I mention DBL?

mossy vine
#

i jumped into C# not even knowing what it is, expecting to make a discord bot

fading wigeon
#

well you said "we dont need anymore"

mossy vine
#

not even copy pasting worked

slender thistle
#

Discord has enough idiotic bots

fading wigeon
#

yeah but so what

#

survival of the fittest

#

all the idiotic bots dont get used

slender sphinx
#

I started with VB, moved to C#, and then moved to JS with primarily using trial and error UNLESS I seriously couldn't figure out

slender thistle
#

They are still hosted, they still send requests to Discord

fading wigeon
#

visualbasic?

slender sphinx
#

yea

fading wigeon
#

i started with FreeBASIC xD

slender sphinx
#

tf is that?

slender thistle
#

I started with d.py without knowing Python, do you think it didn't suck for me?

fading wigeon
#

and i still kinda regret it tbh

#

its a BASIC reboot

night imp
#

Discord bots encourage newer programmers to dive in. Even if it is a bad bot, it teaches them by example how to code. While they shouldn't copy and paste, we shouldn't limit people actually attempting to learn

slender sphinx
#

oh

fading wigeon
#

but not directly attached to visuals like VB

slender thistle
#

Now all I can do is Discord bots

fading wigeon
#

lol

slender thistle
#

@night imp We shouldn't, but people in here asking stupid basic questions not related to discord libs make it look really bad

#

Let them learn the language first, then let them do whatever they want

slender sphinx
#

If they need help they should join the Disc.js server

mossy vine
#

the server already has enough people that have no idea what theyre doing

slender thistle
#

Not all helpers in there are willing to help with js questions when the server is dedicated to d.js

night imp
#

Completely, but we shouldn't throw them out. I've had many friends who only got into programming due to discord bots.

#

If you aren't willing to help with .Js questions dont

slender sphinx
#

Ima go work on my bot catch yall later

fading wigeon
#

tbh u might be right

#

i started with java generally before i got to JDA

slender thistle
#

Discord libraries aren't the best experience for beginners, as well as a bad way to learn the language. They don't get taught certain things that can help them do their shit better. d.js and d.py servers already have #help channels filled with basic questions that could be solved if they knew the language beforehand.

fading wigeon
#

(my net was gone)

#

(tunnels)

slender thistle
#

Lurking in d.py and watching this channel makes me question how effective Discord bots are as first programming experience

quartz kindle
#

everyone was a beginner at some point, regardless of which project you started with. everyone will tell you "learn the language first" everywhere you go, there is no defined "entry point", you can start where ever you want however you want. if you have no patience for beginners just ignore them.

#

however, it is true that if your goal is to actually learn the language, a discord bot is not the most effective way

#

but you can have a discord bot project and complement it with something else

spring ember
#

my first project was a discord bot, it took me a few tries but it is rather simple to make an ok bot

slender sphinx
#

@quartz kindle how is listening to the add and remove events actually gonna remove the users reaction?

#

now im confused

mossy vine
#

tim is saying dont remove the reaction, but instead listen to the remove event as well

slender sphinx
#

but how is that gonna help? I want the the users reaction to be remove after they select it but i want to keep the client/bots reaction so that it can then be reused

mossy vine
#

<MessageReaction>.remove() is how you would remove it

quartz kindle
#

if you listen to the remove event, it can be reused immediately

mossy vine
#

sure but that might be unnecessary copy paste

slender sphinx
#

@quartz kindle so by doing that it would uncheck the users reaction or?

mossy vine
#

it wouldnt

slender sphinx
#

oh because thats what i want it to do

#

ive even checked the docs and everything and am still stuck on this and have been for like a day or two

mossy vine
#

<MessageReaction>.remove() will remove the MessageReaction

quartz kindle
#

standard way:

bot creates reaction
person clicks reaction
bot updates message
bot removes reaction
person clicks reaction
etc..

remove event way:

bot creates reaction
person clicks reaction
bot updates message
person clicks reaction
bot updates message
person clicks reaction
etc...
mossy vine
#

yeah but thats unnecessary interaction on the persons side

fading wigeon
#

how

quartz kindle
#

basically you dont need to remove the person's reaction, the person can just click the reaction again, regardless if its adding or removing the reaction

fading wigeon
#

yeah

#

thats better

slender sphinx
#

ik @quartz kindle but i find that a bit annoying and repetitive so im trying to just remove it

quartz kindle
#

why is it annoying and repetitive? its making things simpler by having less steps, less requests and less waiting time

#

its faster and more efficient

slender sphinx
#

Its just annoying to have to click the reaction 2x IMO

quartz kindle
#

you DONT HAVE TO

#

jesus

#

removing the reaction will do the same thing as adding the reaction

slender sphinx
quartz kindle
#

here, i'll show you

earnest phoenix
#

hmm

quartz kindle
#

i click once

#

i click again

faint jetty
#

Any Idea About Sharding?

fading wigeon
#

yeah

#

thats how rythm does it i think

earnest phoenix
#

gimme say something

faint jetty
#

Oh

#

@fading wigeon Can I DM You?

fading wigeon
#

sure

slender sphinx
#

Oh i misuderstood my bad

earnest phoenix
#

-_-

#

hmm

#

mute

#

how that system works

quartz kindle
#

the help system?

earnest phoenix
#

no

#

mute system

quartz kindle
#

how to mute people?

earnest phoenix
#

like carl-bot

#
!mute ABC 1h test
quartz kindle
#

well, either roles or channel permissions, and a database to remember the timings

earnest phoenix
#

ok

mossy vine
#

@slender sphinx you get a MessageReaction object in the callback of the messageReactionAdd event. how you define it, i dont know

earnest phoenix
#

Xyber: damn just read the docs

mossy vine
#

not this time

slender sphinx
#

i generally find the docs useless and not helpful tbh

quartz kindle
#

i find them more helpful than most people

#

lmao

mossy vine
#

a good documentation is one of the best tools ever

slender sphinx
#

Thats the thing I personally dont think its a good doc

spring ember
#

It's ok

quartz kindle
#

the docs are amazing

#

but it does take some skill to understand them

spring ember
#

You need to know the basics

#

For that there is An Idiot's Guide

abstract quarry
#

how do I react with emoji ID in embed?

spring ember
#

What do you mean

#

:02shrug:

#

Wait no I forgot how to extract id

knotty steeple
#

\:mmlol:

west spoke
spring ember
#

I tried that Thonk

earnest phoenix
#

how extract id

west spoke
#

Or

#

![mmLol](https://cdn.discordapp.com/emojis/356831697385422848.webp?size=128 "mmLol")

earnest phoenix
#

hmm

spring ember
#

Maybe it doesn't work on mobile

west spoke
#

That works

#

Use ``:emote:``

earnest phoenix
#

dev mode

west spoke
#

I have dev mode on

spring ember
#

![02shrug](https://cdn.discordapp.com/emojis/476424305853595648.webp?size=128 "02shrug")

west spoke
#

But doing it on mobile with\ does this

spring ember
#

Oh ok

west spoke
#

:mmLol:

#

Not the id

spring ember
#

Thanks

west spoke
#

You have to do ``

slender thistle
#

![YEET](https://cdn.discordapp.com/emojis/570572578893070346.webp?size=128 "YEET")

west spoke
#

Not with the backslash

#

![oliypls](https://cdn.discordapp.com/emojis/512280875283513346.webp?size=128 "oliypls")

slender thistle
#

Welp

#

That's pure gay

earnest phoenix
#

💯

#

i cant do this XD

west spoke
#

Then you doing it wrong

earnest phoenix
#

💯

west spoke
#

💯

#

Most likely a mobile thing

#

💯

#

:v

earnest phoenix
#

yea

west spoke
#

\:100:

#

It is also a default discord emote

#

To do that you would just put in the :emote:

#

Not <:emote:id>

earnest phoenix
#

\:flag_us:

west spoke
#

Hol up I'm curious

#

![GWfateeSip](https://cdn.discordapp.com/emojis/392307687955628034.webp?size=128 "GWfateeSip")

#

Heh

earnest phoenix
#

:L

west spoke
#

xd

earnest phoenix
#

/🉑

#

XD

#

\:flag_ch:

digital sparrow
#

heyyo

earnest phoenix
#

🇨🇭

digital sparrow
#

hey

earnest phoenix
#

hello

digital sparrow
#

:middle_finger:

west spoke
#

@earnest phoenix use DBL emotes not default.

#

![mmLol](https://cdn.discordapp.com/emojis/356831697385422848.webp?size=128 "mmLol")

#

Or a different server that you are in

earnest phoenix
#

\:Thonk:

west spoke
#

Without \

earnest phoenix
#

![Thonk](https://cdn.discordapp.com/emojis/356771720863940608.webp?size=128 "Thonk")

west spoke
#

Ye

earnest phoenix
#

wow

west spoke
#

@digital sparrow be nice kthx

digital sparrow
#

ops wrong server

west spoke
#

Loool

#

that's what they always say

digital sparrow
#

:mad:

#

:tickYes:

#

wtf?

earnest phoenix
#

![Thonk](https://cdn.discordapp.com/emojis/356771720863940608.webp?size=128 "Thonk")

#

hmm

fading wigeon
#

<Thonk356771720863940608>

#

oof

earnest phoenix
#

this not works with default emojis

west spoke
#

That's not a default emote

earnest phoenix
#

i know

slender thistle
#

This chat got spammy rq

earnest phoenix
#

wow

#

libraly developer

#

im n00b programmer

west spoke
#

I can see

#

Whitename :v

earnest phoenix
#

yes

#

DJ Putin XD

#

but its over 1700 bot devs

#

:v

#

hmn

west spoke
#

...

earnest phoenix
#

what image editing libs has python

west spoke
#

Pillow

#

That's what I use

earnest phoenix
#

yes

slender thistle
#

PIL, Pillow

#

You need special way to make it non-blocking in async code

earnest phoenix
#
from PIL import Image,ImageFilter  
im = Image.open('image.jpg') 
im.show()
    
from PIL import ImageEnhance  
enh = ImageEnhance.Contrast(im)  
enh.enhance(1.8).show("30% more contrast")
#

test

unique nimbus
#

Do you know how to code?

slender thistle
#

At which part is it related

mossy vine
#

we have ads

quartz kindle
#

@slender sphinx remove the link before you get in trouble. posting servers is not allowed

earnest phoenix
#

Mods do something

#

hey

west spoke
#

@modern sable

modern sable
#

@slender sphinx no ads

earnest phoenix
#

REMOVE IT

west spoke
#

@earnest phoenix btw that's a template. That wont send anything or save anything

modern sable
#

no need to use caps lock

west spoke
#

Lemme revise your code real quik

earnest phoenix
west spoke
#
from PIL import Image,ImageFilter,ImageEnhance,ImageDraw
im = Image.open('image.jpg') 
d=ImageDraw.draw(im)
#use d to draw using ImageDraw module. Must have for PIL.
enh = ImageEnhance.Contrast(im)  
enh.enhance(1.8).show("30% more contrast")
im.save("image.jpg", "jpg")
#

In that space above the im.save put imagedraw stuff

#

Im.show wont send to discord.

#

You would have to save every change done before sending

#

Also you dont need two imports from the same module

#

Wai

earnest phoenix
#

image editing bot XD

west spoke
#

That's pretty much what mine is

#

One sec lemme get something I did in pil

#

The blue is a foreground, the black Is a background

#

One sec lemme do something else

#

Change the color of the text, and background by using a alpha layer

abstract quarry
#

what is missing

#

🤔

west spoke
#

a avatar

earnest phoenix
#

woah

#

also i know how to make economy bot

#

economy can be global (across all server) and local (custom for every server)

west spoke
#

Yeah

#

Though that would be a lot of files

earnest phoenix
#

yeah

mossy vine
#

or a single database

earnest phoenix
#

yes

#

im thinking what commands i can make

west spoke
#

xd

earnest phoenix
#

daily XD

#

basic command for all economy bots

#

hmm

#

what about database

#

SQL?

#

i try

buoyant wagon
#

or you can save to a file

west spoke
#

Daily would be hard to do without a permanently online db I think

earnest phoenix
#

I did it for SQL

#

table: (for global)

|                 UserID               | (currency) |
| 569050509353287690 | 193,821,0 |
#

but for local…

ruby dust
#
CREATE TABLE Economy (Guild INTEGER, User INTEGER, Amount INTEGER, PRIMARY KEY (Guild, User))
```ez
earnest phoenix
#

ok

ruby dust
#

guild and user becomes primary key, so you can't have duplicates

earnest phoenix
#

thanks

#

but it needs python lib?

ruby dust
#

I use sqlite3

#

it suppose to be part of your initial python install already

earnest phoenix
#

oh dblSmile

ruby dust
#

you know how primary keys work?

earnest phoenix
#

wait

#

i know

#

Is it possible to allow a user to input arguments after a bot sends a message?

#

I'm trying to work on a job system where after the bot sends an embed of the job list, you send a message with the job you want if it's valid

unique nimbus
#

what language

earnest phoenix
#

JS

fading wigeon
#

well of course it is

west spoke
#

@earnest phoenix db. Store last used command

#

And check if the user did it

#

Else pass

fading wigeon
#

i wouldn't even use a db

#

i would keep it in a hashmap, idk if theres a JS alternative

earnest phoenix
#

🤔

#

if a db is involved then I think I may have an idea

#

thanks for the idea @west spoke

west spoke
#

No

#

Prob

amber fractal
#

hashmap is just an object

earnest phoenix
#

databases

#

:v

amber fractal
#

but it isnt persistent if your bot goes down or restarts

ruby dust
#

I have no idea why, but I'm kinda obsessed with database management 👀

fading wigeon
#

yeah

ruby dust
#

should be my profession imo

earnest phoenix
#

I honestly find databases really interesting to manage

fading wigeon
#

thats exactly why its better

earnest phoenix
#

I'm only working with basic quick.db stuff right now since my SQL knowledge is limited

#

but they're nice to set up and deal with

restive light
#

I uploaded it

ruby dust
#

ok

restive light
#

anyone works with arduino here?

earnest phoenix
#

whadya need to do? I've used them before but I'm not exactly great

leaden gust
#

i work with them a bunch

restive light
#

What about doing something like to a discord bot with arduino:

If ultrasonic sensors saw something < 50cm, send channel to discord
@restive light someone is in your room!

mossy vine
#

you could just use a webhook for that

restive light
#

I think i dont need webhook

#

I can code arduino's code to discord bot's code

#

if "1" coming from serial port, msg.channel.sendmessage

#

thats all

earnest phoenix
#

idk how ur doing discord integration in arduino code but i can help u with the detect part

leaden gust
#

I mean yeah you can totally do this but the annoying part is going to be the link between the arduino and the discord bot.

mossy vine
#

msg likely wont be defined but ok

restive light
#

Ultrasonic checks something -> "1"
Doesnt check -> "0"

leaden gust
#

Right the ultrasonic check is easy, the hard part is sending the message to discord lol

earnest phoenix
#

so u want to make a function isAnObjectInFrontOfMe()

slim heart
#

You would need internet access obv

#

If anything sending a message to discord would be easy if you have the right modules

earnest phoenix
#

personally, I'd use a rpi for this

leaden gust
#

Yeah first of all you need a wifi card for your arduino

slim heart
#

Or an Ethernet adapter or just someway of connecting to the internet lol

restive light
#

I dont need because it will work with cable

west spoke
#

@restive light pi would be faster, comes with wifi

leaden gust
#

I would DEFINITELY use webhooks for this

slim heart
#

I don’t think it’d be required

earnest phoenix
#

yeah

slim heart
#

All you have to do is send a post to an endpoint with your client credentials attached

leaden gust
#

It's not required but it's a lot more work

restive light
#

I just need creating serial port function to discord bot's code

If serialread = "1" send message

slim heart
#

Tho yes webhooks would be easier I guess

restive light
#

finish

earnest phoenix
#

ah serial port clever

leaden gust
#

Oh your bot is running on a separate machine

restive light
#

yes

earnest phoenix
#

so u need a function

#

to send the output of the sensor

restive light
#

i said

#

My discord bot has an interface

slim heart
#

Ok the find a module of whatever language ur bot uses to event your serial port

ruby dust
#

I remember someone from here made a discord bot command that controls the light in their own room, that was something

earnest phoenix
#

so setup the ultrasonic in your void setup()

restive light
#

Vb6 -> arduino -> javascript -> send message

earnest phoenix
#

digitalWrite(TRIG_PIN, HIGH);

#

then low

slim heart
#

@ruby dust it’s not that hard actually, I have an api wrapper around my philips hue and it works perfectly I could technically use my bot 👀

earnest phoenix
#

then take pulseIn from echo

#

then divide by two

#

and then divide by speed of sound

#

to get distance

ruby dust
#

well I don't have anything that could be remotely controlled, so it's interesting to me

slim heart
#

Ye

earnest phoenix
#

i made a car once using an arduino

restive light
#

nice

#

I created android bluetooth controlled car

earnest phoenix
#

damn

restive light
#
  • escapes from walls
earnest phoenix
#

oh mine is simple af it just stops at an object

slim heart
#

I made a server counter for my bot using an Arduino lol

#

It’s on my wall but I’m on vacation rn I don’t have a picture

earnest phoenix
#

why lmao

slim heart
#

Idk, I just wanted to have a live counter that is really bright and wakes me up at night

#

It also acts as a little thing that’ll tell me if the bot goes down tho

earnest phoenix
#

fair

slim heart
#

So I can monitor outages and fix it if something is wrong rather than not knowing until I wake up and get on discord

earnest phoenix
#

smh u care too much

slim heart
#

People get mad at me if the bot goes down 👀

earnest phoenix
#

lets move channel

slim heart
#

Ye

fading wigeon
#

thats an awesome idea

#

i should do that lol

restive light
#

@earnest phoenix

earnest phoenix
#

damn nice

restive light
#

but

#

it fucks a 9V battery in 1 hour

#

there are two 9V batteries under the robot

#

first 9V is for arduino and motor driver

#

another one is JUST FOR dc motors

earnest phoenix
#

i originally used 4 AAs but it wasn't enough for 4 motors so i added a 9v

restive light
#

How many hours it can work?

earnest phoenix
#

not very long

#

maybe 1

restive light
#

same as mine

#

I want to create a human robot with arduino

#

humanoid*

abstract quarry
#

can I allign a text in discord embed?

mossy vine
#

somewhat, yeah

abstract quarry
#

I want the "HELP" to be in the middle/center

mossy vine
#

yeah not that

knotty steeple
#

maybe

#

make it the description instead of the title

#

and tab away

mossy vine
#

but that wont work on other devices

knotty steeple
#

who cares

abstract quarry
#

yep

#

I care

knotty steeple
#

ok then no

mossy vine
#

you could make the entire thing a picture lmao

abstract quarry
#

Entire?

#

like everything

knotty steeple
#

but you have to generate the picture

mossy vine
#

@knotty steeple or make it beforehand mmLol

ruby dust
#

it won't even work, discord always strips out all the whitespace characters from start and end of the strings

abstract quarry
#

Can I have 2 files (index.js and help.js)

#

in index.js if a user writes !help

#

then it will execute the command in help.js

earnest phoenix
#

@abstract quarry you can use blankField

mossy vine
#

yeah thats called a command handler

#

@earnest phoenix that doesnt center it

abstract quarry
#

yeah

#

it aligns it to the right

earnest phoenix
#

Ohh

abstract quarry
#

ok nvm I don't need to align it

#

i will find a way later

#

how to use emoji ID

#

i have the ID but the command...

earnest phoenix
#

?

abstract quarry
#

Emoji id

earnest phoenix
#

id of a emoji?

abstract quarry
#

id of a emoji

#

no

#

but

#

i want to ract

#

react*

#

I have the ID of the emoji

earnest phoenix
#
const emoji = bot.emojis.get('id')
message.react(emoji)
#

That?

abstract quarry
#

thank you

earnest phoenix
#

Np

abstract quarry
#

does the ID work on other servers?

earnest phoenix
#

Only if the bot has a common server with the emote server

abstract quarry
#

Great

earnest phoenix
#

And if, yes

abstract quarry
#

how does that work

warm sail
#

You can set the "timestamp" on an embed

abstract quarry
#

oh...

#

yeah im dumb

earnest phoenix
#

.setTimestamp()

abstract quarry
#

thank you!

#

both

hearty bramble
mossy vine
#

nice ads

hearty bramble
#

if mods decide that this is bad advertisement, go ahead delete this
i've done this for the benefit of everyone, not to push myself up

abstract quarry
#

how do I set thumbnail as my bot avatar

#

.setThumbnail(${bot.displayAvatarURL})

#

?

mossy vine
#

just do .setThumbnail(bot.avatarURL)

abstract quarry
#

not a well formed url

#

error

mossy vine
#

what

jolly sentinel
#

Uhh

#

Unsure if it's different with discord.js

slender thistle
#

d.js most likely not

jolly sentinel
#

Well, I inputted all I could on it. akkoShrug

mossy vine
#

d.js doesnt

earnest phoenix
#

javascript is easy than python

#

:v

ruby dust
#

preferences, for me python is easier

slender thistle
#

Depends on your mindset and overall what's better for you

earnest phoenix
#

ok

ruby dust
#

I'm more into scripting than coding, since python is a scripting language anyway

earnest phoenix
#

now about my economy bot

#

it needs integrate every currency action in discord with database

ruby dust
#

elaborate

earnest phoenix
#

SQLite3 is good in that

ruby dust
#

well yes, and it's very light

earnest phoenix
#

ok

slender thistle
#

Good luck with blocking, also, aiosqlite sucks too

ruby dust
#

blocking?

#

you mean locking?

earnest phoenix
slender thistle
#

Negative

earnest phoenix
#

🤔

ruby dust
#

so what?

slender thistle
#

If some query takes too long, bot pretty much crashes

ruby dust
#

iirc that's only for async functions

earnest phoenix
#

yes

ruby dust
#

async is vulnerable to actions taking more than 90 seconds without awaiting

#

another way to fix this is to make every function awaitable

#

that way it doesn't "crash"

slender thistle
#

Make everything a coro?

ruby dust
#

yes

slender thistle
#

That doesn't make it actually async now does it

ruby dust
#

that does technically make it await inside async, which is what you were talking about

storm oak
#

does anyone know how to make a bot status in discord.py rewrite?

slender thistle
#

Depends on which one you mean

#

The presence or the status

storm oak
#

the status

#

like what its playing

slender thistle
#

Presence

storm oak
#

oh

#

oops

slender thistle
#
await bot.change_presence(activity=discord.Game(name="a game"))

# Setting `Streaming ` status
await bot.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url))

# Setting `Listening ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))

# Setting `Watching ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie"))```
storm oak
#

thanks

west spoke
#

Async is so much easier than that jesus christ

slender thistle
#

If you are lazy to update to a version that has more features, sure

earnest phoenix
#

which version

slender thistle
earnest phoenix
#

ok

#

ah

#

i have another question

#

how i can get role ID

unique nimbus
#

yes

slender thistle
#

Depending on how you want to get it

earnest phoenix
#

hmm

#

there is different ways to get role ID?

#

hey

slender thistle
#

Do you want to get a role ID in your code or in your Discord client

earnest phoenix
#

code

slender thistle
#

If you already have a role object, use .id

earnest phoenix
#

o k

#
role.id("rolename")
amber fractal
#

uh

slender thistle
#

Uh...

earnest phoenix
#

EXAMPLE

slender thistle
#

I'm not even sure how you want to get a role

earnest phoenix
#

im need this, because i want ping roles without "allow anyone @mention this role" permission

#

but its in code

#

but in client?

#

hey

slender thistle
#

You know you can't mention roles that don't have that option enabled, right

earnest phoenix
#

yay

knotty steeple
#

you can "ping" them

#

with the role id

earnest phoenix
#

i know how i can ping roles without this perm

knotty steeple
#

but it doesnt actually ping everyone with the role

slender thistle
#

Do you have the role name and on which server you can find it, etc

forest sage
#

bot pingrole

checks if role pingable

yes: ping, return
no: make role pingable, ping, make role unpingable, return

#

shitty way but should work

earnest phoenix
#

i can get role ID from "edit" message

indigo geyser
#

Yep

#

<@role.id>

#

I think

fiery stream
#

    at Object.exports.createStatusError (/rbd/pnpm-volume/b2838ab8-1d50-4644-b583-c093a6be8b39/node_modules/.registry.npmjs.org/grpc/1.20.3/node_modules/grpc/src/common.js:91:15)

    at Object.onReceiveStatus (/rbd/pnpm-volume/b2838ab8-1d50-4644-b583-c093a6be8b39/node_modules/.registry.npmjs.org/grpc/1.20.3/node_modules/grpc/src/client_interceptors.js:1204:28)

    at InterceptingListener._callNext (/rbd/pnpm-volume/b2838ab8-1d50-4644-b583-c093a6be8b39/node_modules/.registry.npmjs.org/grpc/1.20.3/node_modules/grpc/src/client_interceptors.js:568:42)

    at InterceptingListener.onReceiveStatus (/rbd/pnpm-volume/b2838ab8-1d50-4644-b583-c093a6be8b39/node_modules/.registry.npmjs.org/grpc/1.20.3/node_modules/grpc/src/client_interceptors.js:618:8)

    at callback (/rbd/pnpm-volume/b2838ab8-1d50-4644-b583-c093a6be8b39/node_modules/.registry.npmjs.org/grpc/1.20.3/node_modules/grpc/src/client_interceptors.js:845:24) {

  code: 13,

  metadata: Metadata { _internal_repr: { 'grpc-server-stats-bin': [Array] } },

  details: 'Internal error encountered.'

}```
#

help me thats the first time i got that error

slender thistle
#

Looks like you didn't read the last 2 messages in #general

fiery stream
#

wgucg

#

uhh ohh

#

lol my chatbot went down because of it

restive light
#

guys how to do if bot losts connection, run node bot.js while network is not connected

#

or something like that

#

auto connect

earnest phoenix
#

hmm

restive light
#

Im using macro recorder for that but sucks my server pc

earnest phoenix
#

set up a daemon script

empty owl
#
  let mID = parseInt(args[0]);
  let channel = args[1];
  let channelArray = channel.split('')
  if (!mID) return message.channel.send('Usage: p!move <messageID> <channel>')
    if (!channel) return message.channel.send('Usage: p!move <messageID> <channel>')
   if (!channelArray.includes('<', '#', '>')) return message.channel.send('Please send a valid channel.') 
  let channelLength = channel.length
  
    let channelID = channel.slice(1, 2, channelLength)
    
  

message.channel.fetchMessage(mID)
  .then(message => console.log(message.content))
    .catch(console.error);
  

Error: Unkown message
the message ID is correct

earnest phoenix
#

require your start file if exists

#

and on disconnect handler, trigger it

#

or use nodemon

empty owl
#

............

earnest phoenix
#

ssh

wanton walrus
#

is there a better way I can do this

#
    function add(go) {
        if (go) passes++;
        else count++;
    }
    //
    search.every(function () {
        if (condition) {
            add(true)
                  //other things
        }
    //
        add()
        if (passes == 10) return false
        else return true
    })
#

Essentially, I was trying to skip an iteration in a for loop, then add another one, but it doesn't work that way, and I cant break out of a forEach loop so

#

I threw together this

#

it's, really gross, but it does work

#

I just don't know if there is a better way I can do it [ping me if you respond k thx]

earnest phoenix
#

Hello

#

It takes time to approve the bot more or less.?

cunning oxide
#

so, anyone else's bots fucked?

#

mine is literally not working because of the google outages and whatnot

hushed quarry
#

mine's fine

cunning oxide
#

idk why

hushed quarry
#

@wanton walrus skip an iteration? use the continue statement

wanton walrus
#

No, I needed to skip it, and then add another iteration

#

I'm interacting with an array which is why I couldn't do that

#

And, I need to stop iterations after 10

#

@hushed quarry

hushed quarry
#

dunno much about javascript, but from my experience with other languages, continue works with any loop (even iterating over arrays). i'm looking at your code and it's hard for me to understand what it does with using vague condition and stuff where i can't see a real world example

wanton walrus
#

Continue works to skip the iteration

#

but if I wanted to add one after skipping

#

is a whole other story

hushed quarry
#

wyd add one after skipping

#

wym*

wanton walrus
#

If I use continue I want to make sure the same # of results are provided

#

so skipping 1 from 10, would give 9, but I want 10

#

etc

hushed quarry
#

keep track of another counter variable?

#

nvm

#

that wouldn't work

wanton walrus
#

Tried that didnt work

#

Yea

hushed quarry
#

the only way I can think of to skip an iteration, but loop the required amount of times is just to have an if statement, which i see you're doing

wanton walrus
#

Yeah the problem is of course, if I skip an iteration, and then add another, I will hit an infinite loop

#

Wait

#

am I a dumbass hold on

#

nvm

hushed quarry
#

you won't hit an infinite loop if you have some breaking mechanism

wanton walrus
#

I would be in an infinite loop of the same iteration*

#

So 1-1 = 0

#

1+1-1 = 1

#

etc

hushed quarry
#

seems kinda odd what you're trying to do, maybe you can solve it w/o this type of loop

wanton walrus
#

I tried a for loop, forEach, do while/ while

hushed quarry
#

i can't really suggest anything else bc i don't know more context behind the problem

wanton walrus
#

Its a weird one

balmy lantern
#

Do some pings just not work?

#

The like <!@> type

slender thistle
#

Works

brittle wasp
#

Hello,
Wanna create category and create some textchannels under that category.
I can create text channel but created on top always.
cant do"Setparents"
Language C#

lost cove
#

Hey, is anyone else having issues with their bots connecting to Discord? Since the google cloud issue earlier, my bot hasn't been able to reconnect to the part of the (gateway?) that allows the bot to read and respond to messages. It can still connect and show as online, and I am getting reports of when it joins a new server, or when someone joins a server, but that is it

wanton walrus
#

I had to reset my token @lost cove

lost cove
#

It came back on for me, thanks AJ

#

Just randomly it came on

wanton walrus
#

weird

fiery stream
#

anyone know good joke api

heady zinc
#

scrape this server for messages from Oliy

#

100% certified quality jokes

fiery stream
#

do u know any api

#

i need it for my chat bot

idle basalt
#

google: joke api

amber fractal
#

I feel like this channel is often mistook for a google search bar

acoustic citrus
#

yo so i am trying to use a json to store my per server settings, but i cant get the info i need, as it says it is undefiened

stuff i need
var id = message.guild.ID;
const type = args[0];
const val = args[1];

the way i tried to grab it (says id is undefined)
file.id[type] = val;

#

thanks in advance

copper cradle
#

restart the bot

#

and try again

acoustic citrus
#

eh i fixed it

#

id cant be caps

strong vapor
#

common Javascript practice

earnest phoenix
#

Hey guys

#

my bot is not appeared !

#

help please

modern sable
earnest phoenix
#

look

modern sable
#

yes?

#

like i said, your bot wasnt approved yet

earnest phoenix
#

ok

earnest phoenix
#

how i can make upvote rewards

sinful lotus
#

use the webhook

#

or the api

#

for webhook you can run a separate code or run it with your bot
for api you just need to use an endpoint

earnest phoenix
sinful lotus
#

is your bot verified first?

#

you cant make that if your bot isnt verified

earnest phoenix
#

verified?

sinful lotus
#

as far as I can see you arent green

#

so I assume your bot isnt verified yet

#

if your bot isnt verified yet you cant use the api

earnest phoenix
#

ok

#

what is webhook

sinful lotus
#

dbl sents a POST request to a server you made, then you save that data yourself

#

then use it as you see fit

earnest phoenix
#

hmm

#

ok

#

weeb

sinful lotus
#

if you know JS enough and about Node.js I doubt that would be hard feat, specially with dbl wrapper although that thing runs with your bot and I woudnt recommend that

earnest phoenix
#

My Bot YirdBot İs verified can you look :?

#

hey weeb

sinful lotus
#

Im not a moderator

#

and dont ask for them to verify your bot

earnest phoenix
#

ok

sinful lotus
#

the more you ask, the more you piss them, the more you piss them the more higher chances of you getting muted / banned

earnest phoenix
#

although I did not understand anything, but interesting

sinful lotus
#

¯_(ツ)_/¯

shy rose
earnest phoenix
#

upvote rewards

#

and how i can make bot online

modern sable
#

did you develop your bot?

#

because if you did then you would 100% know how to

#

(unless you mean the status on the site, that doesn't change until your bot is approved)

earnest phoenix
#

im developing

#

but now i have no access to computer

brittle wasp
#

C# discord.net
How can i create text channel under category

earnest phoenix
#

which version are you on

earnest phoenix
#

I cannot get emotes

#

i write just the thing that is above but it sends :tickYes:

scenic kelp
#

Is your bot in the server that contains that emote?

earnest phoenix
#

bots can use custom emotes

scenic kelp
#

Yes but it has to be in the server that has it

earnest phoenix
#

it is

#

oh wait

#

the bot, not you

#

oh goddamn

#

my test bot isnt

#

smh

scenic kelp
#

There's your problem

earnest phoenix
#

i see tq

#

my bot is not added discord bot list HELP ME GUYS 😄

earnest phoenix
#

wait

lapis meteor
#

I just created a ticket system DM to my bot

#

it works but..

mossy vine
#

ok

lapis meteor
#

when i'm sending attachement (.jpg or .png file)

#

it dont works :/

earnest phoenix
#

thats because its not part of the message content, it's an attachment

lapis meteor
#

But how do i do ?

earnest phoenix
#

look at your docs

lapis meteor
#

djs docs ?

#

um um um

#

this is not helping me anymore

earnest phoenix
#

mhm ikr open the docs, scroll down to message and then attachments

lapis meteor
#

channel.send(message.attachement)

#

so its that ?

earnest phoenix
#

no

#

iirc attachments is an array

lapis meteor
earnest phoenix
#

then learn js

lapis meteor
#

wait what

earnest phoenix
#

also look at the actual message object

lapis meteor
#

message.attachments

#

-_-

earnest phoenix
#

yes

#

its a collection

#

try and put two and two together

#

hmm

lapis meteor
#

const hit = res.messages[0].find(m => m.hit).content;

#

channel2.send(hit);

earnest phoenix
#

where tf did you get that from?

lapis meteor
#

the docs

#

lol why @earnest phoenix

earnest phoenix
#

that makes no sense without context

copper cradle
#

yeah

earnest phoenix
#

ok yk what im getting bored

#

ANANI SİKERİM

copper cradle
#

woah

earnest phoenix
#
channel2.send({files: messageRecieved.attachments.array()})```
copper cradle
#

hmm

modern sable
earnest phoenix
#

ok

static matrix
#

Moderator

modern sable
#

yes?

static matrix
#

Look to dm

lapis meteor
#

@earnest phoenix i'll try

#

@earnest phoenix my bot send "[object Object]"

pulsar cairn
#
TypeError: Cannot read property 'send' of undefined```
#

my life!

earnest phoenix
#

@lapis meteor maybe get the image buffer and try sending it ¯_(ツ)_/¯

lapis meteor
#

-_-

#

Good Joke

#

@earnest phoenix i found it

#

const image = message.attachments.size > 0 ? await this.extension(reaction, message.attachments.array()[0].url) : '';

earnest phoenix
#

ok

lapis meteor
#

btw thx for trying to help me

earnest phoenix
#

np

#

bruh

#

@modern sable

lapis meteor
#

@tawdry osprey

#

bad spammer

#

Lul

earnest phoenix
#

im trying to let my bot set its username to something on "on ready" event

#

no errors but nothing also happens

copper cradle
#

client.user.setNickname("life is hard")

#

oh wait

#

it can't change it globally

#

so you'll have to change it for every guild your bot is

modern sable
#

username though

earnest phoenix
#

holy damn

#

my visual studio code gonna be typescript

#

i dont use ts but it auto import things

lapis meteor
#

i just tried to make a starboard and i have an error at:
const stars = fetchedMessages.find(m => m.embeds[0].footer.text.startsWith('⭐') && m.embeds[0].footer.text.endsWith(message.id));

#

(node:4670) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'footer' of undefined

earnest phoenix
#

can someone tell me what’s the maximum lines allowed in an embed field?

#

probs infinity

modern sable
#

you can have up to 25 fields iirc

#

and each field can have up to 256 characters or something like that

late hill
#

One of the messages in fetchedMessages probably doesn't have an embed @lapis meteor

#

Also, what exactly are you doing with that piece of code?

#

You're fetching all the messages in the starboard channel and searching for the one that has the right message id in it's footer?

#

Wouldn't it be beneficial to store this kind of data in a database..

earnest phoenix
#

can somebody show me example of upvote detection

slender thistle
#

@modern sable field amount = 25, title/field name = 256, value = 1024, footer text/description = 2048
Note that the sum of all characters in the embed should be less than or equal to 6000.

#

(Literally copy pasted from R. Danny :p)

earnest phoenix
#

hey

#

upvote detection example?

quartz kindle
#

which language?

fading wigeon
#

yes

earnest phoenix
#

ok

earnest phoenix
#

i cant save anything to json

#

everything is fine, it saves on my pc but on github

#

i host bot on heroku and get files from github but it doesnt save anything to json file on github

mossy vine
#

iirc you cant write files on heroku

#

plus since heroku decreased the quota, its not the worst option for bot hosting

earnest phoenix
#

oh

#

glitch then

#

but idk how to use glitch

#

back to the kitchen

mossy vine
#

better idea: buy a vps

earnest phoenix
#

ik

#

i dont wanna spend money for a bot that is still under development

quartz kindle
#

google and amazon are free for 1 year

#

there's no best option to get started

earnest phoenix
#

I know these

#

google cloud

#

i may give it a try

#

i know how make my bot online 24/7

#

*realised

earnest phoenix
#

can i save data to json on glitch?

mossy vine
#

yes but its not reccommended

neat flame
#

you can but not suggested

earnest phoenix
#

Why

neat flame
#

because json eats memory and glitch has limited memory

earnest phoenix
#
node bot
mossy vine
#

eh it doesnt really

earnest phoenix
#

hmm

mossy vine
#

its just very easy to fuck it up

#

so you will likely end up with corrupted files

neat flame
#

that too

earnest phoenix
#
node bot
pause

is this still useful?

#

it will stop the console when bot goes offline

#

ok

#

because when bot offline console is useless

#

no you may start it again

#

👌

earnest phoenix
#

hmm

#

how i can set bot status

#

like

#

idle

#

or do not disturb

loud salmon
#

readthedocs @earnest phoenix

earnest phoenix
sinful lotus
#
#

read

earnest phoenix
#

@sinful lotus i cant read tho, explain to me in voice chat pls

slender thistle
#

Illiterate people

grave pilot
#
    let connection = message.member.voice.channel.join();
    let dispatcher = connection.play(await ytdl(info.video_url), { type: 'opus' });

Any idea why that returns connection.play is not a function on master btw

#

DiscordJS ``

steel heath
#

what about: await message.member.voice.channel.join();

dusky marsh
#

voice.channel should be voicechannel @grave pilot

#

im pretty sure at least