#development

1 messages · Page 531 of 1

earnest phoenix
#

i learned js when i was about 10

#

i forget

high anchor
#

I started learning NodeJS in high school to make webapps for clubs and shit

#

just learning REST and sessions and authentication and stuff. good times

#

i made a note taking app that i used for the entire year, only for me to lose the encryption key at the end

#

sad

west raptor
#

idk even know why i started coding in general

earnest phoenix
#

i started coding because my dad said "hey want a book on javascript"

west raptor
#

i started learning node when i was introduced to bot making though

earnest phoenix
#

my early code was shit

west raptor
#

same

#

present code is shit also of mine

earnest phoenix
#

same

west raptor
#

and now im attempting to learn like 3 languages at once

#

rust, golang, and java

high anchor
#

I wanted to make a badass website

#

I learned Python to do game dev but ironically all my game projects have been making physics engines for HTML5

slim heart
#

my solution to getting all the letters lol

code: "xl"
})```
quartz kindle
#

i never thought i would become a programmer, until i became one

inner jewel
#

computercraft

high anchor
#

@quartz kindle Same
i considered myself a script kiddie for the longest time though

#

mainly from hearing all the "front-end not real derv" stuff.
imagine telling that to a kid in middle school

quartz kindle
#

i started with html, and years later i find out i actually hate front end

serene sun
#

@quartz kindle hey! i got the gcp account so where do i start lol. i’m assuming the computing engine.

quartz kindle
#

yup

high anchor
#

Yeah, client side is a nightmare for me

#

it's fun to design stuff but it always gets messy, even with jade or coffeescript or whatever

#

i'm still a pleb with low level stuff but at least i know the best practices

quartz kindle
#

i hate designing in general because im never satisfied with my own designs lmao

inner jewel
#

client side is hell

high anchor
#

for real

quartz kindle
#

client side js is fun, but coding UIs is a pain

high anchor
#

it's fun designing little pretty webapps and guis, but when you have to work on client side for a real application

#

yeesh

quartz kindle
#

im still figuring out how im going to do this thing in my project

#

a fully customizable canvas app

#

with a shit ton of user-defined ways to draw on canvas

high anchor
#

oof
canvas elements are WACK

quartz kindle
#

and interactive canvas

high anchor
#

i made a collaborative p2p whiteboard app with HTML5 canvas

#

not a fun time

quartz kindle
#

xD

high anchor
#

like

#

how do you even do responsive design with a canvas of fixed size

#

without horribly distorting the image

#

or without ugly af scrollbars

quartz kindle
#

dont use canvases for images? lmao

high anchor
#

well it was a whiteboard app, so no choice there

quartz kindle
#

let the images have a fixed/user-defined sizde

#

and fixed aspect ratio

high anchor
#

yeah that's what i ended up with

quartz kindle
#

in one of my attempts i had a zoomable canvas by scrolling

#

with redrawing on finish

#

with a high-dpi canvas (double res)

#

thing destroyed my browser

#

5k x 5k = 1gb+ ram

#

i ended up completely dropping the zoom feature

mild quarry
#

discord.py - Is there a way to get information from the user and get arguments they pass from a command? For example...

@client.command(pass_context=True, no_pm=True)
async def addreaction(*args):
  server_id = args.message.server.id
  await client.say(args)
  await client.say(args.message.content)``` I keep getting the error `AttributeError: 'tuple' object has no attribute 'message'`. How can I get the server ID and arguments the command runner passes with the command?
serene sun
#

@quartz kindle sorry to bother again but you said i wanted to go with a micro server type correct?

quartz kindle
#

f1-micro

#

you get 1 free per account

#

all others cost money

serene sun
#

awesome

#

thank you

#

it says 4.83 a month though

#

@quartz kindle does that 4.83 go into the 300 free credit

quartz kindle
#

it says 4.83 but after you have it running it will say 0

serene sun
#

oh cool

quartz kindle
#

the 300 credit only lasts for 12 months, but until then everything goes into it

#

except the free things

#

the only problem is that google only gives you 1gb of bandwidth

#

and discord bots use much more than that

serene sun
#

alright awesome, would linux be fine

#

and i’m not planning to use a music bot, just a bot for my server

quartz kindle
#

so even with the free tier you're still gonna spend like 1 dollar / month from the free credit because of bandwidth

#

and after 12 months it will start charging that on the credit card

#

but its still the cheapest thing you'll ever find

serene sun
#

oh okay

quartz kindle
#

if you're up for it, you can also just create more accounts and sign up again

#

for another 12 months of free credit lol

#

and yeah linux is fine

#

im using ubuntu

serene sun
#

@quartz kindle should i use the cloud “bucket” to transfer data or is there a better technique

quartz kindle
#

to send files to the server?

#

just use an ftp/sftp software

serene sun
#

oh okay

earnest phoenix
#

Hi, I don’t know where write this so I write here ( sorry for my English I’m Italian )
I search a bot for count whit a command send me the top 10 message with much reaction

rocky mesa
#

What

earnest phoenix
#

Wait I use google translator xD

quartz kindle
#

lmao

earnest phoenix
#

I'm looking for a bot that with a command tells me which are the 10 messages with the most reactions from users
@rocky mesa

sick cloud
#

not possible tbh

earnest phoenix
#

Rip

sick cloud
#

the api doesn't like caching messages

earnest phoenix
#

k

#

unless do something like starboard and log messages like that maybe

maiden snow
#

Maybe with logs_from?

earnest phoenix
#

what

maiden snow
#

You can get the logs with that method

inner jewel
#

what

earnest phoenix
#

where are you mentioning this from

inner jewel
#

no

#

because that'd require fetching all messages

mild quarry
#

