#development

1 messages Β· Page 1265 of 1

earnest phoenix
#

By log i think he meant "send"

opal plank
#

which you can then use after its been collected

earnest phoenix
#

Yeah sorry

#

I did mean send

opal plank
#

weird design to add delay but okay

silver lintel
#

also you need to log in with your token or nothing will work

earnest phoenix
#

But what's the main issue tho I'm confused

opal plank
#

idk what they want to accomplish either

earnest phoenix
#

No issue I just don't know how to get it compatible with discord. Like to make the actual bot work. I have the code but not anything else

#

The bot doesn't respond? Not online? Command not working? Error? Unexpected behavior?

opal plank
#

Rolan, here

earnest phoenix
#

No issue I just don't know how to get it compatible with discord. Like to make the actual bot work. I have the code but not anything else
@earnest phoenix I see

opal plank
earnest phoenix
#

Just make the bot login, that's all you need

opal plank
#

you seem to be absolutely lost when it comes to discord bot making

#

read that

earnest phoenix
#

I don't know how to do any of this from my phone and how to get the token into termux. Or how to make the actual bot work

opal plank
#

read

earnest phoenix
#

TERMUX

opal plank
#

the

#

guide

#

i

#

sent

earnest phoenix
#

oh my god sMn

#

termux for bot hosting is like using a butter knife to cut a iron bar

silver lintel
#
const canvas = Canvas.createCanvas(512, 512);
    const ctx = canvas.getContext('2d');
    ctx.fillStyle = hexCode;
    ctx.fillRect(0, 0, canvas.width, canvas.height);

how do i save the canvas as an embed thumbnail not an attatchment?

opal plank
#

post it somewhere and grab the link

earnest phoenix
#

^

#

to send it in an embed, you have to first upload it somewhere, get the url and use that url in the embed

opal plank
#

yup

silver lintel
#

