#development

1 messages · Page 1443 of 1

earnest phoenix
#

I mean

#

you dont return anything in helpcmd

#

what is weird about that

#

lol

#

you send your message in helpcmd

#

the function has no return value

cunning oxide
#

oh

#

there i go

#

being a dipshit

#

ok

young flame
#

this tbh

cunning oxide
#

fixed it

#

thanks lol

young flame
#

next time

#

just debug it

gilded olive
#

11$ for a custom prefix PepeLaughers

cunning oxide
#

yeah i spent some time on it just needed another set of eyes

young flame
#

back to ticket panel

#

await reactions be like moon_dance

feral aspen
earnest phoenix
#

🗿 But the return keyword on that function should not have mattered

young flame
#

im banned from mee6 support

#

idk why lol

earnest phoenix
#

It would still send the message

young flame
#

i dont even use it

gilded olive
young flame
#

nor did i join there support server

earnest phoenix
#

discord favours mee6 so much over other bots it's insane

young flame
#

idk why

feral aspen
cunning oxide
#

voltrex

earnest phoenix
#

Dank Memer and MEE6 are too overrated

umbral zealot
#

It was the first big bot so it's older and more established. Makes sense.

cunning oxide
#

it still does send the msg

#

which is why im now confused

young flame
#

👀

earnest phoenix
#

Weren't mee6 older than dyno?

gilded olive
umbral zealot
#

sounds like a for loop

earnest phoenix
#

Define, condition, increment

gilded olive
young flame
young flame
earnest phoenix
#

all monopoly bots suck ass

gilded olive
#

downtime brrrrrr

earnest phoenix
young flame
#

atleast most of its features arent locked behind a 100 dollar paywall smh

gilded olive
#

probably why its so slow

young flame
earnest phoenix
#

Mee6 also have a voice recording feature in voice channel, i have no idea how they managed to do that

#

lmfao

gilded olive
#

is that not TOS

earnest phoenix
#

i was using it as an adjective

earnest phoenix
#

monopoly as in, bots that control the game

sudden geyser
gilded olive
#

yes

sudden geyser
#

oh god

young flame
#

lmao bruh what

#

@spice willow suar

slender thistle
#

Is this development content

young flame
#

i love that nickname lol

earnest phoenix
young flame
#

dynosuaR

earnest phoenix
young flame
#

dinonuggie dynos kids rn

earnest phoenix
#

bots can do voice receive, but video data is not sent to bots at ll

#

at all*

#

Pretty sure it's because they can't stream

young flame
earnest phoenix
#

bots can send video data though 👀

#

but its choppy

quartz kindle
#

isnt the video data ignored by discord tho?

earnest phoenix
#

everyone thought so but the desktop client straight up receives video data from bots

#

mobile ignores it

#

but its a mess in general because there's one crucial opcode that bots can't use

#

so you're stuck with a dumpster fire

quartz kindle
#

lmao

gilded olive
#

patreon api allows that if you setup it up I believe (may be wrong)

earnest phoenix
#

thisisfine This is fine

gilded olive
#

@long marsh btw we found a way to minimize the large amounts of requests that are being checked/made

#

peepoSnow websockects + logic

quartz kindle
#

websockects

crimson vapor
#

Tim could you help me with nginx?

slender gulch
#

I have a button in my bot html page, but there's an underline.```html
<a href="MY-INVITE" target="_blank" class="btn success">Support Server</a>

quartz kindle
#

css

obtuse jolt
#

yes

quartz kindle
#

text-decoration: none

slender gulch
#

ok

#

ty

obtuse jolt
#

specifically