discord.py (sorry for bringing this up multiple times, I didn't get an answer before) - Is there a way to get information from the user and get arguments they pass from a command? For example...

@client.command(pass_context=True, no_pm=True)
async def addreaction(*args):
  server_id = args.message.server.id
  await client.say(args)
  await client.say(args.message.content)``` I keep getting the error `AttributeError: 'tuple' object has no attribute 'message'`. How can I get the server ID and arguments the command runner passes with the command?
inner jewel
#

which would spam discord and get you banned

earnest phoenix
#

yeah

maiden snow
#

I've set limits like 75k and there is no problem, even when repeating in a short time

earnest phoenix
#

ok

#

but like

sick cloud
#

anyone know about oauth2 redirect URIs?

#

i'm wondering - do URI params count

inner jewel
#

wdym?

sick cloud
#

like if i set it to http://localhost/login?path=callback will i need to tell discord (in the dev settings) to use http://localhost/login or http://localhost/login?path=callback?

mild quarry
#

:v i keep getting ignored

maiden snow
#

It should look like async def addreaction(ctx, *args):, I think. Then you can access via ctx.message

mild quarry
#

I'll try

bright spear
#

@sick cloud iirc they dont count

mild quarry
#

Yeah that works

#

Thx

sick cloud
#

alright, thanks

serene sun
#

@quartz kindle is it normal to be uploading like 3000 files lol

quartz kindle
#

you're uploading 3k files?

serene sun
#

apparently

quartz kindle
#

if you're uploading lots of dependencies like node modules and such, then yeah its normal to have a lot of files

serene sun
#

oh that might be it

inner jewel
#

@sick cloud you could encode the path into the state

quartz kindle
#

you can zip them though

serene sun
#

oh, thats alright

inner jewel
#

you don't need to upload node_modules

sick cloud
#

ok

inner jewel
#

you just need to upload package.json and package-lock.json/yarn.lock

#

besides your code

serene sun
#

oh...

#

should i cancel and just do that

inner jewel
#

then you can install the dependencies on the other end with those files

#

which is usually way faster

serene sun
#

hey thats alright, ill just wait like 10 minutes

vernal basin
#

if I want to ping a certain role, where can i fold the ID of the role

#

where can i find*

west raptor
#

\<role>

sick cloud
#

\@Memes for example

vernal basin
#

ah i see

#

thank you

#

wait oof it doesnt work

#

do i have to put ${} around it (discord.js)

sick cloud
#

no

#

you put it in chat

vernal basin
#

oh

#

i see

#

thank you

sick cloud
#

np

vernal basin
#

@Bots

#

😦 it doesnt work here

#

probably not a good idea to do it here too

earnest phoenix
#

@vernal basin the role has to be pingable

vernal basin
#

ah i see

serene sun
#

@quartz kindle sorry to bother but would you be able to help me transfer files from my windows machine to my linux gcp instance?

quartz kindle
#

werent you already doing that?

serene sun
#

i had something pop up and had to go

#

but ive looked around a bit and couldnt figure it out

#

i tried using the google bucket thing but that didnt go well lmao

formal agate
#

Use team viewer

#

If you can

quartz kindle
#

you cant use teamviewer on a headless linux machine lmao

formal agate
#

Oh

#

Idk

#

I don’t use Linux

serene sun
#

im just lost at this point lol

quartz kindle
#

go to your compute engine instance, and open the ssh window

#

on the upper right corner, click the cog wheel, and click "download file"

#

then enter /home/username/.ssh/google_compute_engine

#

where username is home directory, which you can find if you run ls /home (usually something like email_gmail_com)

#

once the file is downloaded, use an ssh program like putty and use the downloaded file as the ssh key

inner jewel
#

~/.ssh

quartz kindle
#

and connect via ip address

inner jewel
#

👀

quartz kindle
#

yeah i just tired that but it requires the absolute file path

visual zenith
#

when i did

message.guild.createdAt
```I dont want the date to look like --> 2017-05-29T00:40:52.218Z
i wanted it to look like 2017-05-29 (time)
#

discord.js ^

coral trellis
#

message.guild.createdAt.toUTCString()

#

You could do that,

#

Or you can use Moment to get a even clearer response

sick cloud
#

new Date(that).toLocalDateString()

#

using external libs for normal js smh

bright spear
#

using normal libs for external js smh

earnest phoenix
#

i think im stupid

#

eval bot.guilds.setUsername("Abyss")

#

guilds is wrong lol

bright spear
#

Yes

#

That code makes zero sense

#

Why would you be able to set the username of a collection of guilds

earnest phoenix
#

quality

#

honestly

#

my brain wont function.

sick cloud
#

this.brain is not a function

earnest phoenix
#

my life is not a function

#

brain.exe has stopped working

obsidian badger
#

brain inc stopped responding

lusty dew
#

Brain dead now

analog walrus
#

Unable to import module "brain"

coral trellis
#

Please keep it related to development and not start memeing around we have #memes-and-media for that

shadow barn
#
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 127.0.0.1:8080
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
Emitted 'error' event at:
    at LavalinkNode.node.on.error (D:\.Discord Bots\Brie-djs\node_modules\discord.js-lavalink\src\lib\PlayerManager.js:70:47)
    at LavalinkNode.emit (events.js:182:13)
    at LavalinkNode._error (D:\.Discord Bots\Brie-djs\node_modules\discord.js-lavalink\src\lib\LavalinkNode.js:226:14)
    at WebSocket.emit (events.js:182:13)
    at ClientRequest.req.on (D:\.Discord Bots\Brie-djs\node_modules\ws\lib\websocket.js:551:10)
    at ClientRequest.emit (events.js:182:13)
    at Socket.socketErrorListener (_http_client.js:391:9)
    at Socket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Anyone knows what could be causing this? Might be stupid but i'm trying to use lavalink but i really don't know how the nodes work.

#

{ host: "localhost", port: 80, region: "asia", password: "##HIDDEN##" }

#

for the nodes

rugged pond
#

🤔

shadow barn
#

never used lavalink before so i have no clue

#

nvm i think i figured it out

#

nvm i can't figure it out .-.

bright spear
#

Looks like it can't connect to your lavalink server

shadow barn
#

i don't get why tho, i followed the docs

high anchor
#

econnrefused is annoyingly present in almost every nodejs host i've used
not just for discord but REST in general

#

if the error just started appearing without any changes in the code, you may just have to wait for a short time

#

@shadow barn try making sure your NodeJS is the latest version

shadow barn
#

Yeah

#

I mean it is latest

wicked summit
#

How we can make permanent instant invites using bot? (Discord.js)

keen drift
tight heath
fair sage
#

Hi

primal egret
#

%eval

#

-eval

tame mango
#

=

#

=op

keen drift
earnest phoenix
#

Help me

west raptor
#

wew

serene echo
#

Lol

ruby dust
#

that reminds me of windows 98

earnest phoenix
#

Windows 2008

#

And Super !!!

slate pilot
#

@earnest phoenix
I think this will benefit you :

client.on('guildMemberAdd', async member => {
     if(!gt[member.guild.id]) gt[member.guild.id] = {};
    /// if(!gt[member.guild.id]) gt[member.guild.id] = {rol: 0};
        var Drole = gt[member.guild.id].rol;
        var autoRole = member.guild.roles.find(r => r.name === gt[member.guild.id].rol)
            if(!autoRole) return;
        member.addRole(autoRole);
});```
rich sail
#

who can help me here

slate pilot
#

@rich sail sure

rich sail
#

im dm pls

#

@slate pilot k here you have dm unabled

#

I'm doing a play command, but when i select the video throw me that error:
handleVideo is not a function, i have the function handleVideo in another folder where are events, and the handleVideo.js code is:
https://hastebin.com/oqidabuhul.js

¿What i need to do? pls help

slate pilot
#

url doesn't work

rich sail
#

let me do another

rich sail
#

Who can help me

bright spear
#

Well we can't see your code

past crypt
#

@quartz kindle lock channel

fair dew
#

What's a good but cheap VPS? My bot uses little resources so yea

earnest phoenix
#

DigitalOcean

earnest phoenix
#

hey can anyone help my bot dont work on this servers channels but works in all other servers ??

smoky spire
#

I'm guessing your bot is muted

earnest phoenix
#

no didnt doesnt has any mute role

desert bough
#

to set a bots nickname is it bot.user.setUsername(); ?

#

in NodeJS that is

earnest phoenix
tight heath
#

@fair dew check pinned for a price comparison

#

And choose what you need

lofty hamlet
#

Hello !

#

I have a problem with my bot

#

My bot worked very well until tonight 18h

#

It makes a command out of 50 and starts once out of 10

tight heath
lofty hamlet
#

@tight heath

#

So ?

#

Others bots works

tight heath
#

Some are broken tho

lofty hamlet
#

So ?

#

My bot will never walk again?

tight heath
#

No you'll just have to wait smh

lofty hamlet
#

Bruh fuck !

#

Thanks you guy

earnest phoenix
#

Ali

#

Nabiyon amq

lofty hamlet
#

@tight heath

#

Look api discord is on

earnest phoenix
#

can anyone help me with showing your bots server count on discordbots.org. in one word, i want to use servers api for site

tight heath
#

@lofty hamlet it's down just believe me

lofty hamlet
#

All Systems Operational

earnest phoenix
#

lets report

tight heath
#

no need

#

they know it's down

#

literally scroll 20 messages

lofty hamlet
#

Yes i see

eager kite
earnest phoenix
#

@eager kite everyone has that problem even me too because discord api down at the moment.

eager kite
#

wtf

#

pissed

#

im working on my work then this happen

#

FeelsGoodMan

sturdy chasm
#

how would one deal with a bot that lags when responding to commands? it's using "forever" to run 24/7

#

I'm thinking it's 1 of 2 possibilities. either 1) it's the ec2 server I'm hosting it on; or 2) it's the thing keeping the bot constantly running

wraith fjord
#

oh shit @tight heath got to me

tight heath
#

mmmm

#

like 45m ago lmao

sturdy chasm
#

oh, so could that be what's causing my problem?

sturdy chasm
#

So far, everything's testing fine now for my bot. discord status says latency has been resolved. I'm just dumbfounded that it had to happen right as I was presenting my bot for a directed study (senior project in college)

#

like, it happened exactly when I didn't need it to.

mossy vine
#

so this isnt really a bot development related question, but does python have anything like json objects?
for example:
how would

const myobj = {
    "coolproperty": null,
    "hahayes": "hi"
}```
look like in python?
quartz kindle
#
Dictionary literal

>>> d = {"A": "ALA", "C": "CYS", "D": "ASP"}
>>> print d["A"]
ALA
>>> ```
mossy vine
#

ah so the only different thing is how i refer to it

#

instead of d.A its d["A"]

#

big thanks

quartz kindle
#

js also has d["A"]

#

same thing

sick cloud
#

python just makes it more confusing

mossy vine
#

wait it does? never knew lol

sick cloud
#

i mean in python indentation is a serious factor, but yea

#

they don't have arrays

#

it some other fancy thing

quartz kindle
#

all languages need to have obj[key]

#

otherwise how would you do js var x = "test" var obj = {"test":1} obj[x] //1 obj.x //undefined

mossy vine
#

true

sick cloud
#

if i have a link like https://youtube.com/channel/ThatTonybo, how do i slice the /channel out, so it becomes https://youtube.com/ThatTonybo?

bright spear
#

You could just .replace('/channel', '')

sick cloud
#

tried that, doesn't work apparently

#

since it returns https://youtube.com/undefined

quartz kindle
#

that makes no sense

sick cloud
#

well thats whats happening think

quartz kindle
whole condor
knotty steeple
#

@sick cloud python has arrays

#

its just called "list"

sick cloud
#

yeah

#

hm

#

@whole condor windows?

whole condor
#

yes

sick cloud
#

install windows build tools

#

your missing python

whole condor
#

yes but how should I install it?

sick cloud
#

npm install --global windows-build-tools

whole condor
#

Thanks, I'm going to try.

#

I download windows-build-tools but it always shows me the same error 😐

tight heath
#

which one?

whole condor
tight heath
#

no python mmm

whole condor
tight heath
whole condor
#

This shows me the same error ...

earnest phoenix
#

how to make streaming bot status?

knotty steeple
#

read your local docs

#

earnest phoenix
#

bot 1 have prefix n! and another have prefix x!

west raptor
#

if(!<message>.content.startsWith(prefix)) return

obsidian badger
#

you know in discord.js how you can make embeds?

#

can i make js let embed = new Discord.RichEmbed() a const?

smoky spire
#

Yes

obsidian badger
#

ok.

#

ty

earnest phoenix
#
const Discord = require("discord.js");
const ms = require("ms");

module.exports.run = async (bot, message, args) => {

console.log(`${message.member} ran the "GiveAway" command`);

var item = "";
var time;
var winnerCount
let messageArray = message.content.split(" ");
//-- f!giveaway 1(winnerCount) 60(seconds) Item Giveaway

for (var i = 3; i < messageArray.length; i++){
  item += (messageArray[i] + " ");
}
winnerCount = Number(messageArray[1]);
time = Number(messageArray[2]);


var giveEmbed = new Discord.RichEmbed();
giveEmbed.setDescription(item);
var embedSent = await message.channel.send(giveEmbed);
embedSent.react("🎉");
  
setTimeout(function() {
  var peopleReacted = embedSent.reactions.get("🎉").users;
  var winners = [];

  // Checks if fewer people reacted than the winnerCount allows users to win
  if (peopleReacted.length >= winnerCount) {
    winners = peopleReacted;
  } else {
    // Gets as many random users from the peopleReacted as winnerCount allows users to win
    for (var i = 0; i < winnerCount; i++){
      var index = Math.floor(Math.random() * peopleReacted.length);
      winners.push(peopleReacted[index]);
      // After adding a user to winners, remove that item from the array to prevent him from winning multiple times
      peopleReacted.splice(index, 1);
    }
  }

  var winnerMsg = "User(s) ";
  for (var i = 0; i < winners.length; i++){
    // Add each winner to the winnerMsg
    winnerMsg += (winners[i].toString() + ", ");
  }

  var haveHas;
  if (winners.length === 1){
    haveHas = "has";
  }
  else {
    haveHas = "have";
  }
  message.channel.send(`${winnerMsg} ${haveHas} won ${item}`);
}, time * 1000); //--conversting seconds into miliseconds
}

exports.conf = {
 aliases: []
}

module.exports.help = {
  name: "giveaway",
  category: "other",
  description: "",
  usage: ""
}

var peopleReacted = embedSent.reactions.get("🎉").users;
TypeError: Cannot read property 'users' of undefined

quartz kindle
#
A collection of reactions to this message, mapped by the reaction ID```
#

get(reactionID)

slim heart
#

how do i just transfer any kind of fonting to normal letters?

earnest phoenix
#

you mean changing the font

brittle nova
#

For verification, should I have users do a recaptcha on a website or send an image in dms and have them type what the image says?

slim heart
#

@earnest phoenix basically yeah. so like it tansfers from fonted text to normal text

#

@brittle nova it depends on what you want. i'd use recaptcha because it's all in one place instead of between discord and what not but also probably better protection and not to mention you dont have to do the whole image process

mild quarry
#

In discord.py, if I'm having the bot take arguments with a command, how do I get it to take emojis as a part of the arguments? If I type my command in Discord to the bot, with an emoji as an arg that I want it to take, it doesn't do anything; the command won't execute.

brittle nova
#

@slim heart the verification is to make sure users who join a discord server are actually human

quartz kindle
#

why not just have them type something in a channel?

#

non-human accounts usually never type anything anyway

#

or type predefined content

#

you can also easily create a captcha in the channel itself, no need for dms

brittle nova
#

There are captcha npm packages

quartz kindle
#

@slim heart you mean like Ê to E?

#

or what

slim heart
#

thats an accent

#

I've done that

#

but like theres a million fonts lol so i'm not gonna do it if i have to type them all out

#

I mean like finding what letter it actually is and coverting it to normal text

quartz kindle
#

can you show an example?

slim heart
#

𝙛𝙪𝙘𝙠

#

oof

earnest phoenix
#

yes

#

but like

#

what would be considered normal text

slim heart
#

just the normal utf or whatever it is

#

because fonted letters arent recognized by the code

earnest phoenix
#

Yes, but what font is that

slim heart
#

doesnt matter what font it is

#

i want it to cover every font

quartz kindle
#

thats not a font, its unicode characters

earnest phoenix
#

oh ok

quartz kindle
#

he wants to convert all non-standard unicode to standard alphabetical

#

i dont think there is any way to do that besides what you're already doing

earnest phoenix
#

oh cool

quartz kindle
#

mapping every single variant to a letter

slim heart
#

hhh:/

#

ok

#

what about ocr?

quartz kindle
#

you can find many attempts at doing this

slim heart
#

i dont need accented characters

quartz kindle
#

yeah but the method is the same

slim heart
#

the person who reported the problem gave me that site

#

well tbh just in general idek how fonts are registered

#

and im really not trying to type out every font in existence lol

earnest phoenix
#

what language are you using

quartz kindle
#

@slim heart they do the same thing to convert normal text to "special" text

#

this is from their code

#

and again, its not fonts, its unicode characters

#

fonts would be changing from arial to times new roman or something

slim heart
#

oh i see

#

ok

mild quarry
#

In discord.py, if I'm having the bot take arguments with a command, how do I get it to take custom emojis as a part of the arguments? If I type my command in Discord to the bot, with a custom emoji as an arg that I want it to take, it doesn't do anything; the command won't execute.

serene sun
quartz kindle
#

hmm

#

what shows up if you type ls /home/email_gmail_com/.ssh?

#

using your account's email

slim heart
#

@mild quarry wdym

mild quarry
#

@slim heart i gtg, but let's say that i'm making a command to echo whatever i say and i tell it to echo a custom emoji. it won't respond to that

slim heart
#

Just search if the emoji exists in the server or maybe see if it starts with <: and ends in >

#

im not actually sure how python sees emojis i'd imagine the same

serene sun
#

@quartz kindle nothing really happens

mild quarry
#

Ok

quartz kindle
#

what if you type ls /home

serene sun
#

my email name pops up

quartz kindle
#

the same one you used on the previous command?

serene sun
#

yup

quartz kindle
#

then try this

#

go to your google console

#

and click this button on the top right corner

#

wait for it to connect

#

then run gcloud compute ssh my-app where my-app is the name of your project as it appears in your url and in the console itself

serene sun
quartz kindle
#

alright, did it create the directory?

serene sun
#

looks like it is doing it now

quartz kindle
#

alright, in the end it should ask you for a password to protect the key, just enter whatever you wish to use as your password

serene sun
#

hmm i got through that but it ended up saying couldn't fetch the resource

#

actually im sorry, that is the vm instance name

#

ohhhh i mustve put the instance name not project name

quartz kindle
#

yeah its project name

serene sun
#

still popped up with the same error

#

i swear nothing ever works for me lmfao

#

wait, I may have found the problem

#

got it! i think it was the zone that was wrong

#

yup that seemed to have worked

quartz kindle
#

identification saved in /home/.../.ssh?

serene sun
#

i believe so

quartz kindle
#

alright, so now try to download it again like before

serene sun
#

so now when i do ls /home/.../.ssh, it pops up with "authorized_keys" but nothing says /home/.../.ssh/google_compute_engine isnt a valid file

#

ill go back to the cloudshell

#

if thats the name lol

quartz kindle
#

does it show two files?

#

"authorized_keys" and "authorized_keys.pub"?

serene sun
#

only shows "authorized_keys"

quartz kindle
#

go back to the shell and check where was the key saved lol

#

it should have someting like this

serene sun
#

alright i got that

quartz kindle
#

then the file should be there

#

in /home/jakegorrie3/.shh

serene sun
#

okay

#

alright we got two keys

#

google_compute_engine and google_compute_engine.pub

quartz kindle
#

alright

#

download the one without .pub

#

or both whatever

#

for safekeeping

serene sun
#

IT WORKED

#

THANK YOU

#

hahahah

quartz kindle
#

lmao

serene sun
#

thank you so much for all the help

quartz kindle
#

now try using an ssh/sftp program

serene sun
#

i downloaded putty

#

now just open those files with putty?

#

well "load" those files

quartz kindle
serene sun
#

does it have to be a .ppk

quartz kindle
#

nah

serene sun
#

it makes the windows ding as if an error but nothing pops up lol

#

i think i have to rename it tbh

#

whenever i go to click browse it shortens the file name

#

i can rename it, correct?

quartz kindle
#

yeah i think

serene sun
#

should i load the .pub or the other one?

quartz kindle
#

i've never actually used putty, let me try

serene sun
#

got it

#

hmm still making the error noise

#

you have any other program recommendation

quartz kindle
#

i got it working

serene sun
#

oh awesome

#

did you get the windows ding at first?

quartz kindle
#

nope

#

did you enter your instance's ip address?

serene sun
#

oh lol, that might be it

#

is it the external ip that i need to put in?

quartz kindle
#

the ip that is written in your google compute engine dashboard

#

next to the ssh button

serene sun
#

alright

#

a cmd looking thing opened

#

and says login as

quartz kindle
#

enter the same username as before

#

jakegorrie3

serene sun
#

says server refused that key

quartz kindle
#

X_x

serene sun
#

always a problem with me, im bad luck hahah

#

also got this

#

tried all the files, still didnt work

#

might have found the problem

quartz kindle
#

i think i found the problem

#

the key must be converted to putty's own format

serene sun
#

i have to repaste a code in

quartz kindle
#

you need puttygen

serene sun
#

i have that

quartz kindle
#

open puttygen and load the key in there

serene sun
#

i just got the new key aswell

quartz kindle
#

yup, it works

serene sun
#

hmm mine didn't work

quartz kindle
#

did you use puttygen?

serene sun
#

yup

quartz kindle
#

load compute_engine then save private key

#

you'll get a new .ppk file

serene sun
#

oh okay

#

i think i did an oops

#

nevermind, fixed it

#

darn, still didnt work

serene sun
#

thats what i did

#

huh

quartz kindle
serene sun
#

wait when i "login as" should i use jakegorrie3

quartz kindle
#

i believe so yes

serene sun
#

and for the ip should i use the internal ip or external

quartz kindle
#

the one thats written in your google compute engine dashboard

#

external

serene sun
#

i see two ips when im in the vm instances page

quartz kindle
#

i give up

#

double check if the key is the correct one

serene sun
#

how would i be able to check that

quartz kindle
#

the correct one has .ppk

serene sun
#

is there any other programs i can use like putty?

quartz kindle
#

tons

#

lmao

#

i use mobaxterm, but its not free (unless pirate)

serene sun
#

do you think its my server or just putty

quartz kindle
#

there is also winscp and filezilla for file transfers only

native folio
#

can someone give me a hand

quartz kindle
#

here 🖐

native folio
#

is this fr

#

like are you helping me

#

or sending the emoji as a joke

quartz kindle
#

im trolling you because you broke a rule

#

xD

native folio
#

well

#

Im working on a leveling system for my bot and when i run it, it works. But it keeps spamming the bot leveled up so i want to know how to a) make the bot not level up and b) make it stop spamming

