#development

1 messages ยท Page 519 of 1

knotty steeple
#

wrong codeblock language btw

#

but whatever

warm marsh
#

i think i fixed it maybe???

rough glade
#

'' + bot.latency + '' xD

knotty steeple
#

await ctx.send(bot.latency) this has to be defined as something

#

so maybe m

earnest phoenix
#

just type me what to write

knotty steeple
#

then you can do m.edit(content="hi")

warm marsh
#

use need to asign bot.latency to a latency = bot.latency then use str(latency)

knotty steeple
#

you can figure out how to make a variable

#

i dont need to spoonfeed that

#

await ctx.send(bot.latency) make into a variable
<var>.edit(content="")

warm marsh
#

python is kinda a ugly language for bots

earnest phoenix
#

why?

warm marsh
#

layout.

earnest phoenix
knotty steeple
#

ignoring what i said because i dont want to spoonfeed basic code

earnest phoenix
#

@knotty steeple dude..

earnest phoenix
#

just listen to what he says

#

i mean

#

he did try to give you the first step. didn't he?

terse pier
#

Is here any simple way to get name of twitch account via twitch integration in discord?

sick cloud
#

use the twitch api

#

you might be able to get connections

#

then run that through the api

west raptor
#

You can't iirc

sick cloud
#

but you'd need to oauth the user

#

you can

#

you need the connections scope tho

west raptor
#

Ohyea

terse pier
west raptor
#

oauth the user

terse pier
#

How then does MEE6 automatic roles for twich subscribers?

west raptor
#

twitch api probably

terse pier
#

How?

west raptor
cold harness
#

can somone teach me how to mass message an announcement

#

into the default channel of every server my bot is in

west raptor
#

wdym

#

Like

sick cloud
#

no

#

thats api abuse

#

if you wanna do it

cold harness
#

oh

sick cloud
#

go and get banned and save discord the hassle

cold harness
#

toni being a meanie

sick cloud
#

use an announcements channel in your server for stuff

cold harness
#

i do that

west raptor
#

or make a command

cold harness
#

nvm

#

i figured it out

terse pier
#

I think that default server channel is no longer supported in discord.py

west raptor
#

That is correct

sick cloud
#

its not supported anywhere on discord

west raptor
#

^

sick cloud
#

you can literallydelete every channel in a server now

cold harness
#

that's nice

#

what would you even do with an empty server

sick cloud
#

have fun

cold harness
#

noice

terse pier
bitter sundial
#

you can't

#

bot accounts cant get those

#

you have to use an user account and that's selfbotting

#

which will get you banned

terse pier
#

ba dumc

#

So, how MEE6 works than?

sick cloud
#

dashboard

#

you have to sign in to the dashboard to get the bot added to a server

compact ravine
#

How do people get a bot in the bot certification program?

sick cloud
#

therefore they can get your connections beforehand and save them

compact ravine
#

thank you @sick cloud

terse pier
#

Why it's not allowed to see users integrations for bot? @bitter sundial sorry for the ping

#

Does it have any practical reason?

sick cloud
#

because the discord api is mean to bots

cold harness
#

and everyone

#

my ping is sad

#

always sad

terse pier
#

Still, it would be really nice to see those integrations via bot

night imp
#

@terse pier use oauth2

earnest phoenix
#

Well, its not mean

night imp
#

Just have them click on a link

earnest phoenix
#

its security

#

I don't want some bot collecting info about my other accounts without my authorization

night imp
#

Identify scope iirc

quartz kindle
#

if bots had access to those, they could mass message you on those platforms

#

or track you, etc...

night imp
#

@terse pier

terse pier
#

I'm here but I'm wondering how that would help with my problem

night imp
#

Well what do you want to accomplish?

terse pier
#

Automaticly set roles for twitch subscribers

night imp
#

You could have them have to log in using oauth2

#

To get their twitch

#

If they are connected to twitch

terse pier
#

That wouldn't be practical to do with every server member ๐Ÿ˜„

night imp
#

Okie

terse pier
#

They are users, not clicking machines

night imp
#

They have to connect their twitch account and click allow

#

But whatever

terse pier
night imp
#

Yes they can

#

Using oauth2

#

The user just has to go to a screen like the add to server one

#

And hit accept

terse pier
#

But every user should use that oauth

night imp
#

You setup oauth

#

They click allow

terse pier
#

I'll check your link, now I really need to go to bed

night imp
#

Ok

#

I'll get an example of what I mean one sec

terse pier
#

oauth isn't that kind of think that you can implement at 23:18 ๐Ÿ˜„

night imp
#

Oh yeah I'll let you get off

#

Iirc there is a medium article that can walk you through it

terse pier
#

Can you please give me some example for now?

night imp
#

All your users would have to do is hit accept

#

Then your back end code will do the rest

sick cloud
quartz kindle
#

are you sending a buffer?

sick cloud
#

i am

shell blade
#

Can someone help me get custom fonts into Canvas?

#

I did Canvas.registerFont('./fonts/UniSansHeavy.ttf', 'DiscordBold'); but nothing happens when I use it.

west raptor
#

lol

#

Do you have that font

#

The owner of pengubot clearly downloaded that font

quartz kindle
#

@shell blade which version of canvas?

#

registerfont is only for canvas 2.x.x

shell blade
#

@quartz kindle ^2.1.0

#

@west raptor yes lol. I downloaded it into the bot's folder.

quartz kindle
#

do you use node-canvas or canvas-constructor?

#

this is how i do it in node-canvas

shell blade
#

canvas-constructor

quartz kindle
#
var {registerFont,createCanvas} = require('canvas');
registerFont('sym1.ttf', {family: 'sym1'});
#

^ node-canvas

shell blade
#

That's what I'm doing with canvas-constructor.

empty owl
#

Help

quartz kindle
#

are you doing it before drawing to canvas?

#

show your code

shell blade
#

Yes

empty owl
#