:( ok

earnest phoenix
#

upload it to some trash channel in a server you own and grab the link from that message to use in the embed, for example

#

You don't have to actually send it and grab link

opal plank
#

you need an url

#

thats all

earnest phoenix
#

No

opal plank
#

embed thumbnail doesnt resolve on buffer

earnest phoenix
#
MessageEmbed
.attachFiles({ attachment: ctx.canvas.toBuffer(), name: "Something.png" })
.setImage("attachment://Something.png");```
opal plank
#

ACTUALLY

#

it does

silver lintel
#

oooooooooooo

#

wait it works, tysm volrtex

earnest phoenix
#

Np

#

This is my first time making a discord bot. I have the code and it should run. But I need somebody to walk to through getting everything into termux. I tried reading a guide but I'm still lost. Can somebody help me out with this. It will take a bit but it's my only chance as of now

opal plank
#

Why you so keen on termux?

earnest phoenix
#

Because the only way I can run this is on my phone

opal plank
#

why u rinning it on the phone?

earnest phoenix
#

Because it's the only way I can run it

opal plank
#

use a vps dude

earnest phoenix
#

He is going on the paths i have come around

#

I don't have a pc or anything

opal plank
#

hmmm

#

@faint prism

earnest phoenix
#

And I don't know what a vps is...

opal plank
#

give the man a class on how to run bots on mobile

earnest phoenix
#

<Wait aren't i the mobile dev>

#

They were trying to help me earlier but it took forever to instill

opal plank
#

auger is the one RUNNING the bot on mobile

#

i believe you are only CODING on it

#

(unless im wrong)

earnest phoenix
#

I have to do both ;-;

#

I have ran a bot several times on my phone 5 months ago

opal plank
#

then you might wanna get some tips from voltrex rolan

earnest phoenix
#

So wait? Running the bot requires your phone being open on that program?

#

Yes

#

This is my first time doing something like this

#

You said you had Termux right

#

Yes

opal plank
#

im assuming your phone will have to be repurposed for bots

earnest phoenix
#

So do you have node installed

#

I don't know how to set it up or anything

opal plank
#

unless theres something that allows for background tasks to be running

earnest phoenix
#

And I downloaded node. Not installed it yet

#

apt upgrade -y

#

I don't know how to

#

Run this command

opal plank
#

aight, im off to work on the discord metric board now

earnest phoenix
#

It says nothing installed

#

0 for everything

#

Screenshot?

#

K now
apt install nodejs

#

It says it's already at the newest version

#

Are you on your bot's folder?

#

The directory

#

I havnt set up anything I just opened the app

#

I don't know where I am

#

cd <path>

#

Path should the directory to your bot folder

faint prism
#

@faint prism
@opal plank why the ping

opal plank
#

some brave soul attempting mobile bot hosting/coding

faint prism
#

ah

earnest phoenix
#

Something like cd /sdcard/bot

#

That makes the folder right?

faint prism
#

cd changes directory

earnest phoenix
#

No it accesses it

#

Ok

#

But before that

#

termux-setup-storage

faint prism
#

@earnest phoenix Remember when I said to learn some bash?

#

this is why

earnest phoenix
#

Yeah

#

I setup storage. Now so I do the cd command

#

Now do cd /sdcard

#

Then ls

#

Hm?

#

Do I need an sd card in my phone?

#

No

#

Second one was correct

#

The one that returned no response

#

Ok

#

Do it again?

#

Yes

#

And then do

#

ls

#

ls shows the files in that

#

Blue

#

Is your bot folder one of those?

#

I don't have a bot folder. I don't know what it is

#

I don't know what I'm supposed to have or what I'm not supposed to have

#

The hell, where did you store your code then

#

It's not stored. I wrote it on my Chromebook but it's my school Chromebook so I can't host from there

#

Umm, import it from there to your phone?

#

Like with an sdcard or something

#

It's literally just written in codeacademy

#

It's only 20 lines of code

#

I don't know. I've never done this before

#

codeAcademy?

#

Is that code from there or you wrote it

#

Yeah it's just a website. I wrote the code in the middle of a lesson

#

I wrote it

#

I mean, why not just send the thing from your chrome book to your phone

#

The code files

#

I don't have a file of it and I don't know how to make one

#

Is there a software I need to make the file?

digital ibex
#

email it to urself

earnest phoenix
#

And another thing is that I can't download anything

#

How did you write code if you didn't even have a file

#

I can write the code out by hand. I don't need to email it to copy and paste

#

In code academy you don't need a file period and you can't access the one that you coded into

#

Long story short I don't have a file and the only way I can make one is from my phone. How can I do that

#

Wait a second, you wrote the code on code academy website?

#

Yes. It does not run there as it has some discord stuff

#

Well time to rewrite that code again that you wrote on Code Academy

split hazel
#

do you even know what you're doing

earnest phoenix
#

Not really. I have the code but when it comes to actually making it into a bot I'm lost

#

He is a bit confused but he's got the spirit

split hazel
#

are you trying to make a discord bot and host it on codecadamy preview?

earnest phoenix
#

I also have to make something that can get my token but I haven't created the bot account yet. I do know how to format that though

#

And no I'm not hosting it there

#

But I wrote the code there because it has some good color coding

split hazel
#

whew I was worried

earnest phoenix
#

He's trying to host his bot from termux but he wrote it on there

#

Well sad, rewrite it on a code file now

#

How do I do that

#

Make a new folder and then a new file with the extension of .js

#

And rewrite it in there

#

Um..

#

Where do I do that

#

You do that with a file manager app

#

I'm really new. I have been working for 2weeks to write the code. Andit's going to take me a little bit to get the file manager app

#

Is there a specific app I should get?

#

Wait I figured it out

#

What do I name the folder?

#

Whatever

#

Just your bot's name

#

I just named it bot

#

Although it's going to get confusing when I have more than one

#

K now inside of that, make a new file

#

Called index.js

#

It's not letting me make a new file. Only folders

#

So I need to download something to let me do that?

#

Show me

#

Inside of your folder

#

Well uhh

#

;-;

#

Download a file manager like File Commader

split hazel
#

just watch a YouTube tutorial on how to make a bot on android honestly

earnest phoenix
#

And get to a roadblock at the end

#

What a great idea

split hazel
#

this channel exists 😫

earnest phoenix
#

I'm a smol boi so my parents have to approve the file manager

carmine summit
#
if ((message.content.toUpperCase().includes('.ORG') || message.content.toUpperCase().includes('.GG') || message.content.toUpperCase().includes('.COM') || message.content.toUpperCase().includes('.LY')) && !message.member.hasPermission('ADMINISTRATOR')) return message.delete()
```hmmm any way to make this  lot shorter?
earnest phoenix
#

Why the hell to do that

#

Well not smol smol but not tol

#
if ([".ORG", ".GG", ".COM", ".LY"].some(element => message.content.toUpperCase().includes(element)) && !message.member.hasPermission("ADMINISTRATOR")) return message.delete();```
carmine summit
#

Bruh

#

i cannot understand any of that

earnest phoenix
#

Basic JavaScript

#

It's loops right

#

Absolutely incorrect

#

No it isn't that is for

#

Heck

carmine summit
#

so the arrays, became element?

#

then loops 4 times

#

????

earnest phoenix
#

I confused you sorry

#

It iterates through the array prototype to check every element applying to the given function, binding and checking if any of them comes out as true

carmine summit
#

what does .some do?

prisma oriole
#

What he just said

#

it's similar to .forEach

faint prism
earnest phoenix
#

Yea but not exactly, because forEach isn't supposed to return a boolean @prisma oriole

faint prism
#

@earnest phoenix

carmine summit
#

ohhhhhhhhhhhhhhhhhhhh

earnest phoenix
#

I'm here

prisma oriole
#

yeah, forEach just does the iteration, .every and .some return booleans by the nature of their usage

carmine summit
#

sure i know forEach

#

just learned it yesterday

faint prism
#

That screenshot is all the commands I did to run it

split hazel
#

is there a good use case for for each nowadays

earnest phoenix
#

His issue is currently not being able to make a file to write his code

split hazel
#

it's quite slow and limited (you can't break and continue)

prisma oriole
#

you can use .every or .some for that

#

but yes it is slow

#

that i agree

split hazel
#

I did a performance test on loops once I think for each was second last

earnest phoenix
#

The only use for js Array.prototype.forEach() is you being too lazy to do an actual for loop

#

But this also resolves promises at the end if any given as a parameter

#

But any given function for it to bind through every element, it's way too slow

#

Bind takes some time

split hazel
#

I'm quite surprised for of is a bit slow as well

earnest phoenix
#

Bind doesn't even take a millisecond but for each fucks it up

ancient falcon
#

When I try to import a module from the ones installed on my computers through pip, it only works if I run the python file with the python.exe so python myfile.py works but myfile.py throws an importerror does anyone know why that happens, why doesn't the interpreter check site-packages when calling the file like an executable

earnest phoenix
#

Rip bind

fervent goblet
#

how do i check if there are 3 numbers in my array that are the same?

#

so if 3 out of 5 numbers are the same return true

earnest phoenix
fervent goblet
#

ahhh alright thanks

earnest phoenix
#

@earnest phoenix or

#

U can use regex

#

In an array?

#

No

#

For (let x = 0; x< array.length; x++){
For (let y = 0: y < array.length; y++){
For (let x = 0; z < array.length; y++){
If (array[x] === array[y] =={ array[z]){
Let sameNumber = true
}
}
}
}

#

Hehehe

#

For the website url

#

It's not completely formatted but it works

#

I dunno that's what I learned

#

That's the most inefficient way

#

Yup

#

But it works

#

Not for all types of arrays

#

True

faint prism
#

@earnest phoenix did you get the bot running on termux btw?

earnest phoenix
#

No. I still need to get the file because it's taking forever for my parents to approve it

faint prism
#

?

#

what

earnest phoenix
#

Long story

faint prism
#

Add me as a friend and I can probably walk you through it

earnest phoenix
#

@faint prism does .net work eith C#

faint prism
#

yes?

#

.NET includes C# lang

earnest phoenix
#

Is .net like

#

A lang

faint prism
#

No

earnest phoenix
#

Or just framework

faint prism
#

It's a software framework

#

yeah

earnest phoenix
#

I see

faint prism
#

Lotta good stuff in there

#

I'd compare it to nodejs, but it's a bit more than that

#

A lot more really

#

Long story
@earnest phoenix I've got a bash setup script for you to get you started

#

I made it for termux bot deployments

earnest phoenix
#

Que

fervent goblet
#

i wanted to check if there are 3 of the same numbers in the array

#

not 3 numbers = 3

#

which then the code you gave me would return true

ionic dawn
#

gif-encoder-2 and canvas are destroying my mind

earnest phoenix
fervent goblet
#

yes

#

i tested it several times

earnest phoenix
#

Here's a copy of my code, try again

let someArr = [6, 4, 6, 6, 2];

someArr.map(e => someArr.filter(element => element === e).length).sort((a, b) => b - a)[0] === 3;```
modest smelt
#

hey i have a questin

#

is anyone here good at json?

earnest phoenix
#

Maybe

opal plank
#

@modest smelt state your question already

thick gull
low shard
#

Someone know how to do like when you starting live on YouTube it’s notification in any channel

opal plank
#

Youtube auth is absolutely a hassle for that

#

im unsure if Youtube provides webhooks though

#

worth a google @low shard

low shard
#

πŸ‘

opal plank
#

Does DJS have an all events listener? think

#

Hmm this is annoying

#

having to create a listener for each event is such a pain

faint prism
#

why listen to every event?

opal plank
#

metrics

#

measure amounts of events received on the websocket

#

Jesus christ this is one girthy commit

faint prism
earnest phoenix
#

Did you just make that?

opal plank
#

yes, in 10 minutes

earnest phoenix
#

And also how do I use it

opal plank
#

actually

#

wtf

#

i was kidding

earnest phoenix
#

No @faint prism I'm confused. How to use that. Also you are awesome

faint prism
#

No @faint prism I'm confused. How to use that. Also you are awesome
@earnest phoenix

#

that's a bash command

#

you run that

#

or you can type out this:

#!/bin/bash

#Setup project folder
mkdir bot
cd ./bot/

#Install dependencies
apt update && apt install -y nodejs
npm i -g pm2 && npm i discord.js dotenv

#Scaffold bot
printf "require('dotenv').config({path: __dirname + '/.env'})\nconst Discord = require('discord.js');\nconst client = new Discord.Client();\nconst token = process.env['DISCORD_TOKEN'];\nclient.on('ready', () => {\nconsole.log(`Logged in as ` + client.user.tag);\n});\nclient.on('message', msg => {\nif (msg.content === 'ping') {\nmsg.reply('Pong');\n}\n});\nclient.login(token);" > index.js

#Set token
while [ -z "$token" ]; do
    printf "Enter bot token: "
    read token;
done

#Write token
echo "DISCORD_TOKEN=$token" > .env

#Start bot service
pm2 start index.js --watch
pm2 monit
modest smelt
#

what is that for?

#

chess?

faint prism
modest smelt
#

yes

#

ok

#

nice

faint prism
#

The smallest someone has ever implemented chess in JS

modest smelt
#

Also how do i make a new folder through python

#

what i want to do is that when my bot joins a guil

#

guild*

#

it will make a folder such that it will be formatted like this:

faint prism
#

JSON is data, not something that can actually do anything

modest smelt
#

guild.id.json

#

sorry

#

i mean python

#

do u know?

faint prism
#

I mean

#

Just google it tbh

#

oh wtf

#

lmgtfy is swamped with ads now

earnest phoenix
#

there google search api probally is unpaid now

faint prism
#

That's fucked

#

Basically unusable

earnest phoenix
#

the one i have for my discord bot gets the ads too

#

@faint prism I'm here. What's next

faint prism
#

Is your bot online?

earnest phoenix
#

Lemme check

#

I can't figure out how to add it to my discord

#

;-;

fast trench
#

Rip

faint prism
#

Lol well it works for me

earnest phoenix
#

Its online

faint prism
#

Nice

#

Now you're hosting from your phone, the development you'll have to figure out on your own though

earnest phoenix
#

How do I write the code it doesn't let me type

faint prism
#

nano

earnest phoenix
#

?

#

I can't figure out how to type

#

When I have everything set up but I don't know where to put the code

#

@faint prism what's my next step. Where do I put the code

faint prism
#

index.js is the bot

#

use nano to edit it

earnest phoenix
#

Where do I put that and what's nano

faint prism
#

man nano

#

oh wait

earnest phoenix
#

It's not letting my type at all

faint prism
#

termux might not have man

#

nano is an editor

earnest phoenix
#

Oh ok. So do I need to download nano?

faint prism
#

nah should be already in termux

earnest phoenix
#

Then how do I access it

faint prism
#

nano is like notepad for a CLI

#

nano <the file name>

earnest phoenix
#

I can't type anything

faint prism
#

you're in pm2 monit

#

You need to exit it

#

press CTRL and press c

#

that exits a program

earnest phoenix
faint prism
#

yup

earnest phoenix
#

What's next

faint prism
#

you're back to the terminal

earnest phoenix
#

Ok so how do I edit it

faint prism
#

so type nano and the file name

earnest phoenix
#

What's the file name. ;-;

#

I didn't make a file

faint prism
#

the script did
type ls to list files and folders

#

do you see the .js file?

earnest phoenix
faint prism
#

cd bot/

#

then ls again

earnest phoenix
faint prism
#

yep

#

do you see the .js file

#

(it's kinda hidden by your keyboard in the screenshot)

earnest phoenix
#

Index.js?

faint prism
#

yep

#

nano index.js

#

that's your bot script

earnest phoenix
faint prism
#

yep

#

CTRL and X will exit and ask if you want to save

opal plank
#

linux on mobile?

faint prism
#

That's all you need to know for that

opal plank
#

πŸ‘€

earnest phoenix
#

What's next tho. ^0

faint prism
#

linux on mobile?
@opal plank termux but yeah. Android is based on it

opal plank
#

interesting

faint prism
#

What's next tho. ^0
@earnest phoenix That's it really, your bot is running

earnest phoenix
#

Wait what about my code?

#

How do I add it?

faint prism
#

by typing something

#

I'm not going to help you develop the bot. But I got you set up since you didn't have a PC πŸ‘
It's up to you to learn Javascript and improve the bot

earnest phoenix
#

Ok. There's already some ping pong stuff. Do I take that out?

faint prism
fickle arch
#

I had error saying voice is not defined πŸ€”

faint prism
#

interesting
@opal plank sorry, Android is based on Linux. So creating an emulator for it isn't too much of a stretch. Termux is more of a chroot iirc

opal plank
#

ponmg

#

oh i see

#

Termux sounds awfully familiar to Tmux

fickle arch
#

TortureMux

opal plank
#

im using tmux on my host

#

its okay

faint prism
#

Well, ones a chroot and the others a terminal multiplexer. Not really similar :kekw: but yeah

opal plank
#

once you get used to it its infe

#

ah i see

#

As you've noticed, im no linux expert whatsoever

faint prism
#

You might be able to use tmux inside of it actually

#

I know you can use screens

opal plank
#

wdym?

#

tmux technically terminal no?

faint prism
#

tmux technically terminal no?
@opal plank no

#

It's a terminal multiplexer

#

Basically that means it's creating windows for multiple terminals inside of one giant window

#

Really useful for SSH sessions

opal plank
#

i misread what you said

faint prism
#

So you can just have one SSH session and multiple terminals opened essentially

opal plank
#

I know you can use screens
misread as 'i know because you use screens'

#

thats precisely what i use it for

#

not having to navigate everywhere

faint prism
#

I exclusively use screens at the moment, I don't know how to use tmux mmLol

opal plank
#

its quiote simple actually

#

see that bottom bar?

faint prism
#

But it's On my to-do list, just like vim

opal plank
#

0, 1, 2, 3

#

those are the windows

faint prism
#

Sweet

opal plank
#

simply right click them

#

thats it

faint prism
#

Wha

opal plank
#

yeah really

#

look

faint prism
#

Tmux supports mouse?

opal plank
#

yeah theres an option

#

fuck lemme grab it

faint prism
#

Woah

#

All good I get it

opal plank
#

set -g mouse iirc

faint prism
#

I was intimidated by the key combinations

opal plank
#

its pretty dope tbh

faint prism
#

It's just a straight-up gui lmao

opal plank
#

basically yeah

#

you can use it without mouse

#

but holy fuck does having a mouse access make a difference

faint prism
#

Doesn't that need key combinations though

opal plank
#

it does

#

you need to type the command once to enable tmux to use mouse

faint prism
#

Yeah, that's the part that turned me off of it. With screens all I had to do was control A and then press D

#

Then it was just commands to reattach to sessions

opal plank
#

ctrl + b

faint prism
#

?

#

Are you saying that's equivalent

opal plank
#

not quite

#

to get the mouse

#

[

#

ctrl + b then type that command above i sent

#

boom, gui with mouse

faint prism
#

Ah

opal plank
#

such a lifesaver for a scrub like me who uses windows

faint prism
#

To be honest, Linux isn't as bad as you think it is. A lot of it works the same as PowerShell TBH or Windows batch

#

Talking about bash I mean, not Linux

opal plank
#

yeah i get ya

faint prism
#

Or SH, or zsh

opal plank
#

im used to terminals

#

its just that i much rather have a gui

faint prism
#

Lol I kind of like CLI more

earnest phoenix
#

all operating systems are terrible
the real bois use machine language straight instead of a middleman operating system making it easier

faint prism
#

I don't know what's wrong with me lmao

opal plank
#

the only issue with terminals is learning all the syntax

earnest phoenix
#

the only issue with terminals is learning all the syntax
@opal plank disagree

opal plank
#

powershell and cmd are almost exactly the same

#

though stuff like linux has its own thing going on

faint prism
#

all operating systems are terrible
the real bois use machine language straight instead of a middleman operating system making it easier
@earnest phoenix have fun managing interrupts and multiple tasks at once

earnest phoenix
#

lol don't bring me back to 1947

faint prism
#

powershell and cmd are almost exactly the same
@opal plank PowerShell is surprisingly advanced. It actually uses some similar libraries I use in C sharp

earnest phoenix
#

*1956

#

What do I do here?

#

second generation computers

#

I'm trying to save

faint prism
#

Ffs

opal plank
#

i used powershell for most of my things tbf

faint prism
#

Token leak

earnest phoenix
#

@earnest phoenix god job you leaked the token allow me to copy

opal plank
#

go reset ur token

earnest phoenix
#

NEVER LEAK THE TOKEN

#

else bot death

#

I'm resetting

opal plank
#

we now going to login into it and send free nitro to everyone

earnest phoenix
#

;-;

#

Ok what do I do tho

opal plank
#

reset it

#

go to the portal and refresh token

earnest phoenix
#

I already did

faint prism
#

Ok what do I do tho
@earnest phoenix and then make sure you update your bot script with a new token

earnest phoenix
#

I mean to save the code

#

@earnest phoenix please store tokens in seperate files instead of directly storing it in the place where you're doing bot.login()

opal plank
#

hardcoding tokens = big nono

faint prism
#

I mean to save the code
@earnest phoenix CTRL and X and then press Y when it asks you to save

#

From inside nano

earnest phoenix
#

I mean to save the code
@earnest phoenix remove your keyboard from the computer, use a complex version of OTG to connect it to your phone then press Alt + F4

opal plank
#

or ctrl + o and then ctrl + x

faint prism
#

Yeah wtf

earnest phoenix
#

I did and it gives me a bunch of options

faint prism
#

My bot script was using an environment variable, why do you change it to hard coded?

#

Lol

#

Voice to text

earnest phoenix
#

I know. I accedentsly deleted that and didn't know how to add it back on

opal plank
#

coding while talking

#

hmmm

earnest phoenix
#

My butt script was using an environment variable, why do you change it to hard coded?
@faint prism seems like the word botum has got control of your mind

opal plank
#

thats an idea right there

faint prism
#

Good luck linting that

earnest phoenix
#

But what do I do with the options

opal plank
#

prob a very bad one at that

#

just screech LIIIIIINT and it formats it for you

faint prism
#

Linterize it

earnest phoenix
#

What?

faint prism
#

I was talking about something else

earnest phoenix
#

It's telling me to enter more stuff before I save

#

But I don't know what it means

opal plank
#

maybe have done too many gauges

#

oh god, metrics for days

#

ALL THE METRICS

faint prism
#

But I don't know what it means
@earnest phoenix watch a YouTube tutorial on how to use nano

earnest phoenix
#

I just wanna save

#

;-;

faint prism
#

It should only ask you two questions

#

Do you want to save?

#

And where do you want to save it?

#

The first one you'll say yes

#

The second one should default to the same file that you're editing

#

Ie You just press enter

earnest phoenix
#

Ok thx

opal plank
#

aaaaaaaaah i wanna push the update already

#

need to wait for host to come back

faint prism
#

@earnest phoenix

#

nano .env

earnest phoenix
#

It's working

#

The bot

#

:)

#

just screech LIIIIIINT and it formats it for you
@opal plank i tried but my computer crashed

#

There's a problem

#

The bot spams the final command

#

And doesn't stop

#

Anyway I can fix this?

#

Nvm

#

I fixed the error

#

Do Google Calendar reminders work even when the webpage tab is closed?

feral aspen
#

My bot is VERIFIED!! πŸ™‚

earnest phoenix
#

Neat

#

I wonder if mine will get accepted,

#

we need to make the Shrek closing book meme for that

sweet ruin
#

Hello, I am trying to make level role rewards command

#

but i dont know how to make it fully custom

#

so members can set the level they want in the database and the role

#

but add multiple levels and rewards

lunar yew
#

My bot is VERIFIED!! πŸ™‚
@feral aspen how long did it take?

feral aspen
#

2 weeks!

lunar yew
#

wow

#

2 weeks to get it in 75 plus server?

feral aspen
#

No no no, 7 months for that.

lunar yew
#

WOW

feral aspen
#

πŸ˜‚

lunar yew
#

oh god

#

im only at 30

#

and i need it by the 7 of oct

#

@feral aspen

feral aspen
#

Good luck! πŸ™‚ I hope you success.

lunar yew
#

ty

#

wait i cant get my bot verified after the 7 right? @feral aspen

feral aspen
#

Nope

#

It will close.

lunar yew
#

oh god

#

pls help me people

#

2 WEEKS

#

OH NO

#

PLS

#

HELP

earnest phoenix
#

yeah my bot is gone lmao

#

no way to get it verified in 2 weeks

carmine summit
#
client.on('messageReactionAdd', (client, data, message) => {

})
```How can I get the ID of the guy who reacted???
nimble kiln
carmine summit
#

right

nimble kiln
#

so if you change it to those, then it's user.id

carmine summit
#
client.on('messageReactionAdd', (messageReaction, user) => {
console.log(user.id)
})
```like this?
nimble kiln
#

yup

silver lintel
#

i might seem really really very dumb by saying this, but how to get a user with an id?

nimble kiln
#

Do you want a user or a member of a guild?

silver lintel
#

user

nimble kiln
#

then client.users.fetch('userid') will get you the user object

#

userS - typo

#

If you are using that inside of a command, then message.author should also have the user object

silver lintel
#

i just want something to send to me in dms

#

to make a command so the bot sends me something

nimble kiln
#

oh okay, yeah then use client.users.fetch('userid').then(u => u.send('Oh hi mark'));

#

or something similar

#

3 edits, I am proud of myself KEKW

earnest phoenix
#

Can you host a Discord botum on Google Firebase and is it worth it?

#

Hello

#

anyone alive?

#
+ firebase-tools@8.11.0
added 603 packages from 376 contributors in 206.419s

poggertrainpoggertrainpoggertrainpoggertrainpoggertrain

fluid basin
#

as a database? sure
but hosting your bot? prolly no

earnest phoenix
#

ok

fluid basin
#

unless you have the free GCP credits, then you could use the compute engine, but after it expires you will need to host it somewhere else

#

though I doubt if using the f1-micro always free tier instance is a great idea

lunar yew
#

lmao i host my bot with the server thats under my desk

fluid basin
#

and they only provide 1GB egress of traffic hoho

#

thats almost nothing but if your bot uploads attachments or images, 1GB won't be enough

restive furnace
#

oh okay, yeah then use client.users.fetch('userid').then(u => u.send('Oh hi mark'));
can't it be #get? since get tries to get from the cache first, then fetch if it did!'t find it from cache.

fluid basin
#

no ones stopping you from that, but if the user is not cache you will need to fetch it anyways

ionic dawn
lime stream
#

One again what is the best vps option to host the bot?

torn ravine
#

Depends on size

#

great options and ones that are highly recommended by the community are galaxygate and contabo

lime stream
#

Okay

#

Ty

torn ravine
#

To answer your question about a VPS, I currently use Digital Ocean and absolutely love it. Never is down for me, and always works well. I have used Galaxy Gate before, and don't really have a liking for it, but it isn't bad that I would go out and specifically say don't use it. I also have used Vultr, which I consider just as good as Digital Ocean when it comes to setup and pricing(for the lower end). DO has more features than Vultr and GG, though.
Digital Ocean starts at $5 with the following
-1gb of RAM
-1vCPU shared
-25gb SSD
-1TB Transfer(Bandwidth)
Vultr also starts at $5, assuming you want an IPV4 address, with the following
-1vCPU
-1GB of RAM,
-25GB SSD
-1000GB Bandwidth.

Digital Oceans addons include:

  • Extra Block Storage, starting at $10/mo for 100GBS
  • System Level Backups once a week, stored and retained for 4 weeks, $8.00 a month/20% of the Droplet(VPS) price.
  • Many Distros to use, less than Vultr though
  • 3 different Container Distros(CoreOS, Fedora Atomic, and RancherOS)
  • An absolutely huge marketplace for applications you can put on your VPS
  • Snapshots
  • Custom Images
  • IPv6
  • Private Networking
  • User Data
  • Monitoring
  • Many Regions(3 for New York, 2 for San Fransisco and Amsterdam, and 1 for London, Frankfurt, Toronto, and Bangalore) *Subject to change
    All of which are free to use, unless otherwise stated in the above.
    Setup is also a breeze with choosing SSH Keys or One time password, and you can even create duplicate droplets right from there.

Vultr Includes the following additional options

  • Auto backups for $2.00/mo(any time, any day scheduled)
  • IPv6
  • Private Networking

This is just the tip of the iceberg of what both can do, and I suggest one of these guys. If not, you still do have plenty of options, but from my experience, this was my take. Any suggestions or comments please let me know.

#

I copied and pasted from one of the pins but you get the idea

lime stream
#

Ok ty again

fast trench
#

what do I code into my command handler to make mentioning my bot it's prefix?

obtuse niche
#

Py or js

fast trench
#

js...I've been wanting to for a while but am just now getting to it...this is what I have but it's not even passing this line so i know it's wrong```js
if (!message.content.startsWith(definedPrefix) || !message.content.startsWith(@worn warren)) return;

obtuse niche
#

Ah sorry cant help u im a python guy

earnest phoenix
#

@fast trench so ur just trying to make the commands also respond to the bot being mentioned correct

fast trench
#

right

earnest phoenix
#

try just splitting the content string by spaces

#

check the first index

#

see if its the the mention string

#

or u could use message.mentions i think it was

fast trench
#

ooh didn't know message.mentions was a thing tbh

#

oh wait yes I did lol

#

this returns undefined if I do @Wildcat#2712 help

const botPing = message.mentions.members.first();```
earnest phoenix
#

hmm idk im more of a c# guy i only touched d.js a bit

#

sorry

cerulean grotto
#

How to setup DSL bot

fast trench
#

all good thank you anyway I appreciate it

#

How to setup DSL bot
@cerulean grotto there's nothing to set up?

cerulean grotto
#

But

#

When I put DSL

#

Check my server

#

It isn’t there

#

Or wait lemme see again

hazy sparrow
#

Is therea top.gg api for voting bots?

fast trench
hazy sparrow
#

Alr sorry

fast trench
#

all good lol I was just letting you know there is

pale vessel
#

@fast trench try js if (!message.content.startsWith(definedPrefix) || !message.content.startsWith(`@worn warren`) || !message.content.startsWith(`@worn warren`)) return;

narrow cloak
#

hey i got stuck at node. my folder name to process the code anyone please help

pale vessel
#

<@!id> can also be a mention of the bot has a nickname

fast trench
#

oh yeah I forgot about that option

#

hey i got stuck at node. my folder name to process the code anyone please help
@narrow cloak wdym?

#

nope didn't work @pale vessel

narrow cloak
#

i typed coding for my discord how can i process that

fast trench
#

idk what you are even trying to do? run the bot? like turn it on?

pale vessel
#

wait you're using ||

#

why

#

use &&

#

if one of them is false, it'll return

#

you only want to return if ALL of them are false

narrow cloak
#

idk what you are even trying to do? run the bot? like turn it on?
@fast trench yes i want my bot to online

earnest phoenix
#

make sure that there is a module in that folder

fast trench
#

then you should probably watch youtube if you can't even turn it on

earnest phoenix
#

that has like code for a bot

#

and all that stuff

#

lmao

fast trench
#

@pale vessel ooooooh πŸ€¦β€β™‚οΈ I'm so dumb...I've had that mistake before lol

narrow cloak
#

make sure that there is a module in that folder
@earnest phoenix yes i downloaded bot module

earnest phoenix
#

wat

#

no i mean node

#

node js works off of a package.json and a lock.json if im correct

#

if there isnt a package.json / lock in that dir u ran node .

#

it will error out

#

because it couldnt find a module to run

fast trench
#

@pale vessel nope πŸ€” this is odd

pale vessel
#

how do you handle args

#

prefix length?

#

do you slice the prefix length before splitting args?

narrow cloak
#

so plese tell me the steps to

cinder patio
#

usually it won't error if there is no package.json / lock.json. If you run a .js file via node file.js it should work, unless it uses npm packages.

earnest phoenix
#

or unless he just messed it up big time but i got no clue

narrow cloak
#

i not understanded what do you mean

fast trench
#

@pale vessel also if the pings are too much just let me know...I don't wanna get buried in the messages loljs message.content.slice(definedPrefix.length).split(/\s+/);

pale vessel
#

if you use mentions, don't you think it's slicing less than it should?

#

mentions are longer than the defined prefix

fast trench
#

right πŸ€”

pale vessel
#

so it won't detect the command

fast trench
#

it's supposed to be an alternate prefix though

#

oh wait...I see the issue lol

pale vessel
#

yes and args depend on the definedPrefix's length

fast trench
#

I don't have it rechecking when I check to see if it's using the correct prefix in the db

pale vessel
#

so change the length if it's a mention

fast trench
#

ok yeah I'm lost

vagrant elk
#

Hi

fast trench
#

did you need help?

vagrant elk
#

Yeah

fast trench
#

then ask

vagrant elk
#

How do i create a bot?

#

lol

languid dragon
#

a lot of google and youtube and code experience

fast trench
#

How do i create a bot?
@modern sable I feel like this is just a troll...

languid dragon
#

huh?

modern sable
#

-faq 3 -c @vagrant elk

gilded plankBOT
leaden rover
#

How do I disable a command or a cog in discord.py in a guild? I have moderation and stuff, but I only need music, so how do I disable a cog or command so I cannot use the commands that are disabled?

manic plinth
#

I made a bot but it doesn't add to top.gg
please help me

fast trench
fluid basin
#

yes stop asking everywhere

manic plinth
#

@fast trench I made a music bot, I wanted to add it to top.gg but I wrote the description or something but she did not accept

cinder patio
#

I didn't know top.gg is a girl. What error did you get? You should get an error at the top of the page

manic plinth
#

Brief Description error

cinder patio
#

Your brief description is probably too short, or too long. The actual error should be below that ^

manic plinth
#

too short

cinder patio
#

Well, come up with a longer brief description

manic plinth
#

okey

leaden rover
#

How do I disable a command or a cog in discord.py in a guild? I have moderation and stuff, but I only need music, so how do I disable a cog or command so I cannot use the commands that are disabled?

fast trench
#

@fast trench I made a music bot, I wanted to add it to top.gg but I wrote the description or something but she did not accept
@manic plinth wrong channel and dont ping me

white vapor
#

bot is offline with no apparent reason, I made 0 changes since it was last online

#

it’s also discord.js

fast trench
#

It says what happened...just try to restart it until it works

white vapor
#

tried for a while

fluid basin
#

you can consider making a new instance

#

if it just refuses to start

balmy mortar
#

how would i put the fields

#

like

#
  •   -
    
  •   -
    
#

ive been trying

#

idk how

white vapor
#

is it possible to create a new instance on mobile or do I have to use a computer for that

earnest phoenix
#

@balmy mortar inline

balmy mortar
#

im trying

#
    embed.add_field(name="**Instagram:**", value="[@trusted](https://www.instagram.com/trusted/)", inline=True)
    embed.add_field(name="**Kik:**", value="[BeaM](http://kik.me/BeaM)", inline=True)
    embed.add_field(name="**Telegram:**", value="[Boyfriend](http://t.me/Boyfriend)", inline=True)
    embed.add_field(name="**OGUsers:**", value="[Beam](https://ogusers.com/Beam)", inline=True)```
#

which would i make true and false?

earnest phoenix
#

All true

balmy mortar
#

they are all true...

#

thats what it doees

#

when they're all true

pale vessel
#

you need to add a blank field but that would look bad on mobile

#

but if you still need to, you can add a new field with the name and value set to \u200b

#

add that field after the kik field and set it as inline

cursive laurel
#

So I've been wanting my bot to add a role via mentioning a user ID instead of @ mentioning them as well as mentioning them in the welcome message after granting them the role manually. However I've been encountering a lot of issues trying to get it working.

#

(I have a basic knowledge in javascript just to point it out)

green kestrel
#

personal comment for the day. i HATE reaction role pagers for help embeds. they never seem to work right, either you cant navigate across multiple pages because after one click of the ▢️ it then ignores other clicks, or theyre just plain broken. Theyre a usability nightmare, you may think theyre cute, but they suck. stop it.

#

the only thing worse is bots that delete their own help embed with a short timeout while youre still using them!

rocky hearth
#

My one function requires a return type of Promise<number>. How can I return a value say the number 12 like that? I'm using typescript

cinder patio
#
return new Promise<number>(resolve => {
     // code that gets the number somehow
     resolve(number);
});
rocky hearth
#

@cinder patio I don't know it says, its return type is Promise<unknown>

cinder patio
#

new Promise<number>(... sorry

rocky hearth
#

hmmm, thanks. It works

violet mesa
#

discord.py rewright

@bot.event
async def on_reaction_add(reaction, user):
    l = 0
    o = 0
    channel = reaction.message.channel
    if (reaction.emoji == ":white_check_mark:"):
        l += 1
    elif (reaction.emoji == ":x:"):
        o += 1
    if (l==5 and o != 5):
        await bot.send_message("the vote has ended and most of the people chose yes")
    if (0==5 and l != 5):
        await bot.send_message("the vote has ended and most of the people chose no")

why does this not work??

#

can anyone help

boreal depot
#

if (0==5 and l != 5):

#

my guess is the 0

placid iron
#

You are setting o and l to 0 every time

violet mesa
#

oh

#

oof

#

1 sec

#
async def on_reaction_add(reaction, user, l, o):

can i do this?

placid iron
#

No

violet mesa
#

how can i make it 0 once?

iron vine
#

@golden sinew

boreal depot
#

Are we just ignoring the fact that zero IS NOT equivalent to 5?

violet mesa
#

i changed it

#

alredy

boreal depot
#

Ok

violet mesa
#

thx

slender thistle
#

Alright

boreal depot
#

np

slender thistle
#

What the fuck

#

@violet mesa bot.send_message doesn't exist

#

And besides that, you didn't point to where you want the message to be sent

violet mesa
#

i watched a 2018 vid

#

lol

#

makes scense

slender thistle
#

Congrats, it's older than me

boreal depot
#

Didnt they change it?

slender thistle
#

Yes

boreal depot
#

idr what to since i deal with js more so

slender thistle
#

don't refer to random videos for d.py and use documentation instead

violet mesa
#

how can i send messages in events

#

then?

slender thistle
#

get a channel object, use its .send method

violet mesa
#

im stoopid no yell please

slender thistle
#

you have reaction.message.channel stored in channel var

#

Might wanna use that

violet mesa
#

ok

#

i do

#

i have that saved that as channel

slender thistle
#

aye

#

channel.send

violet mesa
#

1 sec

slender thistle
#

All messageable objects have a send method

#

users (members too), text channels

unreal blaze
#

I want to assign a role to a person who writes something like test in her special situation, for example.

#

how can i do it

violet mesa
#

will it now work @slender thistle

#

?

unreal blaze
#

c

earnest phoenix
#

should i try to host a botum on firebase

stable eagle
#

Can I make this somehow ignore special characters from roles?
Lets say, I have a role named: ++CoolGuy++;
I want my bot to ignore the pluses, and also accept the input without the pluses
is there a way to do that?

earnest phoenix
#

Can I make this somehow ignore special characters from roles?
Lets say, I have a role named: ++CoolGuy++;
I want my bot to ignore the pluses, and also accept the input without the pluses
is there a way to do that?
@stable eagle of course but it'll take EFFORT (smth that seperates noobs from true programmers)

slender thistle
#

@violet mesa try it and see

#

I'm not a Python interpreter

violet mesa
#

okie

regal mountain
#

How do I get an Client ID?

earnest phoenix
#

How do I get an Client ID?
@regal mountain Goto your application page on the Discord developer portal then on the main page click copy ID

#

@flat pelican decancer name

flat pelican
#

they have my name on... that

boreal depot
#

Pretty sure they meant all the extra stuff on your name

tight plinth
#

tf

pale vessel
#

eri-chan~

narrow cloak
#

If anybody know how to access my code to discord bot

severe timber
#

can someone pls help with my bot ill give 3 months nitro

narrow cloak
#

How to keep it online

severe timber
#

ok

#

@narrow cloak i do

#

know how to keep online

final path
#

can someone pls help with my bot ill give 3 months nitro
@severe timber I'll help!

severe timber
#

r u good?

final path
#

Yes.

severe timber
#

@final path

#

k

narrow cloak
#

@severe timber help man

final path
#

dm ne

severe timber
#

ill invie u to repl

final path
#

Okay!

narrow cloak
#

Any body help me

#

Anybody tell steps to create a bot and keep it in online

woeful pike
#

rent a vps and host it there

narrow cloak
#

@woeful pike ehat

#

Anybody tell steps to create a bot and keep it in online

woeful pike
#

the first step is to make the tiniest bit of effort to learn something on your own by researching

narrow cloak
#

Ok next

woeful pike
#

you've clearly not even passed the 1st step

narrow cloak
#

@woeful pike ok ok

obtuse niche
#

Hahahha

earnest phoenix
#

<% user.guilds.forEach(function(guild){

}); %> HELP SHΔ°TY V12

valid furnace
#

i keep getting errors at my first line of code i dont know why tho here is my code

Dconst discod= Reqire(β€œdiscod.sj)”

i am not sure why

summer torrent
#

@earnest phoenix read changelog

#

@valid furnace learn basic js first

earnest phoenix
#

raksiz

#

send error back

valid furnace
#

Lel

earnest phoenix
#

NMW knk bulabilsem :D

#

v11 de sorun olmuyordu

summer torrent
#

english

earnest phoenix
#

ok

summer torrent
earnest phoenix
#

raksix

#

you can talk tr in dm

zenith terrace
#

thats gotta be a joke....

valid furnace
#

It is lel

fickle sapphire
#

Discod

#

XD

valid furnace
#

Can u gift bots nitro lel

split hazel
#

no

green kestrel
#

bots already have like a half tank of nitro, so to speak

#

as they can globally use emojis

#

and use animated emojis

zenith terrace
#

smh imagine discord giving bots nitro permanently but not users

green kestrel
#

theres more to nitro than just global emojis

stoic sandal
#

How does top.gg get bot avatars and usernames?

green kestrel
#

through the discord api

stoic sandal
#

isnt there like rate limits?

green kestrel
#

of course

stoic sandal
#

Well but it requests alot tho

green kestrel
#

but like any smart developer, top.gg's devs respect rate limits and cache lots of info

amber widget
#

@hearty wren here

hearty wren
#

Thanks and sorry i posted in the wrong channel

amber widget
#

No worries

hearty wren
#

Guys i accidentally uploaded my bot on github and discord said they had reset the token so i generated a new one and replaced it and committed the changes and pushed it to heroku but now its offline, can anyone help?

slender thistle
#

See Heroku logs

hearty wren
#

Ok one sec

pale vessel
#

did you wait

earnest phoenix
#

did you turn it off then on again?

hearty wren
#

Yes i did too

green kestrel
#

so today you learned that tokens dont belong in your source code, they belong in a separate config file or an environment varaible? πŸ˜„

#

also, .gitignore.

slender thistle
#

Tbh

#

just use environment variables

earnest phoenix
#

i remember someone told me that a config.json is deprecated

#

idk wtf that meant

slender thistle
#

same

hearty wren
#

I also learned about workspaces in vs code

earnest phoenix
#

amazing

green kestrel
#

i use a .json config file, which is in my gitignore.... i have too much config to be manageable in environment variables

hearty wren
#

I didnt even wanna push it on github

green kestrel
#

api keys for a whole bunch of apis, two discord bot tokens, a list of server ids...

earnest phoenix
#

bruh two tokens for what

#

explain

green kestrel
#

a live bot token and a dev bot token

earnest phoenix
#

oh makes sense

green kestrel
#

if i run my bot as ./bot -dev it uses the dev token, otherwise the live

zenith terrace
#

what if I do client.login twice mmLul

earnest phoenix
#

but i have my dev bot in a different workspace

zenith terrace
#

with 2 diff tokens

hearty wren
#

I was pushing sth else to my repo that happened to be in the same directory as my bot folder so vs code initialized git for the whole directory including both folders

earnest phoenix
#

so i don't fuck up

green kestrel
#

i sometimes use my live token in my dev environment, in something i call 'test mode'

hearty wren
#

I made a new heroku application and pushed the bot and no errors and logs r perfect but its still offline

green kestrel
#

test mode is live token, with a setting from the commandline flags that makes the bot ignore commands on all but a predefined test server

#

that way i can test to check the code scales, with thousands of servers, without the bot emitting two of everything

#

that sort of thing is really worth it btw

earnest phoenix
#

bruh someone sent me a voice mail but i can't even check it because i got no credit

green kestrel
#

just be careful if you do it, that you dont do anything that loops and disables your live token πŸ˜„

#

wait, you pay to retrieve voicemail? what backwards-ass country is that

earnest phoenix
#

UK lol

green kestrel
#

next thing youll tell me you pay to receive sms, like americans do lul

earnest phoenix
#

unless it's my sim provider

green kestrel
#

time to change provider? O2 doesnt charge me to listen to voice mail

earnest phoenix
#

vodafone are decent

#

but o well

green kestrel
#

vodafone have the signal strength of a one armed man doing smoke signals at night here

#

and then theres three... well theyre a joke everywhere

earnest phoenix
#

my signal strength is so bad

green kestrel
#

ive not used voda since the early 2000's, they were pants back then

earnest phoenix
#

imma just not change my sim provider

#

don't really care about a voice note

hearty wren
#

guys i fixed it and working now sorry to bother you

earnest phoenix
#

nice

hearty wren
#

i forgot to add config vars to it on heroku it seems

silent cloud
#

Yo guys

#

Can somebody help

#

What is wrong here?

#

const ytdl = require("ytdl-core");

earnest phoenix
#

uhh what

#

is there an error

silent cloud
#

Yep

#

I comment this string and no error

earnest phoenix
#

wdym

#

what's the error

silent cloud
#

it package.json

#

"ytdl-core": "^3.2.2"

#

what's the error
@earnest phoenix idk, wait i check

#

WTFFFFF

#

the problem disappeared on its own

fickle sapphire
#

with 2 diff tokens
@zenith terrace Would it change to the other user?

zenith terrace
#

yes it did

#

I tried 2 bot.logins, it used the 2nd one

slender thistle
#

Wouldn't it run both

fickle sapphire
#

But if you put it like inside a command to switch to a other user..

cinder patio
#

It used the second one because you login via the same Client instance. Create 2 instances and login with each one of them and both of the bots will be online

feral aspen
#

Can somebody explain how there are bots like having discriminators like 2222 or 0009

#

like WHAT

#

@earnest phoenix

slender thistle
#

Randomness is on their side

#

or straight up creating hundreds of bot accounts until they get a cool one

feral aspen
#

Bruh

#

πŸ˜‚

#

Wait are you the shivaco mod?

slender thistle
#

which isn't tolerated by Discord afaik

#

not for a while

feral aspen
#

Are you the mod shivaco?

slender thistle
#

it's a mod-on-break shivaco, get it right smh GWahreeSure

obtuse niche