quartz kindle
#

the bot is tracking its own levels?

native folio
#

yes

#

its at like level 700

quartz kindle
#

make it ignore bots

native folio
#

ok

#

but now my other problem

#

i dont know if its not traking xp

#

tracking

#

because all it sends is a level up message every single message'

quartz kindle
#

how's your leveling logic?

native folio
#

would you like to see the code?

quartz kindle
#

have you checked if the values are being correctly applied and saved?

#

yeah

native folio
#
@client.event
async def on_member_join(member):
    with open('levels.json', 'r') as f:
        users = json.load(f)

    await update_data(users, member)

    with open('levels.json', 'w') as f:
        json.dump(users, f)

@client.event
async def on_message(message):
    with open('levels.json', 'r') as f:
        users = json.load(f)

    await update_data(users, message.author)
    await add_experience(users, message.author, 5)
    await level_up(users, message.author, message.channel)


    with open('levels.json', 'w') as f:
        json.dump(users, f)


async def update_data(users, user):
    if not user.id in users:
        users[user.id] = {}
        users[user.id]['experience'] = 0
        users[user.id]['level'] = 1


async def add_experience(users, user, exp):
    users[user.id]['experience'] += exp


async def level_up(users, user, channel):
    experience = users[user.id]['experience']
    lvl_start = users[user.id]['level']
    lvl_end = int(experience ** 1/4)

    if lvl_start < lvl_end: 
        await client.send_message(channel, '{} has leveled up to {}!'.format(user.mention, lvl_end))
        users[user.id]['level'] = lvl_end```
quartz kindle
#

i dont code in python, but if their operators are the same as in js, then lvl_start < lvl_end is the problem

#

it sends a level up message if level_start is smaller than level_end, which it always is

#

unless im reading it wrong

#

i dont know python

native folio
#

alright

#

well i gtg

#

thx for help

robust eagle
#

You'll probably also want to get a database involved

#

When you restart your bot, you'll lose all your data

quartz kindle
#

hes using a json file

robust eagle
#

Oh, didn't read that part

#

Still, that's not going to scale well

native folio
#

hey I want to learn html what kind of stuff would I need for that

#

like what editor should I use and how would I make a website

knotty steeple
#

you would need google

#

ok but

#

use vscode

native folio
#

can vsc be used for html

#

yeah

#

I already have that installed

#

yey

knotty steeple
#

look at some tutorial to learn how to make a website

#

im going to sleep

native folio
#

bai

serene sun
formal agate
#

In disocrd.js using npm package https://www.npmjs.com/package/imgur. I dout anyone can help me right away but im trying to use the npm package to pull images from imgur and post them as embeds. Code:

var imgur = require('imgur');

exports.run = async (client, message, args, setting) => {
    var query = 'meme';
    var optionalParams = {sort: 'top', dateRange: 'week', page: 1}
    imgur.search(query, optionalParams)
    .then(function(json) {
        //console.log(json)
        let imageURL = 'https://i.imgur.com/' + json.data.id + '.jpeg'
        let memeEmbed = new Discord.RichEmbed()
            .setTitle(json.data.title)
            .setDescription(`[(link)](${json.data.link})`)
            .setImage(imageURL)
            .setAuthor("Imgur", "https://i.imgur.com/kpLlF3Y.jpg")
            .addField("Upvotes", json.data.ups, true)
            .addField("Downvotes", json.data.downs, true)
            .setFooter(`Written by: ${json.data.account_url}`)

        message.channel.send(memeEmbed);
    })
    .catch(function (err) {
        console.error(err);
    });
};
  
module.exports.config = {
    command: "meme"
};

module.exports.help = {
    name: "meme",
    description: "Displays a random meme from ",
    usage: "hb.meme"
}```
#