My poll cmd reacts to the author not the bot

#

.js

shell blade
quartz kindle
#

i cant find anything about using registerfont with canvas-constructor, but my guess is try doing it the same way as with node-canvas

#

requre the registerfont function from canvas-constructor instead of using Client.registerfont

#

also, you're using the Impact font anyway, so your custom fonts are not even being used

shell blade
#

Okay

#

Thanks for the help ๐Ÿ˜ƒ

whole urchin
#

any 1 know how to Change game status (streaming)

#

This is what i got so far @bot.command(pass_context=True, hidden=True) async def setgame(ctx, *, game): if ctx.message.author.id not in owner: return game = game.strip() if game != "": try: await bot.change_presence(game=discord.Game(name=game)) except: await bot.say("Failed to change game") else: await bot.say("Successfuly changed game to {}".format(game)) else: await bot.send_cmd_help(ctx)

slender thistle
#

Uhhh

tepid jasper
#
# Streaming
await bot.change_presence(activity=discord.Streaming(name="something lit"))

# Listening or other
activity = discord.Activity(
    name="whatever makes me feel happy",
    type=discord.ActivityType.listening
    # type=discord.ActivityType.playing
    # type=discord.ActivityType.streaming
    # type=discord.ActivityType.watching
)
await bot.change_presence(activity=activity)
slender thistle
#

game = game.strip()

#

if game != ""

#

Also that's rewrite @tepid jasper

#

They need async

#

@whole urchin game=discord.Streaming(name="Some stream") iirc

whole urchin
#

Thank you

tepid jasper
#

they should update to rewrite :D

whole urchin
#

How to know if have rewrite

tepid jasper
#
$ python
>>> import discord
>>> discord.__version__
'1.0.0a'
whole urchin
#

Thx

tepid jasper
#

(if you decide you want to update)

slender thistle
#

Noooo

#

No fucking way

#

Hold up

tepid jasper
#

?

slender thistle
#

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

#

Official d.py rewrite

tepid jasper
#

ah, alright do that lol :P

slender thistle
#

the one on PyPi was uploaded by someone who is not related to d.py devs

#

and they don't keep it up to date

#

So use the command I sent

tepid jasper
#

couldn't remember how he installed it

slender thistle
tepid jasper
#

it was a while ago

slender thistle
#

STM, i c Thinkmas

sick cloud
#

yes

#

its an svg

#

it wont embed in discord chats

#

you can only use it in img tags and such

keen drift
#

Webp version when

topaz fjord
#

never

ruby dust
#

@slender thistle the best way imo (is also what I do) is to just have the discord library in the same folder as the bot's files

topaz fjord
#

wut

#

node_modules bloblul

slender thistle
#

Preferences

quartz kindle
#

which language/lib?

quartz kindle
#

use a setTimeout and message.edit()

thin nexus
#

Hey

west raptor
#

Hello

dreamy goblet
#

Someone know how to fetch an user with a sharded bot (discord.js) ?

signal saffron
#

I apologize for my bad english, if I checked the bot voters and if so, how can I do if I want to give him the role of supporter?

tight heath
#

const res = await client.broadcastEval('client.users.fetch(id)');
res.filter(a => a)[0]

#

Maybe

#

@dreamy goblet

dreamy goblet
#

Thanks !
I didn't know why it was not working. I changed " to ' and it now works xD

ruby dust
#

Is there an easy way to get a member object in a specific server if I already have a user object?

#

...

#

You can't edit non own message

slender thistle
#

@ruby dust guild.get_member(user.id) RenShrugGif

ruby dust
#

That's what I've been doing, but I thought there's a better way instead

quartz kindle
#

you need to send the message first duh

slender thistle
#

The most powerful way :^)

quartz kindle
#

message.send().then(msg => { this is your bots message now })

#

or with async/await

terse pier
ruby dust
#

Hmm, what does it refer to as "connections"

bold carbon
#

Is there anyway for me to get a bot to delete another bots messages after a day?

ruby dust
#

Oh I get it now

#

A user can delete a message if it has permissions, no one will give you exact code for it, you have to figure out that yourself

quartz kindle
#

@terse pier you have to create an authorization url

terse pier
#

It's even harder than creating google OAuth2 client ๐Ÿ˜„

quartz kindle
#

something like that

terse pier
#

I don't uderstand that redict_uri parameter when I only need that for my bot to acces twitch integration account of user

quartz kindle
#

from what i understand, you cannot do that with a bot alone

#

you need a webserver to accept the redirect uri

#

you can run something like an express server in your bot file

terse pier
#

I don't have money to run my own website ๐Ÿ˜

quartz kindle
#

your bot generates the url, person clicks the url, person receives the discord authorization thingy, when authorized it sends the person to the redirect url, which will be received by your bot's express server

terse pier
#

I know how OAuth works but it just don't give any sense to me how it's implemented in discord.py

quartz kindle
#

oh you're using py

#

i cant help you then

terse pier
#

Thank you anyway ๐Ÿ˜„

earnest phoenix
#

Could anyone give me advice on how to get my bot whitelist command to work?

quartz kindle
#

it would help if you showed your code

earnest phoenix
#

@dreamy goblet Uh

#

Fetching a user doesn't change whether you are sharded or not.

ruby dust
#

Maybe they wanted to see if they are cached

tight heath
#

@earnest phoenix store whitelisted user ids in a config, make command handler or inhibitors check if list includes id

#

Array would be easiest

#

@terse pier if your bot runs on a server, you could redirect to that IP

earnest phoenix
#

alright

tight heath
#

Although that's somewhat a security flaw

earnest phoenix
tight heath
#

check if client.whitelist.has(id)

#

If it's a collection/map

earnest phoenix
#

ok

tight heath
#

Thing is

#

How do you plan to store it

#

It'll get reset every restart

earnest phoenix
#

could i store it in the code?

tight heath
#

I mean you can add some people that are already whitelisted