text-decoration: none;```
slender gulch
#
font: 'times-new-roman';
#

would this be a valid font? confuseddoggo

#

i don't know because my browser's default font is that

cunning oxide
#

Has all the answers you’d want

slender gulch
#

mmm ok thanks

quartz kindle
#

the correct way would be font-family: 'Times New Roman'

drifting wedge
#

gives error when adidng to bot

#

Extension 'cogs.quest.freewalk_txt.floor.entrance' raised an error: ModuleNotFoundError: No module named 'generation'

#

its a file

#

not a module

#

and i have it working normally

#

py

young flame
#

@crimson vapor how do you like

#

make the bot react to its own message

crimson vapor
#

djs?

drifting wedge
#

py

young flame
#

ues

#

djs

crimson vapor
#
let message = await message.channel.send('any message doesnt matter')
await message.react(":tm:") // might want to catch this in case no perms
young flame
#

o

#

ok brb

gilded olive
#

if this is a local file you'd probably want .

crimson vapor
#

error or no response

crimson vapor
#

Thomas would you like to read my json db code

gilded olive
earnest phoenix
#

Yo guys i have a problem i used this command but when someone send a message, i receive nothing, at the second message it send 1 message, the 3rd message i receive 2 message on the console log...
please can you help me.

drifting wedge
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: FileNotFoundError: [Errno 2] No such file or directory: 'entrance.PNG' i have this file in the folder py

hollow sedge
#

@drifting wedge can you show where it breaks and the files

drifting wedge
#

like the code?

hollow sedge
#

yes

drifting wedge
#

entrance = Image.open('entrance.PNG').convert('RGBA')

#

it works

#

but when i implemented discord

#

it borke

hollow sedge
#

so you mean it broke when you added it to your bot?

#

and worked when you ran it as its own file?

drifting wedge
#

yes

hollow sedge
#

ok so im pretty sure this is another case of where the file you are actually running, is

#

all paths are relative to that

drifting wedge
#

well the files are relative to the file im getting the files from ye?

gilded olive
#

the way you have it right now

hollow sedge
#

the paths are relative to main.py or bot.py

drifting wedge
#

the files are in the same ifle as the place where im doing the pulling image

gilded olive
#

it will look for that image in the root directory

drifting wedge
#

main

hollow sedge
#

whichever file you are running

drifting wedge
#

well im running bot

#

ok 1 sec

#

lemme give example

gilded olive
#

/folder1/image.png

hollow sedge
#

so image.png is in the same folder as bot.py?

#

so i think the path would just be image.png

gilded olive
#

shrug, it looks like from that structure it is in folder1, might be in the root who knows

drifting wedge
#

worked poggers

gilded olive
#

:)

hollow sedge
#

nice

hollow sedge
#

nice

crimson vapor
#

nice

gilded olive
drifting wedge
#

bot stops and gives this error: aiohttp.client_exceptions.ClientOSError: [Errno 104] Connection reset by peer it restarts but ive tried googling it and didnt understand awnsers

#

py btw

hollow sedge
#

check your synchronous processes

#

do any of them take a long time

drifting wedge
#

maybe why?

#

prob not

#

rn the bot is running super light

hollow sedge
#

Discord closed your connection

drifting wedge
#

hmmm

hollow sedge
#

so...

#

maybe check if you have code that runs forever

drifting wedge
#

aight

rustic nova
#

debug lines are your goal

fair pasture
#

it should work

earnest phoenix
#

if(message.content){
console.log(message.author.username + " a envoyé " + message.content + " dans " + message.guild.name);
}

earnest phoenix
fair pasture
#

show me your full message

#

and are you french?

earnest phoenix
crimson vapor
#

not sus code

fair pasture
#

Nice

#

Either ways why are you willing to log every message?

earnest phoenix
#

i'm just trying to learn

misty sigil
#

yea, why?

#

I don’t think that’s allowed.

earnest phoenix
#

i'm testing all the commands

crimson vapor
#

its smol bot so probably just trying to figure shit out

earnest phoenix
opal plank
# earnest phoenix i don't care its just to test and learn

just a fair reminder.
Bots that log shit need to have a disclaimer or arent compliant to TOS
Bots that store data that isnt encrypted are against TOS
Logging is technically caching, and not storing, but keep that in mind while you make a bot.
Making a private bot to test is fine, but i see you also have a public bot https://top.gg/bot/771367546636206100 which you shouldnt be using for this kind of testing since it doesnt follow the previously mentioned issues

crimson vapor
#

what is considered data?

#

like user IDS

#

or what

hollow sedge
#

I think it's more like messages

crimson vapor
#

ok

opal plank
#

no, ids are provided by discord

#

any user data content stored needs to be encrypted and disclaimed in your bot

hollow sedge
#

Tbf most bots probably have no need for this

opal plank
#

if there needs be i can go fetch for the sorces, but this is the gist

Jake a discord staff has mentioned before bots breaking tos for logging or storing stuff without users consent with an example that goes by the following if your bot is a music bot, and you are storing message without telling the users, we have an issue with it

User data is simply anything typed by the user
their username
Channels names
guild names
content of messages

what ISNT user data
message ids
channel ids
guilds ids
timestamps

crimson vapor
#

ok

fair pasture
#

so if i do

#

in my embeds

opal plank
#

its basically everything thats generated by discord, ids and all that

fair pasture
#

.setTimestamps is against tos

opal plank
#

wrong

#

its your message

fair pasture
#

Cause i basically have a messageDelete logging is that fine?

opal plank
#

timestamps should fall under rest, not user data

#

does your bot state it does that?

hollow sedge
#

Also erwin just said it's not considered user data anyway

fair pasture
#

and I have an update command which also mentions it

opal plank
#

if you state and you STORING it(not just sending on another channel, storing in a database or persistent sotrage) its fine

hollow sedge
#

I'm pretty sure you have to ask them for consent, not simply tell them

solemn latch
#

Youd want to provde that in your privacy policy

opal plank
#

caching doesnt fall under storing and does not need encryption iirc

solemn latch
#

which is also a requirement of discord bots now.

hollow sedge
#

Wait what

opal plank
#

caching is a grey zone

#

which console.log() falls under

#

its not persistent storage

hollow sedge
#

That's pretty inconsistent

opal plank
#

theres a big ass text saying being a dev grants you some special debugging priviledges

hollow sedge
#

You could still see all of their messages

opal plank
#

if you are getting logs for debugging its fine

#

if you just straight up spying on peoples chat, thats an issue

#

it goes a lot along with common sense tbh

hollow sedge
#

I guess

solemn latch
#

the easiest way is asking yourself if a user reasonably expects you to do something.

opal plank
#

disclaimer doesnt need to be anything big either, somethign as simple as this works

#

a link to support, what your bot stores persistently, and how you can request deletion

#

thats about all you need

slim umbra
#

no

sterile lantern
#

if I created a db table “user items” then db.all’d the data in the table, sorted it for the specific users item, then printed in a embed description, would it print as:
[“item1”, “item2”]

if it does, how would I split it so it goes
Item1 \nitem2

outer zenith
#

damm

#

switching from txt files to sql is really reducing my code length

#

and efficiency

misty sigil
#

arr.join("\n")

misty sigil
#

how did you store data in txt files

outer zenith
#

lmao

blazing portal
#

txt files? I want to scratch my eyes out

outer zenith
#

using tab spacing

#

yea

#

it was painful

misty sigil
outer zenith
#

so many open files

#

is sqlite3 really inefficent at the level of thousands of servers?

solemn latch
#

pretty sure any db will be fine in thousands of small to medium servers.

misty sigil
#

mongo with caching would really be your best bet for scaling imo

#

or just any db with caching

#

really

sudden geyser
outer zenith
#

ah

#

how much writing is a problem

#

cause im using it a lot for leveling prob

#

and on command for warnings

misty sigil
#

I’d rather keep my levelling system in cache

#

and write changes every minute or so

outer zenith
#

cache?

#

well

misty sigil
#

a map or something

solemn latch
#

if your doing leveling, or limiting the xp rate

cerulean ingot
#

could i pay someone to put ssl on my panel and node
because idk how to do it :(
and i dont want to annoy you guys

#

or is there a tutorial

misty sigil
#

just slap cloud flare on it

outer zenith
#

ahhhh

#

so basically

#

what ur saying matthew

#

is keep it in local memory

misty sigil
#

yea

cerulean ingot
outer zenith
#

and then download it when u shut it off

misty sigil
misty sigil
#

just store it for a bit and write every few seconds

outer zenith
#

but then when

#

ah

cerulean ingot
#

oh yeah

#

im using something called the pterodactyl panel

outer zenith
#

im using a plugin system

#

for most of my commands

#

so u just used a constant loop

#

and asyncio

#

to write it every so often

lucid prawn
crimson vapor
#

whats the best way to try to corrupt a json

#

process.exit(), ctrl c?

#

any better ways

solemn latch
#

read it as a string and write some random chars.

crimson vapor
#

well I am writing as json always 100%

#

thats out of the question

blazing portal
#

JSON.corrupt(); 😛

lucid prawn
astral yoke
#

anyone familiar with 'discord.js-collector' npm package

#

because im getting an error with it

solemn latch
#

whats the package do? 🤔

hollow sedge
#

its probably unnecessary

#

well i guess all packages are

#

its probably something that could be easily made in discord.js though

solemn latch
#

but like, it sounds like it does exactly what a message collector does.

hollow sedge
#

but think about it

#

instead of making two calls

#

you make one

lucid prawn
hollow sedge
#

that then calls two things

solemn latch
#

message collectors are one line though

hollow sedge
#

oh lol

#

wth is the point in that then

solemn latch
#

channel.awaitMessages(filter, callback);

lucid prawn
#

?

rustic nova
#

look, if you're asking for support, don't set your pastebin to burn

solemn latch
# lucid prawn ?

codes kindof a mess, super hard to read, which makes it hard to help.

rustic nova
#

doesn't really help anything

solemn latch
#

was also 1000 lines of code he pasted in it 🤔

lucid prawn
#

u mean he/her

blazing portal
#

he/her/it if we're going this route

lucid prawn
#

nvm

crimson vapor
#

alright Woo

#

question for ya

#

[].push('value')

#

this returned 1

#

is that because 1 is the status or something?

hollow sedge
#

what are you expecting to be returned from that?

crimson vapor
#

the array is what I expected

solemn latch
#

push returns the length of the array

crimson vapor
#

oh

#

that makes sense

hollow sedge
#

why would it return the array

crimson vapor
#

ty

hollow sedge
#

you already know what the array is

solemn latch
#

it modifies the array you use it on

#

actually no idea why push returns the new length, but whatever

crimson vapor
#

ended up just defining the variable to an empty array and pushing it next

hollow sedge
#

why are you pushing to an empty array

solemn latch
#

is there a reason you need to push

#

yeah

#

["value"]
will give you an array with value

crimson vapor
#

ig I could just make an array with the 1 value

hollow sedge
#

wait

#

but why cant you just assign it to a variable

#

i mean it already is a variable

solemn latch
#

sometimes arrays are needed, since we dont know the context, 🤷‍♂️

lucid prawn
#

@solemn latch if u find the problem ping me

crimson vapor
#

no I mean im making a function that adds a value to an array

#

if the array is undefined it makes a new one

hollow sedge
#

oh..

#

but why

crimson vapor
#

also

#

can I use logical operators without defining a variable?

#

I mean I can but should I?

solemn latch
#

i cant look through 1000 lines of code for that error, if you can make one with a minimum code to replicate the error, and the full error i can probably help more.

hollow sedge
#

lol

#

arent you his personal code analyzer

crimson vapor
#

^

sacred palm
#

can anyone help me please to integrate Creating webhooks with discord.js

channel.createWebhook('Some-username', {
    avatar: 'https://i.imgur.com/wSTFkRM.png',
})
    .then(webhook => console.log(`Created webhook ${webhook}`))
    .catch(console.error);
crimson vapor
#

thats what I thought

solemn latch
#

does that code example not work @sacred palm

sacred palm
#

well, i try to integrate it into my code, in a existing command

#

but i can`t get it work at all