ill dm you part of the console if you want

serene sun
#

@quartz kindle hey! i got on!

quartz kindle
#

ayyy

serene sun
#

dude im so happy rn

formal agate
#

gg

serene sun
#

this is correct?

quartz kindle
#

yup

serene sun
#

awesome

#

so now about loading the code onto the bot...

quartz kindle
#

@formal agate what does console.log(json) show?

formal agate
#

prepare for walls of text

#

js ill only send you part due to it being so big

quartz kindle
#

use pastebin or something

serene sun
#

what exactly do i do now that im logged in? lol

quartz kindle
#

well, there are two separate things

#

ssh and sftp

#

ssh is what you're doing right now, which allows you to run commands, install, etc in your server

#

sftp is what you need to transfer files but cannot run commands

#

putty is supposed to have an sftp client but i didnt manage to get it to work

#

you can try using filezilla, which is an ftp client that supports sftp

serene sun
#

i would assume that is called psftp

quartz kindle
#

yeah i tried using it but it didnt work lul

serene sun
#

oh okay

quartz kindle
#

i tested filezilla tho, and it works great

earnest phoenix
#

id suggest winscp + putty

quartz kindle
#

winscp is also good yeah

earnest phoenix
#

since they both work together well

serene sun
#

winscp costs ten dollars right?