#

Further, why a Collection

#

Just use an array or a set

#

Collection is key -> value

#

While you only have a set of values

earnest phoenix
#

lmao im a beginner in coding, i need it simpler lmfaooo

tight heath
#

And you can define a predefined array

#

Like

#

bot.whitelist = [your id, another id]

#

And then on whitelist

#

bot.whitelist.push(id)

#

Although, it gets reset every restart to the initial list

#

You can use a database

#

Like rethinkdb

high tinsel
#
  let roleid = message.guild.roles.find(role => role.name === rolename);
    if (roleid === undefined){
      const embed = new Discord.RichEmbed()
        .setTitle("โš ๏ธ Embed limit exceeded:")
        .setDescription("There is too many members to list!")
        .setColor("RANDOM")
      message.channel.send({embed});
      }
  let users = message.guild.roles.find(role => role.name === rolename).members.map(m=>m.user.tag).join('\n');
    if (users.length > 2048){
      const embed = new Discord.RichEmbed()
        .setTitle("โš ๏ธ Embed limit exceeded:")
        .setDescription("There is too many members to list!")
        .setColor("RANDOM")
      message.channel.send({embed});
      }```Any idea how I can fix my code not catching these errors??
tight heath
#

But as a beginner imo it'd be better to first get a firm grasp of JS before trying

earnest phoenix
#

okay

tight heath
#

@high tinsel expected behavior, actual behavior?

#

@earnest phoenix because otherwise you start a lot of things without the basics

earnest phoenix
#

k

#

thanks for the advice

high tinsel
#

if you enter the name of a role that does not exits "if (roleid === undefined){" should catch it, and if "users" is too long the second thing should...

earnest phoenix
#

now i can't node bot.js

#

suddenly

#

cmd is not defined

thin nexus
#

O

earnest phoenix
#

?

tight heath
earnest phoenix
#

k

tight heath
#

I'll have a look

tight heath
#

@high tinsel if (roleid === undefined) -> if (!roleid)

earnest phoenix
#

idek how to use hastebin

tight heath
#

the rest looks fine

#

hastebin:

#

paste everything

#

press ctrl+s

#

done

#

share link

#

also I meant the code lmao

#

your error is a ReferenceError I got that

earnest phoenix
#

lmfao

#

isnt working

tight heath
#

ooof

#

is it down again

earnest phoenix
#

prob idk

tight heath
#

yea

#

is an alternative

#

owo

earnest phoenix
#

k

tight heath
#

thank

#

the heck is var find = client.whitelist.find("whitelist", guild.id)

#

const find = client.whitelist.has(guild.id)

earnest phoenix
#

ok

#

still not working

tight heath
earnest phoenix
#

k

tight heath
#

that's the command

earnest phoenix
#

working now ty :3

tight heath
#

check for whitelist:

earnest phoenix
#

k

tight heath
#

if(!client.whitelist.includes(msg.author.id)) return;

#

have fun

earnest phoenix
#

k

#

where does dat bit go

tight heath
#

into a command you want to be limited to whitelist

earnest phoenix
#

ok

#

so do i need it?

river hare
#

Hey

#

Plz Clear Chet

#

Code

#

*Chat

terse pier
#

@tight heath I don't run my bot on server

#

I run it on localhost

tight heath
#

well than that's unfortunate

#

only you could use that auth then

earnest phoenix
tight heath
#

connection issue

earnest phoenix
#

ah, fixed

#

ik about dat

hushed berry
#

@tight heath hi rave

tight heath
#

@hushed berry hi nik

mild lily
#

hi rave

tight heath
#

hi whoever you are

mild lily
#

hi again to who ever you are

#

to be real no one knows who people are in discord

cold harness
#

not in big servers like this

#

unless you're jonni and oliy

tight heath
#

I mean I'm cool

#

so

#

there's that

mild lily
#

hey can i use json files as a database

tight heath
#

yes but pls don'

#

if you care about your data

#

don't do it

#

ยฏ_(ใƒ„)_/ยฏ

mild lily
#

?

#

i dont know sql so i think ill have to do json files

hushed berry
#

or you could learn sql like everyone else lol

mild lily
#

na ill stick to json

hushed berry
#

instead of literally the industry standard?

inner jewel
#

json files are horrible for storage

mild lily
#

what do i need for sql

#

man i did not expect to get tackled by all the mods :b

inner jewel
#
  • easy to corrupt
  • no way of querying it for data
  • you need to read and write the whole file to safely update a value
mild lily
#

how would i use sql in nodejs

#

??

inner jewel
mild lily
#

.

#

u could have just said PostgreSQL

knotty steeple
#

or mysql

#

or sqlite

#

or mariadb

#

you dont even have to learn sql you can use mongo or rethink (that one is shit)

tight heath
#

rethink is dope

#

mongo is dope

brittle nova
#

rethink bad

knotty steeple
#

my man

brittle nova
#

can't even get it on ubuntu 18.04

tight heath
#

what's so bad about rethonk

inner jewel
#

it's complete garbage for any lang besides js

tight heath
#

I mean what if you use js

short siren
#

Anyone good with HTML on my dbl page i just put a image and i want it to stretch not make 2 images http://prntscr.com/livp6m for the bottom of the page it added the image again

Lightshot

Captured with Lightshot

earnest phoenix
#

@here hey

storm oak
#

help me really quick?

earnest phoenix
#

what happened to good ol fashioned discord.js???

storm oak
#

I dont know

#

just got familiar with py

#

im new

#

so

#

any help

#

Im trying to make a setting with variables but its going to other groups

#

so if a = true in this server

#

it will equal to a in another server

earnest phoenix
knotty steeple
#

did you restart?

earnest phoenix
#

Yes

bright spear
#

thats vague

#

what lib

earnest phoenix
#

Js

inner jewel
#

js is a language not a library

earnest phoenix
#

Idk

#

What lib

knotty steeple
#

library

earnest phoenix
#

Ik that

knotty steeple
#

what is it

earnest phoenix
#

I just got it from the ffmpeg website

#

And I tried with npm

bright spear
#

what lib are you using for your bot...

knotty steeple
#

for the bot oliypls

west raptor
#

they use d.js iirc

earnest phoenix
#

Js

bright spear
#

JS IS NOT A LIB

earnest phoenix
#

IDK

bright spear
#

IT IS A LANGUAGE

earnest phoenix
#

I havenโ€™t coded in like 2 weeks

bright spear
#

how can you make a bot without knowing what lib you use...

west raptor
#

oks o like

bright spear
#

did you even code it

earnest phoenix
#

Iโ€™m so confused

west raptor
#

main file

bright spear
#

or use something like discord bot maker

west raptor
#

require('what here')

earnest phoenix
#

d.js

west raptor
#

ok

#

not that hard

earnest phoenix
#

It is

west raptor
#

no

bright spear
#

how did you even start coding without knowing what lib it is...

#

did you just copy code from other bots/websites

earnest phoenix
#

I havenโ€™t coded in 2 weeks

west raptor
#

not an excuse

earnest phoenix
#

I gave up on my bot

bright spear
#

you cant forget what lib you use in 2 weeks...

west raptor
#

I gave up on life yet i still know my name

earnest phoenix
#

No but I get confused

bright spear
#

xdd

knotty steeple
#

excuse for forgetting library is havent been coding in 2 weeks

west raptor
bright spear
#

lol

west raptor
#

basically

knotty steeple
#

i didnt update my bots for 4 weeks oliypls

earnest phoenix
#

Okay I get it okay I have 2 people says js isnโ€™t on why canโ€™t you just d. -> js

bright spear
#

because

#

there are multiple js libs

west raptor
#

there is

#

eris

#

uh

#

d.js

earnest phoenix
#

YOU ARE CONFUSING ME

bright spear
#

...

earnest phoenix
#

AND MAKE ME FORGET

bright spear
#

how old are you ๐Ÿค”

earnest phoenix
bright spear
#

even a 10 year old would be able to understand that lol

west raptor
#

install ffmpeg

earnest phoenix
#

I did

west raptor
#

whats ur host

#

like

#

os

bright spear
#

did you npm install ffmpeg-binaries

earnest phoenix
#

Windows

knotty steeple
#

windows

#

you dont install ffmpeg like that on windows

earnest phoenix
#

Only windows because I can remote

knotty steeple
#

you download it and put it in your PATH

bright spear
#

or just dont even use ffmpeg and use d.js's native voice system and improve performance

earnest phoenix
#

sigh windows

west raptor
#

if you rlly need ffmpeg run npm install ffmpeg-binaries in the dict you are making ur boat

earnest phoenix
#

No way am I recoding my music on my 1mb/s download

bright spear
#

sigh running your bot on your computer

earnest phoenix
#

Itโ€™s so slow

west raptor
#

wut

earnest phoenix
#

advaith is right

#

get a server noob

#

It gives me a slow connection to my vps

west raptor
#

doubt

bright spear
#

at least use heroku/glitch

#

oh a windows vps?

earnest phoenix
#

Yes

#

literally why

knotty steeple
#

do what i said

earnest phoenix
#

Windows server

#

2016

west raptor
#

you could have chose anything

#

ubuntu, etc

earnest phoenix
#

debian*

knotty steeple
#
you download it and put it in your PATH
#

windows servers are more expensive but

#

ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

im allergic to windows

west raptor
#

I mean windows isnt that bad for daily use

bright spear
#

wot do u use for desktop

earnest phoenix
#

i use debian/macos dualboot

knotty steeple
#

inb4 arch

#

oh

#

debian

west raptor
#

i use arch

knotty steeple
#

oh my

bright spear
#

im using macos rn but i use windows sometimes

#

lol arch

knotty steeple
#

windows is the gaming platform

earnest phoenix
#

can't stand telemetry + lack of full disk encryption

#

and i dont play video games

bright spear
#

same

knotty steeple
#

leave discord please

bright spear
#

no u

earnest phoenix
#

discord is a voip application at itscore

knotty steeple
#

for gamers

vernal rivet
#

Even though it says a gamer chat

earnest phoenix
#

if i had a choice i wouldnt use discord

#

but all of my friends use it

bright spear
#

do crossy road, fruit ninja, and angry birds count

earnest phoenix
#

and none of them want to use my irc server

bright spear
#

cuz i play those sometimes

earnest phoenix
#

i used to play video games in high school

#

but no time for it in college

vernal rivet
#

Or you can use discord to chat

#

There's nothing wrong with not being a gamer and use discord

bright spear
#

^

earnest phoenix
#

nothing wrong with games I just don't have the time

vernal rivet
#

I don't either

earnest phoenix
#

99% of people I know online use discord

#

so it's easier for me to use it than have everyone switch to something else for me

vernal rivet
#

Yes

earnest phoenix
#

๐Ÿคท

vernal rivet
#

The only reason why I started to use discord, because my robotics team need a form of communication and someone said discord, and here I am

earnest phoenix
#

How npm opus engine

#

Is this conversation about OS still going

vernal rivet
#

No

#

And what about npm opus engine

earnest phoenix
#

How

#

Whatโ€™s the the module called

#

For opus engine

vernal rivet
#

Opusscpirt?

earnest phoenix
#

Idk maybe

vernal rivet
#

Are you trying to make a music bot in discord.js?

earnest phoenix
#

Yes

knotty steeple
#

oh no

#

better give up now

bright spear
#

its node-opus

vernal rivet
#

Are you following a tutorial?

earnest phoenix
#

Finally it works

#

No I just got my VPS started and I needed to put my bot on it

#

And modules donโ€™t stay

#

Sometimes

vernal rivet
#

Ok

sinful lotus
#

how is that possible

#

I mean once installed

#

it should stay

vernal rivet
#

It should always be installed, its installed in the dir you installed it in

#

What vps are you doing? @earnest phoenix

earnest phoenix
#

What

vernal rivet
#

What vps are you using?

earnest phoenix
#

Google cloud

vernal rivet
#

-_-

earnest phoenix
#

What

vernal rivet
#

How long have you been programming for?

earnest phoenix
#

Clearly not long enough

vernal rivet
#

Then I have suggestions for you

earnest phoenix
#

I havenโ€™t needed to add things to my bot

#

So I forgot some things

vernal rivet
#

First one is before continuing programming your bot, I suggest you take an online course on Js, and bash/shell, second I suggest you use node.js to run your bot first before using a vps. If you couldn't remember the lib, that could mean either you copied and pasted, and you learn nothing from it, which I know that isn't true, so it means you need to learn more.

west raptor
#

codecademy has a decent js course

vernal rivet
#

Yes

west raptor
#

After you do that you can take a master course which I will be doing around christmas

#

If you really want to

vernal rivet
#

If you want to expand if codecademy wasn't enough would be sololearn

knotty steeple
#

me: i cant get past the java course
others: oliypls

vernal rivet
#

It doesn't hurt to learn/review stuff

west raptor
#

For me it's 40 USD

knotty steeple
#

WEW

vernal rivet
#

I like free stuff

knotty steeple
#

welll thats lots of money for me

west raptor
#

lol

vernal rivet
#

Might want to ping him

knotty steeple
west raptor
vernal rivet
#

@earnest phoenix did you get all that?

west raptor
#

God damn I want to take this class or whatever

vernal rivet
#

Lol

west raptor
#

40 dollars USD ๐Ÿ˜ฉ

vernal rivet
#

I prefer free stuff

wide ruin
#

So in JavaScript, I'm making currency. How can I stop the enmaps resetting when the bot restarts?

knotty steeple
#

dont use enmaps

#

lmao

wide ruin
#

But is there just a way to log all the users data?

knotty steeple
#

please

#

use a database

ruby dust
#

that sounds extreme

#

the logging all users data part

vernal rivet
#

You mean the user data that you can get,

ruby dust
#

btw, I've asked that once already but try #2, in d.py is there an easy way to get a member object in a specific server if I already have a user object?

vernal rivet
#

I am not a py Dev, so idk, I only do js and java

ruby dust
#

besides the <Guild>.get_member(user.id) way

vernal rivet
#

๐Ÿ˜ถ

ruby dust
#

I just thought of <Guild>.user would be an equivalent to that Thonk can it be true

wide ruin
#

It's only for one server, and fixed now anyway

vernal rivet
#

I mean your trying to get a member object, be more descriptive about please

slim heart
#
bot.on("guildDelete", (guild) => {
        const guildowner = bot.users.get(guild.owner.id)
        if (!guildowner) return;
        const supportserver = bot.guilds.get("399688888739692552")
        if (supportserver.members.has(guildowner.id)) {
            const autoowner = bot.channels.get("451537426867814402")
            let guildownermember = supportserver.member(guildowner.id)
            let role = supportserver.roles.find("name", "Server Owner");
            guildownermember.removeRole(role);
            autoowner.send(`Removed ${guildownermember} ${guildownermember.id} Server Owner Role On Deleted Guild`)
            var guildList = bot.guilds.array();
            let giveback = false
            guildList.forEach(serv => {
                if (!serv.owner) return;
                if (serv.owner.id == guildowner.id) {
                   giveback = true 
                }
            })
            if(giveback) {
                autoowner.send(`Added ${guildownermember} ${guildownermember.id} Server Owner Role On Still In Other Guild`)
                guildownermember.addRole(role);
                console.log("User given back server owner role on still owns server")
            } else {
                console.log("Checked if user still owns server, returned false.")
            }
        }
    })```