#

my head hurts bad

#

😦

solemn latch
#

any error?

sacred palm
#
const channel = client.channels.cache.get('222197033908436994');
    try {
        const webhooks = await channel.fetchWebhooks();
        const webhook = webhooks.first();

        await webhook.send('Webhook test', {
            username: 'some-username',
            avatarURL: 'https://i.imgur.com/wSTFkRM.png',
            embeds: [embed],
        });
    } catch (error) {
        console.error('Error trying to send: ', error);
    }
#

used this to send webhook in chat

crimson vapor
#

hmmm

#

looks like my node is using 4gb of memory

sacred palm
#

and i get this error

ReferenceError: channel is not defined
blazing portal
#

well that error is pretty self explanatory, isnt it?

sacred palm
#

well, i want the bot to create webbook in any channel, where cmd is used, not in specific channel

blazing portal
#

then you'll have the channel in the message.channel property (maybe you'll need to fetch it first though)

sacred palm
#
const webhook = require("webhook-discord");
const Discord = require('discord.js');

channel.createWebhook('Some-username', {
    avatar: 'https://i.imgur.com/wSTFkRM.png',
})
    .then(webhook => console.log(`Created webhook ${webhook}`))
    .catch(console.error);
        
module.exports.run = async (bot, message, args) => {
    //message.delete().catch(err => {})
    
    const channel = message.channel;
    try {
        const webhooks = await channel.fetchWebhooks();
        const webhook = webhooks.first();

        await webhook.send('Webhook test', {
            username: 'some-username',
            avatarURL: 'https://i.imgur.com/wSTFkRM.png',
            embeds: [embed],
        });
    } catch (error) {
        console.error('Error trying to send: ', error);
    } 
};


module.exports.config = {
name: "clap",
aliases: [""]
}
#