earnest phoenix
#

no

serene sun
#

oh lol

#

wait so did i use putty for no reason? lmao

#

or do they work side by side?

earnest phoenix
#

winscp has putty support so it is easier to manage your connections

serene sun
#

seems legit

quartz kindle
#

@formal agate json.data is an array

formal agate
#

yea

serene sun
quartz kindle
#
json.data: [
{id:etc},
{id:bla}]```
#

you have to do json.data[item].id

formal agate
#

...

quartz kindle
#

data contains many items

formal agate
#

ok

#

also

earnest phoenix
#

you can import sites from putty into winscp

formal agate
#

how do i only output one?

earnest phoenix
#

and yea i was just about to say what tim said

formal agate
#

wait no

#

nvm i think

serene sun
#

oh word, i just imported my putty info

quartz kindle
#

to get the first item just do json.data[0]

formal agate
#

ok

serene sun
formal agate
#

file perms?

serene sun
#

hmm how would i change that

quartz kindle
#

that shouldnt be an issue

#

what's missing?

serene sun
#

it should say jake as one of the users

#

this is in file explorer

quartz kindle
#

what if you type it directly in the address bar?

#

also, from that picture it looks like jake is a hidden folder?

serene sun
#

tried that, it will show the location but not allow me to go there

quartz kindle
#

it looks slightly less opaque lol

serene sun
#

yeah i think it is hidden

#

how can i un hide it though lmao

quartz kindle
#

right click > proprieties?

serene sun
#

unchecked hidden but now it says appling attributes

#

seems like that will fix it

quartz kindle
#

yeah it will apply to all subfolders as well

serene sun
#

oh makes sense

quartz kindle
#

if your user folder is hundreds of gb it will take hours tho

#

lmao

serene sun
#

again, cant stress enough how much of a help you've been

#

thank you

quartz kindle
#

np

#

give me 200 bucks

serene sun
#

lol

quartz kindle
#

lmso

serene sun
#

i have 2.00

#

:))

#

alright so they all finished

#

do i just drag the folders into the other

quartz kindle
#

if you're connected and see both local and remote files, yeah you can drag and drop between them

serene sun
#

hmm seems like its gonna take a very long time

#

i think it is downloading node modules as well

quartz kindle
#

files are uploaded one by one

#

you can delete the node modules folder

serene sun
#

then just reinstall on the server?

quartz kindle
#

yup

#

just do npm install and it will install everything from the package file

serene sun
#

damn now its gonna take some time to delete

#

lol

#

nevermind, were good

quartz kindle
#

deleting files via sftp suffers from the same problem as transfering

#

it does it only one file at a time

#

lmao

serene sun
#

alright my files moved over instantly without the node_modules

#

so now i have to reinstall the modules, do i just go into the server cmd and do npm install

quartz kindle
#

yup

#

make sure you're in the correct folder

serene sun
#

do i do it in the putty cmd?

#

or the online powershell thing?

quartz kindle
#

in the putty cmd

#

you can do ls to view the current folder you're in

#

if you see your node files, proceed

serene sun
#

i tried npm install but it says command not found

quartz kindle
#

else do cd folder to navigate

#

ah you probably need to install node first

#

best way to do it is with nvm

#

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

serene sun
#

should i paste that in the console?

quartz kindle
#

then nvm install node

#

yes

#

you might have to paste it with right click > paste

#

because ctrl-c and ctrl-v have other functions in an ssh connection

serene sun
#

it is working

#

i am so happy rn

#

alright, it seems as if everything is installed

#

i get some errors but thats fine right?

quartz kindle
#

what kind of errors?

serene sun
quartz kindle
#

this happened after using npm install?

#

or something else?

serene sun
#

yeah, it happened after npm install

quartz kindle
#

that means some modules failed to install

#

lzma-native

serene sun
#

is there another way to download it

quartz kindle
#

try installing it separately

#

npm install lzma-native

#

or just remove it if you dont need it lol

serene sun
#

i dont think i would need it

quartz kindle
#

it might be a dependency of some other module

serene sun
#

true

#

i tried seperately downloading it and it didnt work

quartz kindle
#

you might need to install gyp and gyp-pre

#

npm install -g node-gyp

serene sun
#

that seemed to install

#

still got errors after that install

#

huh

quartz kindle
#

idk then

#

try npm rebuild lzma-native

serene sun
#

it said success while rebuilding it

#

but when i try npm install it comes back up with the error

quartz kindle
#

does your bot need music?

serene sun
#

not music but it reads a sound file and plays it

quartz kindle
#

it seems to be a dependency of audio packages

#

can you try running the bot and see if its working?

serene sun
#

yeah, should i just do node .

#

hmmm

quartz kindle
#

try reinstalling sqlite3

serene sun
#

i might just give up for the night lol

#

oh okay

#

so just npm install sqlite3 ?

quartz kindle
#

if i remember correctly, npm install cancels on error, so it didnt finish installing all the packages

#

yeah

#

back to installing your packages one by one i guess

serene sun
#

tried but same error pops up, ugh

quartz kindle
#

with sqlite?

serene sun
#

also trief uninstalling and reinstalling

#

yeah

#

the errors pop up lol

quartz kindle
#

which error now?

serene sun
#

same one lol

quartz kindle
#

not lzma again no?

serene sun
#

unfortunately it is

quartz kindle
#

idk lol makes no sense

serene sun
#

true

#

goodnight, i will try to figure it out later, the quest to put this up will continue tomorrow

quartz kindle
#

try this npm i node-pre-gyp

#

im going too, good night

queen fog
#

Does anybody have the economy codes me and @haughty folio could use?

haughty folio
#

I'll make them when I get time

queen fog
#

Ok

sick cloud
#

code it yourself

rocky mesa
#

no spoon-feeding here

sinful lotus
#
client.on('message', function () {
  process.exit();
});

here economy code

obsidian badger
#
if(command === "avatar"){
    var member= message.mentions.members.first();
    let embed = new Discord.RichEmbed()
  .setImage(message.member.avatarURL)
  .setColor(`RANDOM`)
    message.channel.send(embed)
  }
``` it works but the embed is blank. y?
sick cloud
#