What's goin wrong here? I've had this function in place for atleast like 5 months and only now stopped working. The actual removing of the role works perfectly fine, but for some reason if I'm still the owner of another guild it wont add the role back like it should?
#

It even says "User given back server owner role on still owns server" in the console and still sends the message to the autoowner channel, but it just doesn't add the role?

vernal rivet
#

Is there an error that returns

slim heart
#

no

#

nothing at all

#

I'm honestly really confused

vernal rivet
#

What is serv?

slim heart
#

defined in the forEach event

vernal rivet
#

From what I am seeing is that you made this in a guild delete event, which will only happen if the server was deleted

slim heart
#

Yes

#

That's the point

west raptor
#

in d.js its also when the bot leaves a server iirc

ruby dust
#

how can I be more descriptive than that? I'm just asking if such ways exist because I don't feel like doing the way I said before is right, it's more cringy to me than anything else to have 2 values of practically the same thing in cache

vernal rivet
#

Yes

west raptor
slim heart
#

Like I said this has worked for months before

#

It only just recently stopped working for no reason that I can gather

vernal rivet
#

Check if some of the keywords are not decrepit

slim heart
#

But like it just makes no sens edfienqw. Because 1, obviously guildownermember works fine because it still removes the role in the first place. .addRole() still works obviously because I use it in other bot.on events and it works perfectly. It's detecting if I own another server correctly because it's logging it not just to console but even straight to discord.