i don`t get it

blazing portal
#

I assume you still get the error channel is not defined?

sacred palm
#

yes

blazing portal
#

well you use channel.createWebhook. And then a few lines later you define channel

sacred palm
#

okkk

#

i have some progress

#

now message.channel is not working

#

message is not defined

#

damn is hard

blazing portal
#

how is your code looking rn?

sacred palm
#
const webhook = require("webhook-discord");
const Discord = require('discord.js');
const channel = message.channel;
    
channel.createWebhook('Some-username', {
    avatar: 'https://i.imgur.com/wSTFkRM.png',
})
    .then(webhook => console.log(`Created webhook ${webhook}`))
    .catch(console.error);    
    
module.exports.run = async (bot, message, args) => {
    //message.delete().catch(err => {})

    
    try {
        const webhooks = await channel.fetchWebhooks();
        const webhook = webhooks.first();

        await webhook.send('Webhook test', {
            username: 'some-username',
            avatarURL: 'https://i.imgur.com/wSTFkRM.png',
            embeds: [embed],
        });
    } catch (error) {
        console.error('Error trying to send: ', error);
    } 
};


module.exports.config = {
name: "clap",
aliases: [""]
}
solemn latch
#

the issue is scope, your channel, and message channel is outside the run export.

sacred palm
#

ok makes sense

#

at least the bot started now

#

but still i did not used correctly message.channel

#

oh damn

#

i think i got it

#

one sec

opal plank
#

i finally did it

#

69 million presences parsed

lucid prawn
#

@solemn latch when i use my code on my test bot it work for member
😕

sacred palm
#

okkk many thanks @solemn latch @blazing portal i finally got it to work with your help

#

but, there is always a but

#

if i don`t want the bot to create a webhook for every command used

#

i need to integrate also webhook.edit

webhook.edit({
    name: 'Some-username',
    avatar: 'https://i.imgur.com/wSTFkRM.png',
    channel: '222197033908436994',
})
    .then(webhook => console.log(`Edited webhook ${webhook}`))
    .catch(console.error);
#

i simply add this line after createwebhook ?

solemn latch
#

you should probably be checking if the webhook Some-username exists, or have a create webhook command.

sacred palm
#
channel.webhook.edit({
    name: 'Pookie',
    avatar: 'https://cdn.discordapp.com/attachments/711291970303295519/786747602258362429/pantmusic2.png',
})
    .then(webhook => console.log(`Edited webhook ${webhook}`))
    .catch(console.error);    
    
channel.createWebhook('Pookie', {
    avatar: 'https://cdn.discordapp.com/attachments/711291970303295519/786747602258362429/pantmusic2.png',
})
    .then(webhook => console.log(`Created webhook ${webhook}`))
    .catch(console.error);
#

stuck on this

solemn latch
#

channel.webhook doesnt exist afaik

sacred palm
#
if(channel.webhook("Pookie") == 1){
channel.webhook.edit({
    name: 'Pookie',
    avatar: 'https://cdn.discordapp.com/attachments/711291970303295519/786747602258362429/pantmusic2.png',
})
    .then(webhook => console.log(`Edited webhook ${webhook}`))
    .catch(console.error);    
}
    else{
channel.createWebhook('Pookie', {
    avatar: 'https://cdn.discordapp.com/attachments/711291970303295519/786747602258362429/pantmusic2.png',
})
    .then(webhook => console.log(`Created webhook ${webhook}`))
    .catch(console.error);
    }
solemn latch
#

do you have the docs on channel.webhook? i dont see that property(or method, since you use both in your example)

sacred palm
#

(node:23455) UnhandledPromiseRejectionWarning: TypeError: channel.webhook is not a function

#

damn

solemn latch
#

yeah, you cant just make up methods or properties.

sacred palm
#

am i rude if i ask for more help on this ? 😦

solemn latch
#

idm, watching someone play cyberpunk

sacred palm
#

i saw earlier that game added to torrent site and in 10mins got over 2000 downloads

solemn latch
#

well the developer of the game is their own publisher, and they often dont add drm.

sacred palm
#

in like 1 hour got 12.655 downloads

#

lol

#

from torrent

lucid prawn
sacred palm
#

Actual Code:

if(channel.webhook("Pookie") == 1){
channel.webhook.edit({
    name: 'Pookie',
    avatar: 'https://cdn.discordapp.com/attachments/711291970303295519/786747602258362429/pantmusic2.png',
})
    .then(webhook => console.log(`Edited webhook ${webhook}`))
    .catch(console.error);    
}
    else{
channel.createWebhook('Pookie', {
    avatar: 'https://cdn.discordapp.com/attachments/711291970303295519/786747602258362429/pantmusic2.png',
})
    .then(webhook => console.log(`Created webhook ${webhook}`))
    .catch(console.error);
    }

Error:

(node:23455) UnhandledPromiseRejectionWarning: TypeError: channel.webhook is not a function
solemn latch
#

yeah, channel.webhook doesnt exist

#

you cant make methods up

sacred palm
#

and how can i check for existing webhooks ?

hollow sedge
solemn latch
sacred palm
hollow sedge
#

Oh good

#

Probably won't stay that way too

sacred palm
#

it s like GTA V, after many years, cracked version still works only offline

#

story mode

#

because the game is on their servers

hollow sedge
#

Yeah

sacred palm
#

even for FiveM you need rockstar license

hollow sedge
#

They'll probably patch it too

#

How did it get cracked before release though

#

Nvm it got released today

sacred palm
#
  • Extract
  • Burn or mount the.iso
  • Run setup.exe and install
  • Copy crack from CODEX dir to installdir
  • Play

General Notes:
-Block the game's exe in your firewall to prevent the game from trying to go online ..

hollow sedge
#

God

solemn latch
#

probably not a good idea to discuss this stuff in this server KEKW

hollow sedge
#