.user

#

members dont have avatars

#

users do

obsidian badger
#

so change the members part. ok ty

sick cloud
#

message.member.user.avatarURL

obsidian badger
#

wait both of em

sick cloud
#

no

#

you dont even need the var member

obsidian badger
#

O

#

dont i?

sick cloud
#

no

#

its not being used anyways

obsidian badger
#

idk how to make it so if this person is mentioned, show there avatar. i only know how to get your own

#

so how do i do that?

lusty dew
#

For mine I did

#
let user = message.mentions.users.first() || message.author;

.setImage(user.avatarURL)
#

It's either user.avatarURL or user.displayAvatarURL

#

Can't remember it's been a while since I have touched a computer and coded

obsidian badger
#

ok ty

lusty dew
#

Np

midnight widget
#

@earnest phoenix what library

earnest phoenix
#

Discord.JS

midnight widget
#

What do you have till now

earnest phoenix
#

Wdym?

midnight widget
#

Like how far are you

earnest phoenix
#

Voting wise?

#

Or servers?

midnight widget
#

servers

earnest phoenix
#

Lemme check brb

#

Its in 18.

#

And it has 17 upvotes.

#

Im guessing I need more.

midnight widget
#

No code wise. Like have you started or

earnest phoenix
#

No.

#

I have read through.