#

It's just not adding the role

#

no error thrown, no information on why, no obvious reason why. jndwqwq

quartz kindle
#

try changing let role = supportserver.roles.find("name", "Server Owner");

#

to this style: collection.find(val => val.username === 'Bob');

slim heart
#

Well I mean it still wouldn't work

#

Because I used the same exact code for adding a role with other parts and it works percectly

#

Like I'll do that anyways but yeah it still doesn't do it

empty owl
#

I forgot how to dm a person

#

with a bot

#

HElp

west raptor
#

<user>.send()

empty owl
#

no like channel.type

knotty steeple
#

what

kind nexus
#

Hey guys, how would I check if someone's status is a certain status?
like
if Context.Guild.GetUser(ID).Status is online,
I'm trying to have the bot perform a function of someone's status is online
I'm coding in C#

#

nvm

storm oak
#

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0393EFB0>

#

anyone know how to fix this error

#

?

empty owl
#

idk

#

im discord.js

west raptor
#

then dont asnwer them

bright spear
#

Does anyone here even know d.py

trim saddle
#

@bright spear YES

#

@storm oak is that printed in your terminal?

#

if so thats usually just what aiohttp posts

storm oak
#

Yes

analog walrus
#

Naisu

storm oak
#

its printed on my terminal

#