That's insanely easy

solemn latch
#

or atleast to this extent

hollow sedge
#

True

sacred palm
#

right, returning to my code

#

can you please help me implement that fetchWebhooks() to my code ?

#

i don`t understand how fetch works

#

😦

#
if(channel.webhook("Pookie") == 1){
channel.webhook.edit({
    name: 'Pookie',
    avatar: 'https://cdn.discordapp.com/attachments/711291970303295519/786747602258362429/pantmusic2.png',
})
    .then(webhook => console.log(`Edited webhook ${webhook}`))
    .catch(console.error);    
}
    else{
channel.createWebhook('Pookie', {
    avatar: 'https://cdn.discordapp.com/attachments/711291970303295519/786747602258362429/pantmusic2.png',
})
    .then(webhook => console.log(`Created webhook ${webhook}`))
    .catch(console.error);
    }

this is how it looks now and i don`t understand how and where i should add fetch

#

i understand that i have to remove if and else

#

but where fetch goes

solemn latch
#

well, before using the webhooks at all

sacred palm
#

but youll probably also want to keep track of it in cache or in a db.

#

and how i can add in cache ?

#

is a bit difficult i think to implement db now

solemn latch
#

db's are pretty simple, hardest part is choosing which one to use.

sacred palm
#

is simple for you maybe

solemn latch
#

caching it would also be pretty simple since fetch gives you a collection already

crimson vapor
#

json go brrrrrr

sacred palm
#

i never used db with discord.js

crimson vapor
#

don't use a json db

ember crystal
#

$nomention
$allowMention

$argsCheck[>1;Please mention someone to kill!]

$color[$randomText[65280;16711680;C8C864;47eabc;df2e90;543683;264bec;d20057;515e63;497147;376034;087264;4ca6ff;460a18;faebd7;eed330;cb4bca;fffff2;fffc3c;b507db;ff8d00;00ff38;ff00e7;98bdf0;daf7f8;b9e0d9;debcb0;ffb3b3;b8d9d0;83d0f2;552f2e;fff380;0000ff;ff4d00;afb169;afaf0a;ffffff;c7ae71;a77c86;17264f;cbffe8;c7bbc9;debcb0;010649;feebe6]]

$title[Death]

$description[$message died from $randomText[Coronavirus;Ebola;not consuming enough juicy memes;AIDS;their mom shooting them;the thought of LGBTQ;Donald Trump].]

crimson vapor
#

what the fuck is this language

ember crystal
#

that’s codes

#

i code on mobile

#

that’s why

crimson vapor
#

language

#

you can code regular code on mobile

sacred palm
#

so, @solemn latch i still need an if function to search for webhooks after fetch ?

solemn latch
#

yeah, id look at the collections docs to see the kinds of methods you can use.

zenith terrace
#

Imagine having one of the deaths as "the thought of LGBTQ"

#

Not cool

earnest phoenix
#

are you implying they have any braincells to comprehend that

#

haha yes LGBTQ funy XDDD aids FUNNY XDDDDDDDDDD

sacred palm
#

@solemn latch i'm done for today, i'm happy that i got it to work finally, maybe tomorrow i'll get it done with fetch and search for existing webhooks.

Many many thanks for all your help!

#

this is basically what i wanted

earnest phoenix
#

oh cool

#

i didnt know webhooks could use custom emojis

sacred palm
#

😄

#

also animated emoji

#

and if i also use message.delete it`s almost like you've send emoji

errant hornet
#

So I am fetching data from my database, but I want to get the data that is saved to the user id, so I am wanting to do response.data[key].users then the user id to get it but I am unsure on how to do that. I tried doing it in [] but it didn't work. Here is the code below.

userid = message.author.id
await axios.get(`${client.config.firebase_url}/guilds/${message.guild.id}/medals.json`).then(function (response) {
        for (var key in response.data){
              infoEmbed.setDescription(
                `${progress_bar} **${percentage}%**\n\n${topHeader}\n\n${remaining_info}\n\n**Medals:**`
              )
              for (var key in response.data){
                if (response.data.hasOwnProperty(key)) {
                  if (response.data.errors == null) {
                    infoEmbed.addField(response.data[key].emoji + " **" + response.data[key].name + "**", `Awarded by <@!${response.data[key].users[userid].awarded}>`)
                  }
                }
              }
        }
      })   ```
crimson vapor
#

wait firebase is http based?

astral yoke
#

anyone know why this let option = bot.db.get(`ticketname_${reaction.message.guild.id}`) if(option === null) option === `{user.username}s-ticket` let msg = option.replace(`{user.username}`, user.username) && option.replace(`{count}`, count) sets the channel name as user.usernames-ticket instead of replacing it? even though it has no errors?, option is defined as '{user.username}s-ticket'

astral yoke
#

at what?

opal plank
#

a $

astral yoke
#

where

#

in the code

opal plank
#

dont replace stuff

#

template literals*

#

here, read that

astral yoke
#

ive never heard of that

opal plank
#

then you should, this is basic javascript syntax

outer zenith
#

what are web hooks used for again

analog imp
#

any recommendations for going about creating a new array for elements returned in a for loop? all keys are the same, values are different