midnight widget
#

Have you installed the dbl package

earnest phoenix
#

Not yet, whats it npm?

midnight widget
#

yeah npm i dblapi.js --save

earnest phoenix
#

mk doing it

#

Done!

#

@midnight widget ill brb

small python
#

Hey! i have a question how to enable something that is ''false'' like Welcome enable at tb!config how do i turn it to ''True''?

midnight widget
#

MySQL database or JSON files

small python
#

What?

#

because true itself doesn't work

midnight widget
#

To store information you can use a MySQL database or a Json file

small python
midnight widget
#

What library

small python
#

you mean code language

midnight widget
#

yes library

small python
#

idk

#

its not my bot

#

lmao

keen drift
#

👏🏾

midnight widget
#

Maybe ask your friend to come here

small python
#

i am unable to understand, i had a simple question how to turn something to ''true'' beacuse tb!set WelcomeEnabled 1 , tb!set WelcomeEnabled true , tb!set WelcomeEnabled + , tb!set WelcomeEnabled Positive all doesn't work

#

how do i turn it to ''true'' then???

quartz kindle
#

no way to know without knowing how it was coded or without documentation

midnight widget
#

r/ihadastroke

mild quarry
#

In discord.py, I have a command that requires arguments from the user ( >[command] [args]) and if the args the user gives is a custom emote, the command doesn't execute and nothing happens. How can I get it to take a custom emote as an argument from the user?

keen drift
#

@small python does this look like a support server for whatever that bot is

void mantle
zenith moss
#

@small python you would want to run tb!set edit WelcomeEnabled true

quartz kindle
#

if its /bot/turtlebot

#

then tb!set [value] [insert] Changes the bot's settings

#

but they dont have anything about WelcomeEnabled nor Welcome in their docs

zenith moss
#

Well it looks like they used the guidebot template

slim heart
#

Hey so I’m having trouble with my little bot server thing lol. I’m currently using the site to make http requests to my bots local address which is masked by a sub domain of mine, besides the point. I tried to do everything through cloudflare but for some reason the entire origin ssl thing wasn’t working so I just got a certificate through LetsEncrypt ezpz. Then I ran into the problem anyone can trace back to my home IP address with that and to put it simply I’d like to avoid that lol. So I was still hooked through Cloudflares DNS servers so I decided to turn on http proxy and everything literally worked perfectly. Then, after a few minutes it wouldn’t respond at ALL, http https everything. So I turned it off and now it works 👌. But I’m still presented with the exposed IP problems. I’m just looking to see if anyone has any idea on a proxy I could use or even use my own domains? I have like 4 different domains hooked up to a cPanel so if I could do something there someone please inform me that.