@trim saddle what do you mean "if so thats usually just what aiohttp posts"

#

im a little new

#

so

#

im using pycharm also

west raptor
#

ide shouldn't matter if it's printing to the console/terminal

trim saddle
#

@storm oak itss not an error

#

more like a log

#

unless your bots erroring

storm oak
#

no errors

#

I just made a new bot

#

so

#

Yeah my other one failed

trim saddle
#

then its alright

empty owl
#

HEALLLLLP

#
  const args = message.content.slice(prefix.length).trim().split(/ +/g);
  const command = args.shift().toLowerCase();
    if(!message.content.startsWith(prefix)) return
    if (message.channel.type === "dm") return;
     if(message.mentions.members.size == 1) return
    let declinedas = args[0]
    
    let membera = message.mentions.users.first()
    if(message.content.startsWith(prefix + "decline")) return
    if (message.member.roles.has('459540292069097472')) {
    message.membera.send(`You have been declined as ${declinedas}! Sorry!`)
      } else {
      message.reply("you can't use this command!")
      }
});```
#

this doesnt work even though it doesnt have an error

sick cloud
#

spaghetti code

west raptor
#

message.membera

empty owl
#

Im trying to get it so whenever I do !decline @mention a, it makes it so it dms @mention

sick cloud
#

message.membera.send(You have been declined as ${declinedas}! Sorry!)

storm oak
sick cloud
#

find the error

storm oak
#

ยฏ_(ใƒ„)_/ยฏ

empty owl
#

thats not it

sick cloud
#

it is

empty owl
#

cause I defined membera as let membera = message.mentions.users.first()

sick cloud
#

membera isnt a thing

#

then youd use

#

membera.send

#

not

#

message.membera.send

empty owl
#

OK

#

it still doesnt wokr

#

Im trying to get it so whenever I do !decline @mention a, it makes it so it dms @mention `You have been declined as a! Sorry!

#

heres the code

#

Client.on("message", async message => {
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
if(!message.content.startsWith(prefix)) return
if (message.channel.type === "dm") return;
if(message.mentions.members.size == 1) return
let declinedas = args[0]

let membera = message.mentions.users.first()
if(message.content.startsWith(prefix + "decline")) return
if (message.member.roles.has('459540292069097472')) {
message.membera.send(`You have been declined as ${declinedas}! Sorry!`)
  } else {
  message.reply("you can't use this command!")
  }

});

storm oak
#

you need

#

to

#

put

#

()_

empty owl
#
  const args = message.content.slice(prefix.length).trim().split(/ +/g);
  const command = args.shift().toLowerCase();
    if(!message.content.startsWith(prefix)) return
    if (message.channel.type === "dm") return;
     if(message.mentions.members.size == 1) return
    let declinedas = args[0]
    
    let membera = message.mentions.users.first()
    if(message.content.startsWith(prefix + "decline")) return
    if (message.member.roles.has('459540292069097472')) {
    message.membera.send(`You have been declined as ${declinedas}! Sorry!`)
      } else {
      message.reply("you can't use this command!")
      }
});```
storm oak
#

at end of sentence

empty owl
#

what

west raptor
#
    message.membera.send(`You have been declined as ${declinedas}! Sorry!`)
empty owl
#

yeah i tried that

west raptor
earnest phoenix
#

are you still using a seperate listener for each command?

brittle nova
#

stealing my pfp

#

shame shame

topaz fjord
#

mentioning in dms

brittle nova
#

@empty owl are you new to javascript?

empty owl
#

yeas I started a few months ago but stopped and restarted

#

I fixed it tho

#

I have received much help from @Zan#0001

earnest phoenix
#

nice

#

mm idk

dusky falcon
#

Who will help me with my Jevil bot?

bright spear
#

?

muted oxide
#

how do i make my bot stop responding to bots

#

i forgot the code since i havent worked on a bot (discord.py*)

keen drift
#

<Message>.author.bot

#

@muted oxide

earnest phoenix
#

can anyone help with pinging bot every 3-4 minutes? what i mean is after 5 minutes of inactivity my bot goes offline. I know GlItCh Is A BaD hOsT.

mossy vine
earnest phoenix
#

i tried

#

doesnt work

mossy vine
#

If you wait an hour i can give you the code snippet that makes the website ping itself everyone 5 minutes

earnest phoenix
#

that would be nice

amber gorge
#

i'm i obliged to have a website for my bot in order for it to be certified ?

#

if i put a full documentation on my bot's dbl page and then put my bot link in here

#

is it accepted ?

quartz kindle
#

i made a github page with the documentation only

amber gorge
#

documentation means all the commands + description right ?

quartz kindle
#

yeah, whatever your users should know

amber gorge
#

can u send me a link to ur github page ?

quartz kindle
high tinsel
#
let role = message.guild.roles.find(role => role.name === rolename);
let users = role.members.map(m=>m.user.tag).join('\n');
let usercount = role.members;``` users works, but usercount returns "[object Map]"
earnest phoenix
#

Because it's a collection, which extends map

high tinsel
#

oh I forgot ".size"...

mossy vine
#

@earnest phoenix im a bit late but