#
                fs.readdir('commands/admin/', (err, files) => {
                    if (err) console.log(err);
                    const file = files.filter(f => f.split('.').pop() === 'js');
                    if (file.length <= 0) {
                        return;
                    }
                
                    file.forEach(async(f, i) => {
                        const pull = require(`../admin/${f}`);
                       /*  if (i+1 > 6) {
                        return;
                        } */
                        const x = [(i+1)+' '+pull.mod.name+' '+pull.mod.description]
                        console.log(x)
timber cloak
#

What's .bot-img{ called now? These new css whatevers are confusing me

analog imp
zenith terrace
#

@timber cloak I found this class="entity-header__image"

outer zenith
#

thx

analog imp
#

np

zenith terrace
#

so entity-header_image I guess

analog imp
#

solved my question. not efficient at all but gets the job done

errant hornet
proven lantern
#

are all discord ids 18 digits long?

#

.match(/[\d]{18}/)

outer zenith
#

they are all the same length

#

idk abt 18 specifically

#

but if u counted one as 18 they are all 18

proven lantern
#

counting is too hard

bright flame
#

Hey guyz can u tell me how to use heroku as a host for my discord bot which is in js. It will be appreciated

sudden geyser
outer zenith
bright flame
#

ya tell me

outer zenith
#

so did u download heroku cli

#

(are u using the free trial?)

bright flame
#

i have not paid anything

outer zenith
#

ok so just a warning

#

if you run ur bot 24/7

#

it will not make it through a month

bright flame
outer zenith
#

23 days a month

bright flame
outer zenith
#

yea

#

but once thats off the table

#

i have one more question

#

are you writing/reading to any external files

#

with ur bot

bright flame
#

u mean resources?

#

i have a bot in java which wants to have lyrics

#

from internet

outer zenith
#

no like files

#

like read/write to local txts

#

or dbs

#

cause herokus file system is ephmermal

bright flame
outer zenith
#

java?

#

wait what are u doing in java

#

nvm

#

but ok do u got the cli?

bright flame
#

ya

outer zenith
#

now go to the heroku website

#

click create new app

#

put in a name

#

and create ur app

#

should look somethin like this

bright flame
#

ya doing it

outer zenith
#

ok tell me when u created it

#

dont add to pipeline or anything

bright flame
#

ya sure

hollow sedge
bright flame
#

it is asking for bank details

#

@outer zenith

outer zenith
#

bank?

outer zenith
bright flame
#

ya

outer zenith
#

free is 550

hollow sedge
#

No

#

If you enter your credit card info

#

They give you more hours

outer zenith
#

...

#

...

#

at first

#

its one of those free trials

hollow sedge
#

No

outer zenith
#

its not gonna last infintely

bright flame
#

see this

hollow sedge
#

I still have it

#

It's not only at first

outer zenith
hollow sedge
#

"Personal accounts are given a base of 550 free dyno hours each month. In addition to these base hours, accounts which verify with a credit card will receive an additional 450 hours added to the monthly free dyno quota. This means you can receive a total of 1000 free dyno hours per month, if you verify your account with a credit card."

outer zenith
#

this is what i got

#

ok?

#

im not giving away my credit card info lol

hollow sedge
#

Yeah like heroku is going to do anything with it

outer zenith
#

better safe than sorry

#

the less places that have ur credit card

proven lantern
outer zenith
#

the less likely its gonna be leaked in a hack

bright flame
#

i have a prepaid card which has nthing in it

#

shall i use it

#

here

outer zenith
#

u can

#

but im pretty sure u dont have to

hollow sedge
#

Yeah, Salesforce is going to get hacked

#

That ain't happening

earnest phoenix
#

what they're trying to say is that mommy doesn't want to give her cc

outer zenith
#

?

#

i have my own cc u know

#

but what ever

#

@bright flame when ur done with doing what ever and created the app tell me

bright flame
#

hey i have some of the apps already there

#

see

#

can i remove them]

outer zenith
#

you can

#

doesnt matter

#

really

#

but if u want to u can

bright flame
#

ohk then leave if it dont matter

#

created the app

#

@outer zenith

outer zenith
#

then go to cmd

bright flame
#

ohk

outer zenith
#

and cd to the file ur in

#

ur bot is in*

bright flame
#

ohk

outer zenith
#

did u do that?

bright flame
#

ya done

outer zenith
#

then run the command

#

heroku login

hollow sedge
timber cloak
#

What's .bot-img{ called now? These new css whatevers are confusing me

hollow sedge
#

Heroku isn't even meant for discord bots

outer zenith
#

yea but its commonly used

#

did u log in?

proven lantern
#

it will be bork

#

heroku does tricky things

bright flame
hollow sedge
#

Heroku is for web apps

outer zenith
#

then run

#

echo>Procfile

bright flame
#

is this a command?

hollow sedge
#

Also why are you taking them step by step

#

I'm sure there are resources on this

outer zenith
#

yes

#

where

bright flame
#

ya i did but nthing executed

outer zenith
#

yea it did

#

now go to ur file browse

#

and open up the procfile

#

in notepad++/notepad

bright flame
outer zenith
#

sure whatever

#

hes js

#

btw

hollow sedge
bright flame
#

ya opened but the file is empty

outer zenith
#

ok

#
  1. worker: node [filename]
#

type this

bright flame
#
  1. too?
outer zenith
#

no

#

worker: node [filename]

#

where file name is the name of ur bot

hollow sedge
#

Dude

#

Look at the link I sent

#

You don't need to tell them every single thing to do

bright flame
#

shall i give that file name extension

outer zenith
#

no

#

for example

#

worker: node bot.js

bright flame
#

ya done

outer zenith
#
  1. setup requirements.txt
  2. cmd command : git init
  3. cmd command : heroku git:remote -a [heroku app name]
  4. cmd command : git add .
  5. cmd command : git commit -am "[some random message between quotes]"
  6. cmd command : git push heroku master
  7. go to dynos in heroku and turn on the bot
bright flame
#

setup requirements.txt whats this

outer zenith
#

requirements.txt

#

is a file

#

with all the packages u need

#

so for example

#

discord.js would be one of them

#

so u just type up all the requirements in a txt file

hollow sedge
#

Nooo

#

You don't normally manually type those

#

You create a virtual environment and use pip freeze to generate a list

#

Sorry

#

That's for python

#

You need a package.json in node.js

#

Not a requirements.txt

bright flame
outer zenith
#

oh

#

ok

bright flame
#

package.json i have

#

so shall i remove requirements.txt

#

?

hollow sedge
#

Again, you would've known that if you looked at the link I sent

#

Which is literally created by heroku

bright flame
#

hmm if i get doubt then who will i ask

hollow sedge
#

Then you can ask here

bright flame
#

ya i was able to run the app locally

#

and my bot got online

#

but unable to open localhost

#

in web

#

@hollow sedge

#

@outer zenith

outer zenith
#

huh?

#

did u run the cmd commands

bright flame
#

yes heroku local

hollow sedge
#

Wait what

#

Did you use a worker or web in your Procfile

bright flame
#

yes worker

hollow sedge
#

Because you shouldn't expect anything in localhost

#

Why are you expecting something in localhost then

#

It's not a web app

bright flame
#

ohkk

outer zenith
#

^

earnest phoenix
#

You should use electron for web app 😎 👌

hollow sedge
#

That's not what I mean by web app

earnest phoenix
#

Oh

outer zenith
#

oh yea what webhosting service should i use

#

i cant use heroku

earnest phoenix
#

Mmmm

hollow sedge
#

Heroku is pretty much the best free one I think

earnest phoenix
#

I use a VPS to make my bot stay online 24/7

hollow sedge
#

Yeah that's the best way

bright flame
#

i installed cool-ascii-faces now what to do?

hollow sedge
#

They said webhosting service though

earnest phoenix
hollow sedge
#

Dude

#

Read the docs

#

No one knows what that is

earnest phoenix
#

Lol

bright flame
#

i am not getting it in docs @hollow sedge

earnest phoenix
#

Wut

#

Getting what?

#

Ah

hollow sedge
#

Do you know node.js?

bright flame
#

ya

earnest phoenix
#

Is he trying to make a bot? @hollow sedge

hollow sedge
#

Well this is fairly simple so I really doubt that

#

Yes

#

There's literally one function to call

outer zenith
#

i cant use heroku cause its filesystem is ephermal

hollow sedge
#

I don't even know node.js and I knew what to do 5 seconds after looking at the npm page

outer zenith
#

and im using .db files

earnest phoenix
#

Wrong link

bright flame
#

i wanna host it

hollow sedge
#

Wait what?

outer zenith
#

i think thats what he means

#

by making a bot

hollow sedge
#

But you're asking about cool-ascii-faces

#

So you aren't trying to host it anymore

earnest phoenix
hollow sedge
#

True but that isn't free, unfortunately

#

Well it is

#

For a year

bright flame
earnest phoenix
#

My bot uses so many ram 👀

bright flame
#

to install it

earnest phoenix
#

The only thing you should know about installing modules is the command for installing modules lol

#

Just say npm install (module)

hollow sedge
#

Yeah

#

I just reported them

earnest phoenix
#

or npm i (module)

bright flame
earnest phoenix
hollow sedge
#

That's an EXAMPLE

#

Something called cool-ascii-faces is not going to be essential to your code

earnest phoenix
#

Yep

hollow sedge
#

Also I think you're pretty much done @bright flame , the rest might just be for web apps

earnest phoenix
#

That's an example to teach you how to install modules and declare these modules into your code.

bright flame
earnest phoenix
#

Getting?

#

Uh

bright flame
#

i did that in the local host

hollow sedge
#

You don't need to keep following the tutorial

#

Because you finished the part required for discord bots

bright flame
#

now what to do

hollow sedge
#

Now you run it

#

You can use the heroku dashboard

earnest phoenix
#

idk how to use heroku so i can't help

#

Xd

hollow sedge
#

It's pretty simple

#

You just click a button

earnest phoenix
hollow sedge
#

Idek

bright flame
hollow sedge
#

You are using github, correct?

earnest phoenix
#

He told you 1 minute ago

bright flame
#

github?

earnest phoenix
#

uh

hollow sedge
#

Oof

bright flame
#

no one told me about that

earnest phoenix
#

._.

hollow sedge
#

No one is going to tell you anything

#

It's up to you to find out

#

anyway

#

where are your files

earnest phoenix
#

Wait, what language are you using?

bright flame
#

locally in my pc

bright flame
earnest phoenix
#

My zone 😎 👌

#

My bot is coded with js

outer zenith
hollow sedge
#

you have the heroku CLI installed, correct?

outer zenith
#

and there were all bots

hollow sedge
#

lol

outer zenith
#

and i was the only person there

#

other than the owner ofc

hollow sedge
#

no human would join that server

bright flame
earnest phoenix
outer zenith
#

this server

earnest phoenix
#

Oh

#

Lol

hollow sedge
#

hi guys ${member.user.tag}

bright flame
hollow sedge
#

you are so cool ${member.user.tag}

earnest phoenix
#

But how did that bot joined this server?

hollow sedge
#

btw guys

#

THIS ISNT SPAM

earnest phoenix
hollow sedge
outer zenith
#

you know how you def know its spam

hollow sedge
#

its hard to use heroku otherwise

outer zenith
#

they say its not spam

earnest phoenix
#

member at dm? Really? lmao

bright flame
hollow sedge
#

ok good

#

wait

#

dont push your token

#

you are definitely about to push your token

gilded olive
#

.gitignore

#

if he did push it

#

git -rm cached file

earnest phoenix
#

he did it

#

I velive

gilded olive
#

rofl

hollow sedge
#

i think its actually --cached

earnest phoenix
#

Believe

gilded olive
#

hold up ill check that

bright flame
#

@hollow sedge dude pls dm i am unable to read here

hollow sedge
#

well i actually already know but go ahead

gilded olive
#

ah yea i was wrong w the syntax

#

git rm --cached file

hollow sedge
#

no im not dming

earnest phoenix
#

I think this guy doesn't speak english

hollow sedge
#

@bright flame i have to go now, but you're close if you get your files on github

bright flame
hollow sedge
#

and hopefully the others here can help you

gilded olive
#

I can help him with the github thing

#

what's the issue with it @hollow sedge quick b4 u go

earnest phoenix
hollow sedge
bright flame
#

wait i am unable to upload a folder

hollow sedge
#

so rn hes just trying to get his files on github

bright flame
#

in github

gilded olive
#

ah

#

did you install git

bright flame
#

ya i have that

gilded olive
#

open the cli

earnest phoenix
#

i never used heroku

bright flame
gilded olive
#

run

#

git config --global credential.helper manager
git config --global user.name "<your name here>"
git conifg --global user.email "<your email here>"

#

these 3 commands

bright flame
#

my name or my project name

gilded olive
#

it says user.name so your user of course

bright flame
#

hmm

gilded olive
#

tell me when you are done

outer zenith
#

damm

#

im finally done with all the easy sql

#

now time to deal with the levelign sql

gilded olive
#

i havent seen an sql statement in weeks

#

orms for life

bright flame
#

done

#

@gilded olive

gilded olive
#

now does your repository already exist?

bright flame
#

ya

gilded olive
#

alr well now do

#

git clone <url to repo>

hollow sedge
#

wait hold up

#

im back for a second

#

he never pushed it

#

and if you clone it

#

its just empty

#

wait a sec

#

NVM

#

you know what you're doing

#

im an idiot

gilded olive
#

he said it exists

hollow sedge
#

thats a much better way of doing it

gilded olive
#

so I was gonna let him clone it then pull it

hollow sedge
#

yeah

#

makes more sense than what ive been doing

gilded olive
#

tbh I would just make a brand new empty repo and work from there

bright flame
#

this is the warning

#

You appear to have cloned an empty repository]

gilded olive
#

hk make a new empty repo with absolutely nothing

bright flame
#

ya

gilded olive
#

im gonna teach you how to make repos and connect them with git now (youll need this in the future)

#

tell me when thats done

bright flame
#

ya done

gilded olive
#

ok good

#

now go to the folder where you want that repo to be in the cli

#

cd path/to/folder

bright flame
#

ok

#

then

gilded olive
#

now run git init

#

you should see an .git folder in that folder now

bright flame
#

ya

gilded olive
#

ok good

#

now run git remote add origin <url to your repo>

bright flame
#

done

gilded olive
#

run git status and show me the output

bright flame
gilded olive
#

which file contains your token

bright flame
#

yes

gilded olive
#

which* sorry

bright flame
#

main.js

gilded olive
#

you'll probably want to make that not public yea?

bright flame
#

its private only

gilded olive
#

still

#

best practice to keep sensitive information outside of main files

#

so I want you to make 2 files

#

.gitignore and .env

bright flame
#

dude shall i connect after half an hour my dad forcing me to go

gilded olive
#

F

outer zenith
#

ah this is same guy still

#

damm just thinking abt leveling sql is giving me a headache

#

i feel like just leaving it for tommorow

gilded olive
#

I'll write the steps down so you can hold them

1. After you are done making those two files open .gitignore and write:

node_modules
.env```

`2.` When you are done this, run `npm install dotenv`

`3.` Make a file named `.env` in the root directory and write `TOKEN=your_discord_bot_token`

`4.`**open** your `main.js` file and write `require('dotenv').config()`

`5.` Write where your token is needed as `process.env.TOKEN`

`6.`  open back the git cli and run `git add .`

`7.` run `git commit -m"Your commit message"`

`8.` run `git push origin <branch>`

`9.` setup finished. @bright flame
outer zenith
#

but i also wanna add more anime commands tommorow

gilded olive
outer zenith
#

lmao

#

i did myanimelist

#

cause my shit is on mal

gilded olive
outer zenith
#

but i should add anilist compatablility

#

taht way i can add more people

gilded olive
#

lmfaooo

outer zenith
#

but yea rn i searched up on top.gg

#

theres only one other bot

#

that has mal compatibility

sudden geyser
#

MAL's API is still sort of in beta right

outer zenith
#

yea

#

but i webscraped everything

gilded olive
#

pepega

outer zenith
#

other than searching for animes

#

and mangas

sudden geyser
#

ah makes sense

#

AniList's API is also nice, but it's quite messy if you're using type-safe languages

outer zenith
#

hm

#

maybe the commands can be

#

~animeList

#

and

#

~aniList

sudden geyser
#

Could be like -anilist (al) and -myanimelist (mal).

gilded olive
#

you could make them flags

outer zenith
#

yea i already enabled the animeList one

#

well i could

#

but like

sudden geyser
#

flags would be kind of annoying to remember to type

outer zenith
#

it would be less confuseing

#

yea

gilded olive
#

ah right

outer zenith
#

the less arguments the better usually

gilded olive
outer zenith
#

ah sure

#

maybe anilist can be my next set of commands

sudden geyser
#

I recommend you try it out

outer zenith
#

can someone send me an anilist

#

this is what i have rn

gilded olive
outer zenith
#

for anime commands

#

thats all for the stats?

sudden geyser
gilded olive
#

meh well there's more you can fetch I believe

outer zenith
gilded olive
#

yea I gotta add all of that

outer zenith
#

im prob gonna add a thumbnail

gilded olive
#

brrr

outer zenith
#

lmao this is from mal

gilded olive
#

thumbnail = there anilist pfp

outer zenith
#

web scrape pog

#

ye

gilded olive
#

tbh some websites will have an api and people will still webscrape Hmmm

outer zenith
#

yea

earnest phoenix
#

youtube mmulu

lusty quest
#

most bcs the Google API is a nightmare

outer zenith
#

what does api stand for

gilded olive
#

application programming interface

#

(i think)

carmine summit
#

Why it return false? Thonk ```
head.forEach((x) => {
if (x > defaultX || x < 0) {
console.log("Border");
let index = games.indexOf(ins);
games.splice(index, 1);
return true;
}
});

```let checks = checkDied();
console.log(checks);
gilded olive
#

wym there is no prefix