quiet flare
#

How to download quick.db for windows?

#

My Error's

small python
#

@quartz kindle @zenith moss

zenith moss
#

Umm tb!set WelcomeEnabled true

quiet flare
#

Hey ^^ My message

zenith moss
#

Are you using a administrator command prompt?

#

Umm try to reinstall again

quiet flare
#

oh ok.

small python
#

nope won't work

zenith moss
#

Imma add it on my test and see

small python
#

Ok thanks!

zenith moss
#

I’ve tried everything can’t figure it out

#

@small python I’ve gotten farther it is “tb!set welcome enabled True” it doesn’t like true or True

small python
#

Thanks!

hoary stag
#

@quiet flare

#

I'il tell you there.

small python
#

XD

zenith moss
#

Yeah

#

Good bot just confusing

earnest phoenix
#

bro

#

i need with prefix ping pong code

#

i need this code for my command

#

message.channel.send(new Discord.RichEmbed().setDescription('Kahkaha Attin').setImage('Link'))

#

@earnest phoenix

#

burda nereye atıcam işte

#

noktalı

#

virgul

#

lemi

#

message

#

is

#

not

#

defined ?

#

bu hatayı aldım

#

This channel not allowed to speak turkish

#

@earnest phoenix set message to msg

#

İ have message is not defined error

#

i added link

#

Dm

heady anvil
#

what's the ratelimit for changing a bot's game

#

is there one?

whole condor
#

Someone knows how to search for a message with his ID so he can edit it after.

earnest phoenix
#

bana

#

excuse me, in java, basic code, bot start correctly, but the msg isn't display:

tight heath
#

@hushed berry helps please my bot is no works

earnest phoenix
#
import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent;
import net.dv8tion.jda.core.hooks.ListenerAdapter;

public class HiEvent extends ListenerAdapter {

    public void onGuildMessageRecieve(GuildMessageReceivedEvent event){
        String message = event.getMessage().getContentRaw();

        if (message.equalsIgnoreCase("hello")){

            event.getChannel().sendMessage("hi").queue;

        }

    }

}
- - - - - -
MAIN

import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.JDABuilder;


public class bot {

    public static void main(String args[]) throws Exception {

        JDA jda = new JDABuilder("Token").build();
        jda.addEventListener(new HiEvent());
    }

}
hushed berry
#

You need to queue the message send @earnest phoenix

#

:p

earnest phoenix
#

yeah i do that before

tight heath
#

No

earnest phoenix
#

but it's not workk too

tight heath
#

Just do sendMessage(...).queue()

earnest phoenix
#

ik

#

i did that

tight heath
#

I don't see it in your code tho GWfroggyBlobSweat

earnest phoenix
#

ok all is rectified

tight heath
#

rectified?

earnest phoenix
#

well, all is good

tight heath
#

Odd choice of words.

earnest phoenix
#

sorry

tight heath
#

:p

earnest phoenix
#

i'm french

tight heath
#

No worries

#

Ahh

#

français

#

mais je ne parle pas français

#

So

earnest phoenix
#

all is correct no*

#

You speak french ?

tight heath
#

No, I don't lol

earnest phoenix
#

How did you do "ç" ?

#

google translate ?

tight heath
#

I have a French autocorrect for my school stuff

#

😋

earnest phoenix
#

Ohh you do french at school ?

tight heath
earnest phoenix
#

Anyway, i don't see any error in my code

heady anvil
#

@earnest phoenix you're using a very old version of JDA

earnest phoenix
#

really ?

#

I took the last

#

i think

heady anvil
#

Are you using the version from maven central instead of j center by any chance?

earnest phoenix
#

maven

#

i'm using maven

heady anvil
#

no no

#

the maven central repository

#

or jcenter repository

earnest phoenix
#

i don't understand

#

i know whzt''s maven

#

but no id of maven central

heady anvil
#

so depenencies can come from different repositories

earnest phoenix
#

or jcenter

heady anvil
#

maven central is used most

#

there's a jda on maven central and jcenter

#

but the maven central one is really outdated

earnest phoenix
#

how i can get it and use it ?

heady anvil
#

search "add jcenter maven"

earnest phoenix
#

and thus the problem come of this ?

heady anvil
#

you need to use jda from jcenter

earnest phoenix
#

so i'm using jda of what ?

heady anvil
#

the jcenter repository

tight heath
#

Okay so

#

You're using an old version

#

Which doesn't work

#

And the new update isn't on maven

#

But on gcenter

#

So you need to download it from there

earnest phoenix
#

+1

#

hi

#

i have a problem can you help me ?

#

My code :

#

?

#

plz

west raptor
#

what's the issue?

mossy vine
#

Why do you have an event listener in (what i assume is) a command

west raptor
#

just use a reaction collector or whatever it's called

earnest phoenix
#

Anyone Can Help Me Discord.Js Sharding

west raptor
#

what

visual zenith
#
            props.settings.aliases.forEach(alias => {
            client.aliases.set(props, props.settings.alias);
          })
``` discord.js ^^^ Idk y it wont save the aliases
earnest phoenix
#

@earnest phoenix , sharding is only recommended for big bots for decreasing latency and i have a code for sharding. if you give me a command i give you the magical sharding code.

quartz kindle
#

@visual zenith not enough information from that piece of code alone, but im assuming you want to save alias to client.aliases, if so just save alias, not props.settings.alias

#

also, you're setting an object as the key, just so you know (assuming client.aliases is a Map/collection)

earnest phoenix
#

@earnest phoenix Lolwut?

#

Sharding ain't nothing magical

#

All it takes is a good Google search to figure out how to shard

#

Yes?

#

Bruh

#

@earnest phoenix Can U Give Me The Code :V

#

ok

#

go pm

#

Ok

quartz kindle
#

spoonfeed ?

#

or troll

#

lmao

earnest phoenix
#

FMZ, seriously

#

Use this awesome resource called the internet