const express = require('express');
const app = express();
app.get("/", (request, response) => {
    response.sendStatus(200);
});
app.listen(process.env.PORT);```
this requires the npm modules `http` and `express` so put those in your package.json file
sick cloud
#

http comes with node

#

also where is http being used @mossy vine?

#

plus, that's very not going to work

mossy vine
#

hey i have no idea, copied it from a project i did with someone else

#

it worksโ„ข

sick cloud
#

lmfao yes just copy code and give it to others

mossy vine
#

hey what do you expect me to do?

#

write actual code?

#

who does that?

sick cloud
#

smh

mossy vine
#

i also dont see why uptimerobot wouldnt work

mossy vine
#

can anyone tell me what

<meta name="robots" content="noodp">```
#

does?

languid dragon
#

i dont know what noodp does

#

but here's an article explaining all the things it does

tight heath
#

Noodp = No Open Directory Project

#

DMOZ (from directory.mozilla.org, an earlier domain name) was a multilingual open-content directory of World Wide Web links. The site and community who maintained it were also known as the Open Directory Project (ODP). It was owned by AOL (now a part of Verizon's Oath Inc.) b...

#

@languid dragon

#

Doesn't add it there

#

Should be irrelevant by now.

languid dragon
#

what

tight heath
#

Oh lol

#

You didn't ask

#

Soz

#

I thought "I don't know" was a question

#

@mossy vine

languid dragon
tight heath
#

Mmm

earnest phoenix
hearty tree
#

how can i log when a reactioncollector's max (the collectoroption) has been reached? does collector.on('end') trigger when the max is reached?

slender thistle
#

@earnest phoenix What exactly is your question?

earnest phoenix
#

@slender thistle my question is: if someone can give me code for a command "tempmute"on discord.py

slender thistle
#

Oh, nope

#

I could tell you how it works tho

#

Add mute role to user, await asyncio.sleep(x), remove role

west raptor
#

No one is going to spoon feed you

vernal rivet
#

people here aren't going to give you there code. they might help you develop one, but will not spoon feed you code. you don't learn anything from that

earnest phoenix
#

implying you need to learn how to code

#

thats why foss exists

vernal rivet
#

yes

#

@earnest phoenix i suggest you learn py using an online course, before continuing working on your bot. from what your asking and wanting, shows that you don't know how to program, so if you do know how to program then you wouldn't be asking for someone to spoon feed you. a good online course for py would be codecadmy, and if you want expand and learn what they are and do, sololearn is good for that

earnest phoenix
#

or learn a real language like C

vernal rivet
#

c is not common discord bot language

earnest phoenix
#

discord bots arent real programming either

vernal rivet
#

i wish it was, since my primary language is CPP, but db doesn't have any real docs for C/CPP

earnest phoenix
#

they should

vernal rivet
#

the closest is java

earnest phoenix
#

im tired of python its so crap

vernal rivet
#

same

#

py is not going to teach you how to program right

#

best lang would be java, and js

earnest phoenix
#

@vernal rivetwhere can i get the online corse?

vernal rivet
#

codecadmy would be a good one for free

#

sololearn will teach you what each thing is and what they do

#

if you want a better support from others, javascript is going to be best to use since js is primary dominant here.

high tinsel
#

I've run in a bit of a thing to think about, I'm my codes I used to put variables in thxt like "The number ${number} is your number", but than when I needed to write more and quick, I started just doing "The number " + number + "is your number" do you think it is worth rewriting, if so which way is better?

earnest phoenix
#

So again, is there any way to stop bot from going offline? (on glitch.com)

quartz kindle
#

i believe ""+"" is slightly faster, but ${} is much more readable

keen drift
#

still continuing

heady zinc
#

it is faster indeed, but imo not enough to be prioritized over readability

earnest phoenix
#

@earnest phoenix Don't use glitch.com for bot hosting, because its terrible?

serene cobalt
#

^

bright spear
earnest phoenix
#

i already found solution

#
app.listen(8080);
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 300000);
#

before code begins

barren brook
quartz kindle
#

that will only send to the first channel named globalchat

barren brook
#

Ohh

#

What else can i use for it to do 2+

quartz kindle
#

you'd need to loop over channels, or have a database keep track of them

barren brook
#

Oh

#

Would ids work?

quartz kindle
#

yup

barren brook
#

Okay

#

Ill do that

summer escarp
#

i need someone to help with making an economy module
bot type: discord.js

quartz kindle
#

with what exactly

summer escarp
#

mmaking it

#

the guides keep confusing me

#

and i cant make it myself

quartz kindle
#

what have you tried?

summer escarp
#

guide

quartz kindle
#

i mean...

#

what have you actually attempted

#

your code

summer escarp
#

the whole thing

quartz kindle
#

so you tried copying it from somewhere and it didnt work and you gave up and now you have nothing?

summer escarp
#

yep

#

and i need someone to help me make a working one

quartz kindle
#

well, start with a database then

knotty steeple
#

no

#

you start with learning

quartz kindle
#

learning how to use a database

#

:^)

summer escarp
#

?can someone just join the project and help me

restive silo
#

?no

quartz kindle
#

sure, if there is money involved

summer escarp
#

yeah

#

@quartz kindle money will most likely be involved

quartz kindle
#

how much are you paying?

summer escarp
#

25 dollar Amazon giftcrad

#

card*

knotty steeple
#

same

quartz kindle
#

i'll do it for 25/hour

summer escarp
#

nope

zenith moss
#

Lol

mossy vine
#

sorry for interrupting the convo but can anyone give me a tl;dr of github licenses?

zenith moss
#

#YouTube

mossy vine
#

wait nvm found it

quartz kindle
mossy vine
#

yeah i found it thanks

bright spear
#

btw licenses arent really related to github lol

mossy vine
#

nah i meant the ones github offers in the dropdown menu

hearty tree
#

i'm trying to go through a json and make a new line in a richembed field for every item there is, and i've got no idea what im doing. i've got the embed and the json layed out already

quartz kindle
#

js?

#

you can use for in

hearty tree
#

yeah i got that far but my problem is trying to figure out how to only change the field value without creating an entirely new field each time it iterates through

quartz kindle
#

you can also use Object.entries()

empty owl
#

How do u check if someone is in a voice channel?

quartz kindle
#

just dont create the fields before, let them be created during the loop

empty owl
#

^

#

like js if (message.author.voiceChannel = true) return
doesnt work

hearty tree
#

but then, say theres 12 items, the number of fields should be 3 always. wont i have 12 fields with 1 value instead of 3 fields with 12 values?

empty owl
#

uh

#

can someone help me?

bright spear
#

...

empty owl
#

if (message.author.voiceChannel = true) return

bright spear
#

never ask that

empty owl
#

How do u check if someone is in a voice channel? @bright spear I stated my question above

bright spear
#

whats the problem with that

quartz kindle
#

first of all, you're setting voiceChannel to true

empty owl
#

o

quartz kindle
#

instead of checking if it is true

empty owl
#

so what do i do?

quartz kindle
#

@hearty tree if you want multiple values per field, just apply a bit a logic

empty owl
#

3 =s?

#

like this?

#
    if(message.content.startsWith(prefix + "airhorn")) return
      if (message.channel.type === "dm") return;
      if (message.author.bot) return;
      if (message.author.voiceChannel === true){
        
}});```
quartz kindle
#

you can use a for loop with Object.entries and apply a new field if current iteration reaches a certain number/value

#

voiceChannel returns the voice channel object if it exists

#

so the value will never be true, it will be either undefined or object

#

just check if it exists instead

empty owl
#

so how do I do that?

quartz kindle
#

if (message.author.voiceChannel)

empty owl
#

ok

earnest phoenix
#

@quartz kindle Reading up...whoa

#

25 an hour...

#

That is quite a pretty penny to ask....

#

25 dollars could get me a nice udemy course bloblul

tight heath
#

Hahano

quartz kindle
#

average js wages are 40-60/hr

#

lul

tight heath
#

I'll do it for 24.99

earnest phoenix
#

For discord bots?

tight heath
#

per hour

quartz kindle
#

for js in general

earnest phoenix
#

Kids here don't even work. lol

quartz kindle
#

but im not a kid and i have bills to pay :^)

earnest phoenix
#

so I was surprised when you said that

tight heath
#

I got 135 for a bot once

#

For like 12h of work

#

So

#

Good rate

#

excl. hosting tho

iron crag
#

Im trying to make it so my bot counts how many servers its in

#

Using discord bot maker

#

Can someone help

tight heath
#

so look

#

we help using programming languages

#

but Discord Bot Maker should be easy hecking enough

zealous veldt
#

Not tools that write code for you

tight heath
#

^ what he said

topaz fjord
#

@tight heath that is a good rate

#

11.25 an hour

#

Higher than minimum wage here I think

zealous veldt
#

lower than amazing minimum wage

iron crag
#

aka discord.js @tight heath

topaz fjord
#

disgord >>> *

tight heath
#

our minimum wage is proposed to rise to 12.50โ‚ฌ

#

and I'm like

#

are you crazy

#

@iron crag client.guilds.size

topaz fjord
#

Amazons minimum wage here is 15

tight heath
#

disgord wth

topaz fjord
#

$

zealous veldt
#

yeah

tight heath
#

here ish 8.50

iron crag
#

iDk discord.js so what do i do with that

topaz fjord
#

disgord is golang

zealous veldt
#

Amazon hiked minimum wage here to $15

tight heath
#

that's your server count

iron crag
#

ik

tight heath
#

do whatever you want with it

iron crag
#

but what do with it

tight heath
#

idk you tell me

zealous veldt
#

and then proceeded to advertise the fuck out of it

tight heath
#

disgord vs discord.go?

iron crag
#

hOw to put it in sTatus MeSsAgE

tight heath
#

client.setActivity(that)

iron crag
#

in what file

tight heath
#

can you read the docs first please

#

idk how your files look

#

on ready event would be smart

topaz fjord
#

@zealous veldt they did it in a shit way tho. They removed most of the employees perks

bright spear
#
 * Discord Bot Builder Bot
 * Version 1.2.0
 * Robert Borghese
 */```
#

the frick

tight heath
#

omg

#

that file

zealous veldt
#

yeah

tight heath
#

I wanna die

bright spear
#

ewwwww

tight heath
#

process.on

#

HECK

zealous veldt
#

ew

topaz fjord
#

What the fuck

bright spear
#

@iron crag did you use discord bot maker

topaz fjord
#

Look at the events folder

bright spear
topaz fjord
#

*file

zealous veldt
#

a

#

wtf

bright spear
#

@iron crag dont use discord bot maker, just learn to code

tight heath
zealous veldt
#

hey @iron crag

tight heath
#

but please just learn actual js

zealous veldt
#

you're token is exposed

bright spear
#

oof

tight heath
#

it's so much easier

zealous veldt
bright spear
#

LMAOOOO

iron crag
#

f

bright spear
#

why

#

just why

iron crag
#

kms

tight heath
#

yayayayaya

zealous veldt
#

gitignores really aren't that hard

topaz fjord
#

^

iron crag
#

idfk ok??

bright spear
#

using DBM and posting ur token publicly

iron crag
#

leave me alone

tight heath
bright spear
#

fyi your token is your bots password

#

so

tight heath
#

reset there

#

:)

bright spear
#

i can log in as your bot

#

and do anything

topaz fjord
#

@tight heath idek what the difference is but I think disgord has more stuff

iron crag
#

can you stop it xd

bright spear
#

๐Ÿค” is disgord new?

topaz fjord
#

Yes

tight heath
zealous veldt
#

lul

#

what terminal is that

tight heath
#

cmder

zealous veldt
#

it's nice

bright spear
#

lmao

zealous veldt
#

thanks

prisma sedge
#

o

tight heath
iron crag
#

can you stop

prisma sedge
#

no u