#development

1 messages Β· Page 734 of 1

dark swift
#

it just waits for something such as message.channel.send

modest maple
#

andddd where do we put this?

dark swift
#

so for example

#
    if str(message.channel) in channels and str(message.author) in valid_users:
        if message.content.find("!hello") != -1:
            await message.channel.send("Hi.")
#

if it finds !hello in the chat

#

it will send Hi.

earnest phoenix
#

uh

#

you do realise

modest maple
#

and which subrutine do we put it in

#

also

earnest phoenix
#

there's a memberCount property

modest maple
#

the code

#

^

earnest phoenix
#

you don't need to count members manually

modest maple
#

on a side note

#

wow that code is just somthing

unkempt notch
#

πŸ˜„

dark swift
#

lol

earnest phoenix
#

best command handler

grizzled raven
#

😎

earnest phoenix
#

if else with bad support for arguments and you end up with three thousand lines of code πŸ™ˆ

modest maple
#

tbf

#

his bot would tirgger

#

if !hello is anywhere in the code

#

also

#

its caps sensitive

dark swift
#

yeah i know

#

i'm only like practising and getting the hang of it

#

just not very well

modest maple
#

#readthedocs

grizzled raven
dark swift
#

ugh

#

i may just start again

#

forget the member count

earnest phoenix
#

literally just go to the docs and find the appropriately named property

modest maple
#

id personally advise looking up how to get the bot to respond to the first part only rather than trigger if any mentioning of the command is there

#

and making caps insensitive

dark swift
#

yeah

modest maple
#

and making sure await is even in a async function

dark swift
#

idk

#

what to do next

modest maple
dark swift
#

ok

grizzled raven
#

might as well switch to js

modest maple
#
Requirement already up-to-date: google-api-python-client in c:\program files\python36\lib\site-packages (1.7.11)
Requirement already up-to-date: google-auth-httplib2 in c:\program files\python36\lib\site-packages (0.0.3)
Requirement already up-to-date: google-auth-oauthlib in c:\program files\python36\lib\site-packages (0.4.1)
#

fuck my life

#

there r like

#

50 parts to Gdrive api package

#

and its saying its installed

#

yettt

#

its nowhere to be found

#

now we begin the hunt for gdrive

dark swift
#

bruh

#

now member joined stopped working

modest maple
#

just send your code breifly

dark swift
#

huh

#

what does that mean haha

modest maple
#

send code

earnest phoenix
#

not here pls

dark swift
#

oh you meant your

#

i think that is safe only a server id

#

for one I don't care about

#

token is in another file

earnest phoenix
#

you try to loop through guild but have no variable named guild

modest maple
#
f"""Number of members in the server: {discord.guild.member_count}"""```
#

big no no

#

and yes cry is right

#

your iterating through somthing which just doesnt exist

dark swift
#

ok

#

so use discord.guild?

modest maple
#

also it wont work if you have any other channel name other than general

#

rather than hardcoding the ID why not just get it from message?

#

as for member count

#

whats the point in getting id if its not used?

dark swift
#
 id = client.get_guild(647173625912360961)
    channels = ["commands"]
    valid_users = ["yellowyears#7678", "Agon#0394"]

are you talking about this?

modest maple
#

think about what your trying to get

#

and yes

#

your getting the guild and assigning it to id

#

yet you do nothing with it for member count

dark swift
#

so it should be?

id = 647173625912360961
 channels = ["commands"]
    valid_users = ["yellowyears#7678", "Agon#0394"]
modest maple
#

nonononoo the get guild was right

#

im saying

dark swift
#

okay

modest maple
#

your trying to get membercoutn

#

off of nothing

dark swift
#

yeah

modest maple
#

well think about it

dark swift
#

good point

modest maple
#

what have you gotta do to have it get it for that guild

#

hint it involved id

dark swift
#

use the guild id

#

maybe? haha

#

im just going off of docs

modest maple
#

mhmm

#

well

#

what is YOUR discord.guild

#

hint hint

#

id = xyz

dark swift
modest maple
#

mhmmm

dark swift
#

yeah

#

so i should use the id

modest maple
#

thats saying

dark swift
#

variable?

modest maple
#

youve got the guild from client pretty much

#

so

#

instead of discord.guild

#

what do we need to replace it as...

dark swift
#

oh okay

#

i see

fluid widget
#

Hi Can anybody help me in giving me a welcome code that can save in a file with the invite json

modest maple
#

what

#

explain the question

dark swift
#

we need to replace it as id

modest maple
#

yes

fluid widget
#

@modest maple we have welcome code

dark swift
#

okay it works better now

modest maple
#

you mean a welcome message?

dark swift
#

with this i can maybe make the member count in welcome message now

#

thank you for that chill

modest maple
#

np

earnest phoenix
#

would it be better if I merge my ticket commands in to the utility cat or have a seperate cat for tickets

#

whatever you feel like is the best

#

I was thinking maybe merge, but if I have too much commands in that cat I might wanna go back to having it as a seperate cat

quaint grotto
#

why does my embed send multiple times even though i opened the bot once

modest maple
#

check that there arnt any extra instances going (double check)

#

and check its not sending the command more times

dark swift
#

Getting this error TypeError: on_member_join() takes 0 positional arguments but 1 was given

#

when using this code

@client.event
async def on_member_join():
    id = client.get_guild(647173625912360961)
    for channel in id:
        if channel.name  == "general":
            await channel.send(f"""Welcome to the server {member.mention}.""")
fluid widget
modest maple
#

DUDE

#

stop begging for the code

#

when i makes

#

no sense

#

if what you want is a welcome message

#

CODE it yourself

#

by looking at the docs

blissful scaffold
#

@dark swift you add argument when calling on_member_join()?

#

do you call on_member_join(something) or do you call on_member_join()

dark swift
#

me? i am troubleshooting

#

not begging for code

blissful scaffold
#

the code begging was not for you, that was for rocketman

dark swift
#

oh okay

#

I don't know what I did it just doesn't work now

#

i don't think I added an argument.. on purpose lol

#

other commands work

#

I put in on_member_join(id):

#

and now I get a different error when somebody joins

#

TypeError: 'Guild' is not iterable

modest maple
#

oh dude

#

right

#

you cant pass anything through on_member_join

#

cuz it wont pass you anything

dark swift
#

yeah

modest maple
#

and you cant iterate through a guild payload

#

client.get_guilds() gets a payload i think which isnt iterable

dark swift
#

ah okay

slender thistle
#

on_member_join event takes one argument

#

Can't you just iterate over client.guilds

dark swift
#

i believe the best code now would be

@client.event
async def on_member_join(member):
    channels = discord.utils.get(member.guild.channels, name="general")
    await channel.send(f"Welcome {member.mention}")
    role = dicord.utils.get(member.guild.roles, name="Member")
    await member.add_roles(role)
#

also I wasn't begging for code @modest maple

modest maple
#

it wasnt aimed at u

#

was aimed at the dude whos asked for the code twice now

dark swift
#

oh okay

modest maple
#

without giving any info or any sign of actually wanting to know how to program it

dark swift
#

just checking

#

you use canvas right?

modest maple
#

what

dark swift
#

like to get what he wants you use canvas

#

where it edits pictures using input

modest maple
#

oh

#

hes just begging for code

#

i personally use pygame for my graphics xD

dark swift
#

for example when you join some servers will have a personalised banner and all you have to do is get the users profile picture and name and then put those variables into a picture and that is how you make it i am pretty sure

#

@fluid widget

#

yeah ahha

modest maple
#

uses suprisingly little system reasources

dark swift
#

yeah

#

wait one last thing

#

I am using the code from discord.ext import commands to get commands like discord.utils.get and the whole line is grey as opposed to from and import being orange and discord.ext and commands being white. Is this correct?

modest maple
#

is this pycharm youre using?

#

how old r u @earnest phoenix

dark swift
#

yes i use pycharm

modest maple
#

also @loud salmon is that technically an ad?

#

ah yh

dark swift
#

and maybe english isn't their first language aha

loud salmon
#

eh

#

i just remove that

modest maple
#

pycharm greys it out if the import isnt used globally

dark swift
#

oh okay

earnest phoenix
#

good and you?

modest maple
#

sometimes it is just a bug

dark swift
#

understandable

#

yeah thanks

#

okay I will test it

earnest phoenix
#

i french

dark swift
#

bonjour

earnest phoenix
dark swift
#

le grand douche ne marchait pas

earnest phoenix
#

give my script bot admin pls dm me

#

t fr?

#

@earnest phoenix no

#

of course I'm french

dark swift
#

non

earnest phoenix
#

je suis fr

#

now

dark swift
#

sorry mate

#

i'm not even french haha just testing out what i know

#

i said 'the shower does not work'

earnest phoenix
#

ik

dark swift
#

alright

quaint grotto
#

if i do botsprefixHelp it sends 1 embed but if i do it again it sends 2

earnest phoenix
#

you're probably subscribing to the event every time you get the event

quaint grotto
#

oh

earnest phoenix
#

analyze your code

quaint grotto
#

i fixed it

modest maple
#
body {
    background-image: url("https://i.pinimg.com/originals/82/8b/ee/828beeae04781fb166ca613ee75603ee.jpg") ;
    height: 100%;
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
} 

.bot-name {    
    color: #fb5a04;    
}
.bot-description {
    color: white;
}
.bot-tags-title {
    color: white;
}
.owners { 
    color: white;
}
.column {
    color: white;
}
</style>```
#

moved it to develelopment now

#

but:

#

The bot name should be the hex code

charred loom
modest maple
#

but its going to the defualt black colour fixed

earnest phoenix
#

read the error

#

:)

tacit stag
#

has anyone successfully used heroku to host a bot?

earnest phoenix
#

idk

west raptor
#

@tacit stag heroku is generally not good for bot hosting

#

Just buy a cheap vps

tacit stag
#

how to do repl.it without giving away login

stray wasp
#

or you can also use googles free trial for the year and then get a cheap vps

tacit stag
#

unless private i guess

west raptor
#

Contabo has been a big recommendation recently

#

Might wanna check it out

earnest phoenix
#

make your repl name random

#

any cheap vps?

#

can tell?

stray wasp
#

Yeah they are great but they are to far away from me so I switched services

west raptor
#

@earnest phoenix there is some in pins

stray wasp
west raptor
#

Most of them have a cheaper plans

stray wasp
#

$20 a year

tacit stag
#

not bad

stray wasp
#

unmetered connection

tacit stag
#

thanks for the recs

quartz kindle
#

welp, its openVZ, thats why

stray wasp
#

linux is good

west raptor
#

Linux should be the goto OS for VPSes

#

Windows performs very poorly as a host

stray wasp
#

windows is a bit of a hassle for me to use for hosting

west raptor
#

Once you get used to Linux you never wanna go back :^)

stray wasp
#

yeah it's great so the $20 is a steal if you live in the US lul

west raptor
#

Tbh I use my computer as a host sometimes

stray wasp
#

but for bots right not websites?

west raptor
#

Yeah

stray wasp
#

yeah thats fine honestly

west raptor
#

I have a good computer and I mainly run gentoo or arch

#

It's very easy to host stuff if need be

#

I would like to get a raspi soon though

stray wasp
#

I'm yet to try arch and gentoo

#

been stuck on ubuntu

west raptor
#

Both are very good operating systems

#

Arch especially

#

Gentoo is a bit harder but also extremely flexible

stray wasp
#

I wanted to try arch desktop for programming but gave up because I couldn't be bothered typing a shit ton of commands

west raptor
#

I'm thinking of making a script

stray wasp
#

it's a bit of a hassle ay?

west raptor
#

I install arch a lot and it would make my life so much easier

#

Eh

#

Not really

#

Imo

#

Just gotta know what you're doing

#

Arch isn't a hard install at all imo

stray wasp
#

haha thats not me πŸ‘‰

west raptor
#

Just follow the wiki and you'll be fine

#

The arch wiki is definitely the best place to go for anything Linux

stray wasp
#

I'm building a new pc soon so I'm planning on using my current pc as a server for recording, hosting development etc

#

so I think I might dual boot arch and windows but I'm still conflicted

west raptor
#

I feel like arch is just a generally good distro for any Linux user really

stray wasp
#

I've wanted to switch but idk shits just been sticking to me with windows

charred loom
earnest phoenix
#

read the error

#

i told you already

charred loom
#

ready

grizzled jackal
#

ready for what?🀣

charred loom
#

idk

tacit stag
#

im ready promotion im ready promotion

trail glade
#

Y you gettin' promoted? πŸ˜‰

tacit stag
#

no but i wish

robust hollow
#

would it be possible for me to make a command to restart my bot?

dark swift
#

or what can i do about it?

robust hollow
#

i think it means it can't add roles

#

let me check real quick

#

i dont think it has permissions

dark swift
#

yeah i gave the bot admin tempoarily

#

but it doesnt have a role

#

so like I made it have admin in the discord developer portal but would it have to get a role in the server?

robust hollow
#

you can set the invite link (or the role once you invite the bot) to have the manage roles permission

sudden geyser
#

would it be possible for me to make a command to restart my bot?

Squall, what language.

dark swift
#

also how do bots get roles as soon as they join? that give them all necessary permissions

#

ah right

robust hollow
sudden geyser
#

Run something like sys.exit then restart it in the background

dark swift
#

hmm for some reason I cant seem to save the changes

#

it doesn't give me the option

#

i'll try another browser

sudden geyser
#

Yellow, make sure you check its role hierarchy

dark swift
#

yeah

#

no it just doesn't get any permissions anyway

#

apart from @everyone permisions

#

I can set permissions but I can't save them

late hill
#

You can add permissions to the invite link

dark swift
#

yeah its for testing though

late hill
#

If that's what you mean

#

?

dark swift
late hill
#

Yeah

dark swift
late hill
#

That's what you'd use

dark swift
#

yeah I know

late hill
#

But it wouldn't guarantee that the bot will actually have all those permissions

dark swift
#

But i can't save the changes

#

yeah

late hill
#

The user inviting the bot will always have full control on what permissions a bot gets

#

You're gonna have to make your bot work even if it doesn't have the required permissions

dark swift
#

yeah

#

its for roles

late hill
#

Do a check if your bot has the permission and if it doesn't then display a message to the user explaining what went wrong

dark swift
#

yeah

#

good point

#

but

#

why can't i save the permissions in the Discord Developer Portal?

late hill
#

That permission number

#

Is what you'd add as a parameter in your invite link

dark swift
#

ahh

#

I see

late hill
#

yes

dark swift
#

so that doesn't save

#

It is just a number generator

late hill
#

yeh

dark swift
#

okay

#

thank you

light drift
#

Who nows how to program the vote like hasNadeko bot ?

wheat jolt
stray wasp
#

@light drift what does nadekos vote system do?

light drift
#

@stray wasp he votes the bot and give coin currency

wheat jolt
stray wasp
#

You have a database which contains the users currency

#

And everytime a user votes it will add the amount of coins you want added

#

To the table where the coins are stored

dusky marsh
#

anyone have the regex to track if a youtube link is a playlist, my regex just seemingly broke

native cypress
#

H

dusky marsh
#

thanks

light drift
#

@stray wasp but how i can setup the comand and the fuciont because i donΒ΄t now how to explain every time when he vote gives 500 coins like that

quaint grotto
#

is it message.author.send to dm someone?

earnest phoenix
#

I need Help

#

My Bot Δ°s Not Δ°nvited

quartz kindle
#

so.. i was helping my mom schedule an appointment with a government thing, and they have this online form you need to fill up, heres how it went (keep in mind this is an official government website belonging to the "federal police")
you need to chose your city from a drop down list, after choosing your city, another drop down list gets populated with the available offices in that area. doesnt work, all options cause "error: invalid selection". click on language switch, suddenly works, switch language back, works, ok , so i select the branch and fill up the rest. put her birthday (explicitly written that it should be DD/MM/YYYY) and click proceed. "error: invalid birthday". try again, error again. for the lulz try inverting DD/MM to MM/DD against their instructions. works, form processed successfully.
gg government of Brazil

slender thistle
#

lmao

modest maple
#

lol

#

Google drive API progress:

Started a subrutine

#

bout it

#

added an entire 1 line to the code

sterile minnow
vital lark
#

what

sterile minnow
#

Oh Translator is shit

modest maple
#

do you mean like every so often after X amount of time

#

you can do a command

vital lark
#

Just check if the argument supplied if an invite is included

modest maple
#

somthing like that?

sterile minnow
#

I would like to trigger that after 10 times by a Command a Webungs message with is sent (like dank memer)

modest maple
#

hmmm

sterile minnow
#

So after 10 times triggering a command such a message as: Vote for me. Sent afterwards

modest maple
#

you could use a dict for each user using the command

#

then just have a counter

#

so once it goes past 10

#

it triggers then gets reset back to 0

sterile minnow
#

but how

modest maple
#

youre js yh?

sterile minnow
#

jup

modest maple
#

ah, i dont rlly know js at all so im not the most help

#

Tim might be a good one to ask tho

sterile minnow
#

who's tim?

modest maple
#

@quartz kindle sorry for the ping m8 but you will know more than me

sterile minnow
#

Would be nice if you can help via DM or sth

quartz kindle
#

wut

stray wasp
#

@fierce wind you want me to code it?

earnest phoenix
#

avoid spoonfeeding

stray wasp
#

Lemme message you cry

earnest phoenix
#

uh no

sterile minnow
#

@quartz kindle can u dm?

stray wasp
#

Trust me

#

@earnest phoenix fine I was about to j-bait him

earnest phoenix
#

ok

#

why

#

also avoid being unhelpful and annoying

stray wasp
#

Cause it would have been funny and amusing.

#

And I would have given direction after

earnest phoenix
#

by wasting time and acting like a child

#

ok

stray wasp
#

Quit mini modding. End of conversation.

quartz kindle
#

@sterile minnow you want your bot to send a message after using a command 10 times right? are the commands locked/disabled afterwards? or they can continue using them? if they can continue using, should it send another message after 10 more have passed? is it per person, like every time a specific person uses it 10 times? or is it global? if anyone uses 10 times? or is it per server? if anyone in the server uses 10 times?

sterile minnow
#

If someone uses a command the counter should be increased with +1 and at the 10th command use the message afterwards. But I do not know how to do that. Yes everything can be used by everyone except bot team stuff @quartz kindle

quartz kindle
#

is it global, per server or per person?

#

the counter

sterile minnow
#

per Bot

#

or server idk

quartz kindle
#

i mean, you have to decide

sterile minnow
#

per bot i think

quartz kindle
#

global:
person A in server A uses comman 9x
person B in server B uses command 1x
send message

sterile minnow
#

yeah

quartz kindle
#

per server:
person A in server A uses command 9x
person C in server B uses command 1x = no message
person B in server A uses command 1x = send message

#

per person:
person A in server A uses command 9x
person B in server A uses command 1x = no message
person A in server A uses command 1x = message

sterile minnow
#

global sounds good

quartz kindle
#

then just make a simple global variable

#

let counter = 0

#

when someone uses a command:
counter++;
if(counter === 10) { counter = 0; message.channel.send() }

sterile minnow
#

okay thx i'll test it

quartz kindle
#

can even simplify to if(++counter === 10) { counter = 0; message.channel.send(); }

sterile minnow
#

okay i hope it will go

#

i'll inform u

#

yeah it worked thanks

earnest phoenix
#
<% var x = client.guilds.get('636090383109128204').members.get(member.user.id).roles.map(r => r.name) %>
            <% var y = client.guilds.get('636090383109128204').members.get(member.user.id).roles.forEach(r => r.hexColor) %>
 <p style="color:<%=y%>">
   <%= x %></p>
#

why does that not color the roles of y?

sterile minnow
#

wich Coding language?

earnest phoenix
#

EJS

#

because you're just using forEach

#

not map

#

i tried .map

#

as well

#

with map it returns an array

#

right

#

so what would i have to do?

#

what do you think, if it returns an array

#

.join ?

#

would that output a valid color

lethal marlin
#

I want to use GenericGuildMessageReactionEventListener with discord jda and I want to get the msg the user reacted to but it doesnt give me back anything. If anyone can help me, please send me a dm :)

vital lark
#

did you print the info in the console?

valid frigate
#

actually setting the log level to debug would help wouldnt it

#

not sure since ive never worked with reactions but might provide more information

earnest phoenix
#

I need help. can someone please help me? my bot went offline and there's a strange error in the log.

modest maple
#

whats the error

#

and what language

earnest phoenix
#

Tr

#

@modest maple

modest maple
#

tr?

earnest phoenix
#

at timeout.client.setTimeout (/rbd/pnpm-volume/e9fe28aa-eb21-4000-b265-97c9e5e57503/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/ClientManager.js:40:57)

at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/e9fe28aa-eb21-4000-b265-97c9e5e57503/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/Client.js:436:7)

at listOnTimeout (internal/timers.js:535:17)

at processTimers (internal/timers.js:479:7)

(node:1488) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

(node:1488) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
modest maple
#

might of been due to the API lag spike just now

earnest phoenix
#

that's the problem

modest maple
#

somthing in the bot timed out

earnest phoenix
#

so the problem will be resolved within day? @modest maple

modest maple
#

probably

#

try rebooting now

#

seems the API lag spike is over

earnest phoenix
#

Ok @modest maple thank you sir

lethal marlin
#

@vital lark yeah I did, its just giving back null, I am using this code:

public class GenericGuildMessageReactionEventListener extends ListenerAdapter {
    public void onGenericGuildMessageReaction(GenericGuildMessageReactionEvent event) {
        Message msg = event.getChannel().getHistory().getMessageById(event.getMessageId());
        System.out.println(msg);
    }
}
earnest phoenix
#

@modest maple

#

dude bot I still rebooted the offline bot from the console this time the console gave error!

#

@earnest phoenix provide some code

#

What?

#

the code that's causing the error

#

do you know?

#

the error was not caused by a code! @earnest phoenix

#

ok then

#

at timeout.client.setTimeout (/rbd/pnpm-volume/e9fe28aa-eb21-4000-b265-97c9e5e57503/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/ClientManager.js:40:57)

at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/e9fe28aa-eb21-4000-b265-97c9e5e57503/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/Client.js:436:7)

at listOnTimeout (internal/timers.js:535:17)

at processTimers (internal/timers.js:479:7)

(node:1488) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

(node:1488) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
#

about 2 hours ago this error appeared on the console at a time and the bot was offline! @earnest phoenix

#

and it still happens?

#

handle your errors properly and discord's api was unstable a few hours ago

#

no problem in the console now, but the bot is constantly rebooting itself on the console, but not online! @earnest phoenix

sudden geyser
#

@earnest phoenix assuming you're on glitch: That error can also happen if the host gets banned.

#

You can test it by running curl -I https://discordapp.com/api/v7/gateway and seeing if it returns 429 Too Many Requests

#

I'm going to assume it's your host as I just tried it out and got the same result. Nevermind, mine just randomly restarted.

#

You'll have to contact glitch support if you want that resolved (or wait it out).

earnest phoenix
#

no problem, I changed the boat's token and the boat's fixed! @sudden geyser

valid frigate
#

wait thats weird

#

so all discord bots on glitch share one ip?

loud salmon
#

uh

#

no

sudden geyser
#

no lol

earnest phoenix
#

what is the prefix for DSL?

vital lark
#

-

earnest phoenix
#

ok

#

it said my account needed to be verified, but.. my account is already verified

#

@vital lark

sudden geyser
#

check your email again

earnest phoenix
#
client.on('message', message => {
    if (message.content == `${prefix}testgf`) {
        if(message.author.id == config.owner){}else{return;}
        if (message.author.bot) return;
        if (message.channel.type === 'dm') return;
        let args = message.content.split(' ').slice(1);
        if(!args) return message.channel.send("lol")
        var id = args[0];

        let request = [
        client.shard.broadcastEval(`this.guilds.get("${id}").name`).then(v => v.reduce((a, b) => a + b, 0)),
        client.shard.broadcastEval(`this.guilds.get("${id}").id`).then(v => v.reduce((a, b) => a + b, 0))
        ];


        Promise.all(request).then(guild => {
            client.shard.broadcastEval(`[this.guilds.get("${id}").name, this.guilds.get("${id}").id]`).then(r => {
                let embed = new Discord.RichEmbed()
                .setColor(`b76e79`)
                .setTitle("Test")
                .addField("Shard Guild Finder", "Test")
                .addField(r[0], r[1])
                .setFooter("Shards")
                message.channel.send({embed});
    });
  });

    }
});```

How?? :c
valid frigate
#

how...what

#

i mean first of all

#

if(message.author.id == config.owner){}else{return;} is redundant

#

use != there

earnest phoenix
#

If i'm in the shard 2 how to get a guild in the shard 1?

valid frigate
#

what

#

broadcastEval is it not

earnest phoenix
#

And that's just a detail....

valid frigate
#

????

earnest phoenix
#

For the message.author.....

valid frigate
#

why are you getting the guild's name

#

what

#

i mean you might as well just get the entire guild object

earnest phoenix
#

This is called a test

valid frigate
#

make your tests more reliable then

earnest phoenix
#

Mmmh

valid frigate
#

and copying and pasting an entire block of code and saying "HOW" doesnt help

#

like

earnest phoenix
#

Yup

valid frigate
#

post a specific snippet you need help with then be like "can someone help me fix this"

earnest phoenix
valid frigate
#

so it's not printing anything

#

have you gotten any errors in the console

earnest phoenix
#
client.on('message', message => {
    if (message.content == `${prefix}testgf`) {
        if(message.author.id == config.owner){}else{return;}
        if (message.author.bot) return;
        if (message.channel.type === 'dm') return;
        let args = message.content.split(' ').slice(1);
        if(!args) return message.channel.send("lol")
        var id = args[0];

        Promise.all(client.shard.broadcastEval(`this.guilds.get("${id}")`).then(v => v.reduce((a, b) => a + b, 0))).then(guild => {

                let embed = new Discord.RichEmbed()
                .setColor(`b76e79`)
                .setTitle("Test")
                .addField("Shard Guild Finder", "Test")
                .setDescription(guild.name)
                .setFooter("Shards")
                message.channel.send({embed});
  });

    }
});

I just want to be able to get the details of a guild from one shard to another

#

And no error in console

valid frigate
#

bruh

#

spoonfeed moment

#

well you have one request in an array

#

therefore making the array redundant aka take the broadcastEval out of the array

#

wait im confused

#

why are you broadcasting eval twice for the same object

earnest phoenix
#

Like this?

valid frigate
#

like what

earnest phoenix
#

Modified βœ…

#

But i have 0 result and 0 error

earnest phoenix
#
client.on("message", message => {
  if (message.content.startsWith(`${prefix}gf`)) {
    if (message.author.id != config.owner) return;
    let args = message.content.split(" ").slice(1);
    if (!args) return message.channel.send("Please specify an id");
    var id = args[0];

    let getg = [
    client.shard.broadcastEval(`this.guilds.get("${id}")`)
    ]

    Promise.all(getg).then(guild => {
      let e = new Discord.RichEmbed()
        .setColor(`b76e79`)
        .setTitle("Shard Guild Finder")
        .setDescription(guild.name)
        .setFooter("Shard Guild Finder");
      message.channel.send({ embed: e });
      console.log(guild)
    });
  }
});```

But `d.gf 646090515934085141`

Console: https://pastebin.com/ZsjdUjsU
Screen: https://media.discordapp.net/attachments/446482621707452426/648045424959029258/unknown.png?width=400&height=215
slender mountain
#

why is there only one value in that array haHAA

#

pretty sure that defeats the point

earnest phoenix
#
Promise.all(client.shard.broadcastEval(`this.guilds.get("${id}")`))```
because this does not work
slender mountain
#

Are you looking to get a list of guilds?

earnest phoenix
#

No

#

Just one guild

#

If i'm in the shard 2 i want to get a guild in the shard 1

slender mountain
#

have you tried logging what: client.shard.broadcastEval(`this.guilds.get("${id}")`) brings back?

earnest phoenix
#

No but

#
Promise.all(getg).then(guild => {
      let e = new Discord.RichEmbed()
        .setColor(`b76e79`)
        .setTitle("Shard Guild Finder")
        .setDescription(guild.name)
        .setFooter("Shard Guild Finder");
      message.channel.send({ embed: e });
      


console.log(guild)
    });```
slender mountain
#

Unfortunately I have never used Shards

earnest phoenix
#

:/

slender mountain
#

But usually a good practice is to log what everything returns so you can make sure it isn't messing up anywhere

earnest phoenix
#

But

slender mountain
#

like console.log(getg)

earnest phoenix
#

I know

#

But

#

[ [ {GUILD INFOS}] ]

#

πŸ‘€

slender mountain
#

idk man, I still think you should log everything else

#

I don't have any experience with shards

earnest phoenix
#

Okay okay

#

But this is a log of getg but later

slender mountain
#

I don't think its usually in two sets of square brackets Thonk

earnest phoenix
#

...

#

I know this but

#

That's what the console returns to me

slender mountain
#

Try doing let getg = client.shard.broadcastEval.. instead of let getg = [...]

earnest phoenix
#

I have already tried this

slender mountain
#

Well what did it bring back

earnest phoenix
#

An error

slender mountain
#

What error haHAA

earnest phoenix
#

Well, for the getg promise to happen, he asked me to put them on because it's a promise.all

#

I go to sleep

slender mountain
#

Maybe try promise.one

earnest phoenix
#

lol....

#

@earnest phoenix can u give me a announce code for discord.js

#

???

slender mountain
#

accounce?

earnest phoenix
#

Wtf

#

@slender mountainyeah?

#

@earnest phoenix sorry for spelling

slender mountain
#

Do you mean announce?

earnest phoenix
#

Yes

#

Why me??

slender mountain
#

What kinda of announce command?

#

Announcement between multiple guilds?

#

Kinda need more info

earnest phoenix
#

@slender mountain normal announcement command

slender mountain
#

Normal as in...?

#

When I do !announce <announcement> what do you want to happen?

earnest phoenix
#

This code

#
client.on("message", message => {
  if (message.content.startsWith(`.announce`)) {
    let args = message.content.split(" ").slice(1);
    if (!args) return message.channel.send("Please specify an announce");
    var ann = args[0];

    message.delete()
    message.channel.send(ann)
  }
});```
#

Ah ok

#

Good bye i'm tired

#

Let me try

slender mountain
#

That only sends it to the channel the command was used in though

earnest phoenix
#
client.on("message", message => {
  if (message.content.startsWith(`.announce`)) {
    let args = message.content.split(" ").slice(1);
    if (!args) return message.channel.send("Please specify an announce");
    var ann = args[0];

    message.delete()
    message.channels.find("name", "announcment").send(ann)
  }
});```
#

Bye

slender mountain
earnest phoenix
#

@slender mountain oo

#

And this one isn't working

#

Give me the error

#

Ah wait

#

And copying and pasting code will never help you

#

Okk

#

Ik

#

Can you give me the error?

#
client.on("message", message => {
  if (message.content.startsWith(`.announce`)) {
    let args = message.content.split(" ").slice(1);
    if (!args) return message.channel.send("Please specify an announce");
    var ann = args[0];

    message.delete()
    message.channels.find("name", "announcment").send(ann)
  }
});```

the error of this code
#

``/app/commands/admin/Announce.js1102 PM

(function (exports, require, module, __filename, __dirname) { module.exports = class NewsCommand extends Command {1:02 PM

``

#

This is the error

#

Lol

slender mountain
earnest phoenix
#

Ah any problem

#

πŸ˜‘

#
client.on("message", message => {
  if (message.content.startsWith(`.announce`)) {
    let args = message.content.split(" ").slice(1);
    if (!args) return message.channel.send("Please specify an announce");
    var ann = args[0];

    message.delete()
    message.guild.channels.find("name", "announcment").send(ann)
  }
});```
#

Test this

#

Ik
It works in the channel which I use the command @earnest phoenix

#

Nope

#
message.guild.channels.find("name", "announcment")```
#

It works on another channel also @earnest phoenix

#

Please read this

#

Oh

#

And stop ping i'm here

#

Ok

#

Again

#

This code

#

Ty

#

It works in the channel I use the cmd

#

I want like

#

.announce #channel text

#

@earnest phoenix

#

I'm a slave?

#

Ah sorry

#

And this code is nice

#

What's the problem?

#

Nothing

slender mountain
#

How about you show what happens when you try to use the command

#

also @earnest phoenix why is ann = args[0] haHAA

earnest phoenix
#

@slender mountain ups

slender mountain
#

that would only get one word

earnest phoenix
#

Yup

#

Wait

slender mountain
#

you would want it to be var ann = args.splice(1).join(" ")

earnest phoenix
#

😢

#
client.on("message", message => {
  if (message.content.startsWith(`.announce`)) {
    let args = message.content.split(" ").slice(1);
    if (!args) return message.channel.send("Please specify an announce");
var chan = args[0].replace(/\D/g,"");
var ann = args.splice(1).join(" ");

    message.delete()
    message.guild.channels.find("id", chan).send(ann)
  }
});```
#

Ty i'm tired and raj thinks I'm a slave

slender mountain
#

sleep then

#

only one stopping you is yourself

earnest phoenix
#

When he's happy I'll go sleep

#

@earnest phoenix no I don't and sorry

#

Test this code

#

Yeah this one ok

#

Perfect

#

Bye

#

Bye

near ether
#

How bad is .broadcastEval on performance?

lethal marlin
#

I am trying to play a music file thats saved on my pc but when I run the command nothing happens .-. Code:

[Command("play", RunMode = RunMode.Async)]
        public async Task PlayAsync(IVoiceChannel channel = null)
        {
            try
            {
                channel = channel ?? (Context.User as IGuildUser)?.VoiceChannel;
                if (channel == null) { await Context.Channel.SendMessageAsync("User must be in a voice channel, or a voice channel must be passed as an argument."); return; }
                var audioClient = await channel.ConnectAsync();

                Stream output = CreateStream("Avenged Sevenfold - 05 - Gunslinger.mp3").StandardOutput.BaseStream;
                AudioOutStream stream = audioClient.CreatePCMStream(AudioApplication.Music);
                await output.CopyToAsync(stream);
            }
            catch (Exception e)
            {
                Console.WriteLine(e + "Stopped audio stream");
            }
        }

        private Process CreateStream(string filePath)
        {
            return Process.Start(new ProcessStartInfo
            {
                FileName = "ffmpeg.exe",
                Arguments = $"-hide_banner -loglevel panic -i \"{filePath}\" -ac 2 -f s16le -ar 48000 pipe:1",
                UseShellExecute = false,
                RedirectStandardOutput = true
            });
        }

Console Output:

09:45:26 Audio #1    Connecting
09:45:27 Audio #1    Unknown OpCode (8)
09:45:27 Audio #1    Connected
earnest phoenix
#

whats the alternative for db.updateValue in quick.db v7

#

i read the docs and tried using set and it didn't work

#

here's my code:

client.level.set(message.author.id + message.guild.id, 1).then(i => {
  let messages;
  if(i.value === 25) messages = 25;
  else if (i.value === 50) messages = 50;
  else if (i.value === 100) messages = 100;
  
  if(!isNaN(messages)) {
client.level.set(`lvl_${message.author.id + message.guild.id}`, 1).then(o => {
message.channel.send(new Discord.RichEmbed()
                    .setAuthor("You leveled up!", message.author.avatarURL)
                    .setDescription(`You are now level \`${o.value}\``)
                    )
  console.log(`${message.author.id} leveled up to level ${o.value} || messages sent: ${messages}`)
})
  }
})  
#

(client.level is a table)

#

error:

(node:27787) UnhandledPromiseRejectionWarning: TypeError: client.level.set(...).then is not a function```
restive furnace
#

use await/async instead of .then

#
  • proper usage of then is .then(smh => smh.edit('Correct .then usage')) proper usage of editing messages
quartz kindle
#

quickdb is notoriously bad for lack of documentation and confusing versioning

#

supposedly, v7 doesnt even use promises at all, it should be all sync, from their examples, but you have to actually look at the source code to be sure as nothing is explained anywhere

broken jay
#

I have question about Eris: how to get latency from Client object?

late hill
#

Latency will differ from shard to shard

#

Which means it's a shard property

restive furnace
late hill
#

That shouldn't even work?

restive furnace
#

it does

late hill
#

You called it functions ?

restive furnace
#

yes in func.js there is func = {
//here are the funcitons
}

late hill
#

oh

#

Why not just use exports

restive furnace
#

can give me example?

late hill
#

You can add stuff to module.exports and then easily require them

restive furnace
#

kk lemme try

late hill
#

require will return whatever you put in there

restive furnace
#

k now it only gives errors on func.js

#

not anymore on the bot file

#

my func.js

warm sonnet
#

is it possible for me to see what servers my bot is in? I know in how many servers it's in but can I see which ones?

twilit rapids
#

What library?

restive furnace
#

me? or totem?

warm sonnet
#

^^

twilit rapids
#

Totempalen

warm sonnet
#

I'm using python

twilit rapids
#

I can see that you're using Discord.js @restive furnace

restive furnace
#

k

twilit rapids
#

Hm, I have no experience with python so I can't help you there, sorry

warm sonnet
#

ah okay, no problem

restive furnace
#

just do print(client.guilds)

#

it returns u all guild ids names etc

warm sonnet
#

thanks, I'll try that right now

restive furnace
#

k i fixed my func.js

tender pagoda
#

Hi
I setup the Webhook in website but I'm not receiving messages if someone upvote.
How to setup

restive furnace
#

ur code rn?

warm sonnet
#

that worked. Thanks!

#

it was bot.guilds for me

restive furnace
#

k

hidden summit
#

k

#

it’s just a variable name

quartz kindle
#

@tender pagoda how did you set it up?

#

where is your bot hosted?

restive furnace
#

Does anyone know how to get this working? js let user; if (args[0]) { user = message.mentions.users.first() || message.guild.members.find(val => val.username === args.join(" ")) || message.guild.members.find(val => val.tag === args.join(" ")) || message.guild.members.find(val => val.id === args[0]); if (!user) { return message.channel.send( "User with the search was not found. Search: `" + args.join(" ") + "`" ); } else { user = await message.guild.fetchMember(user.id); } } else { user = message.author; } //func.log(user); message.channel.send(user.id);this only works with userinfo (no args) and userinfo mention and userinfo userid only

sudden geyser
#

@restive furnace if you're trying to match the username & tag: a GuildMember does not have those properties. You'll have to get the user property after finding it.

earnest phoenix
#

log(`YΓΌklenen komut: ${props.help.name}.`);

^



TypeError: Cannot read property 'name' of undefined

Jump Toat files.forEach.f (/app/bot.js:41:39)

at Array.forEach (<anonymous>)

Jump Toat fs.readdir (/app/bot.js:39:9)

at FSReqCallback.args [as oncomplete] (fs.js:145:20)

#

please help I added a command to my bot and started to get this error in the log. how do I fix this mistake?

modest maple
#

read the error

#

Cannot read property 'name' of undefined

earnest phoenix
#

but the part where he made the mistake is attached to the command. why does this problem occur when the command has everything it needs ? I'll give you the command. @modest maple

modest maple
#

what ever name is, hasnt been assigned anything

earnest phoenix
#

What? Yandex translation doesn't translate correctly what you want to say!. @modest maple

modest maple
#

example:

if X == "hhsuhsgdg":

#

will crash

#

because X doesnt exist

restive furnace
#

@modest maple @sudden geyser how then i can do it, because the idea of that is that u dont need to mention a user like userinfo ChillFish8

#

(sry for ping)

modest maple
#

what

restive furnace
#

the fetching part

sudden geyser
#

get the user object in the find function and compare the username

restive furnace
#

k

sudden geyser
#

@earnest phoenix check your exports by the way

earnest phoenix
#
const Discord = require("discord.js");
const client = new Discord.Client();

exports.run = async (bot, message, args) => {
  let nesne = args[0];
  if (!nesne)
    return message.channel.send("Please User ID?");
  db.set(`blacklist_${nesne}`, "aktif");
  message.channel.send(`**${nesne}** User Black list!!`);
};

exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: ["karaliste","black-list"],
  permLevel: 4
};

exports.help = {
  name: "blacklist",
  description: "[Adminastrator Command]",
  usage: "blacklist ID"
};```
#

look, the command has everything you need, but the error continues!

#

@sudden geyser

sudden geyser
#

check all your files

#

or log each file name until it stops and you'll know what file it is

earnest phoenix
#

MongoTimeoutError: Server selection timed out after 30000 ms at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/f86f98b5-30ff-4543-805e-dac179316552/node_modules/.registry.npmjs.org/mongodb/3.3.4/node_modules/mongodb/lib/core/sdam/topology.js:897:9)

#

how would i fix this?

sudden geyser
#

Anyone know a good API for getting info about colors?

earnest phoenix
#

there is one that literally everyone uses

#

thecolorapi i think it's called

novel oar
#

Hi, I'm trying to make an eval command in Python, and it returns me this error : Unexpected quote mark, '"', in non-quoted string
Does someone knows why it returns me that?
My code :

@commands.command()
async def run(self, ctx, code):
    if ctx.author.id == 465129603208577044:
        execute = await eval(code)
        print(execute)
        await ctx.send(execute)
modest maple
#

what line does it say?

#

send the full error

novel oar
#

@modest maple

Ignoring exception in command run:
Traceback (most recent call last):
  File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 721, in invoke
    await self.prepare(ctx)
  File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 685, in prepare
    await self._parse_arguments(ctx)
  File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 599, in _parse_arguments
    transformed = await self.transform(ctx, param)
  File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 452, in transform
    argument = view.get_quoted_word()
  File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\view.py", line 174, in get_quoted_word
    raise UnexpectedQuoteError(current)
discord.ext.commands.errors.UnexpectedQuoteError: Unexpected quote mark, '"', in non-quoted string
modest maple
#

thats unusual

#

try read through that

#

not sure if thatll be much help

novel oar
#

It doesn't help much, I will ask in API discord server

#

thanks

modest maple
#

its a weird bug

#

might wanna try D.py server

novel oar
#

Yes

#

Don't know it... You have n invite?

modest maple
#

beat u to it shiv

#

xD

novel oar
#

@slender thistle Ok, but why is it returning that?

modest maple
#

its getting passed a "when it shouldnt me

#

be*

slender thistle
#

Have you tried printing code

novel oar
#

@slender thistle I can't, it returns the error before I can print(code)

#

But if I use \" instead of " it works

slender thistle
#

I suggest you ask discord.py server with that since I never experienced that error

novel oar
#

I asked

slender thistle
#

You asked in Discord API server

#

Either wait for answer there or re-ask in discord.py server that ChillFish sent above

modest maple
#

you know

#

thinking about the \

#

i wonder if its it formatting the string?

slender thistle
#

I'm ngl, shouldn't discord.py handle that by default

modest maple
#

idk

#

wasnt there a thing with Ios build of discord automatically adding a '

slender thistle
#

wut

modest maple
#

idk

#

i remember reading somthing about IOS build of discord started adding '

#

but thats probably gone

slender thistle
#

@novel oar I just realized reading the convo in discord.py server

#

Read the consume rest tag they sent

restive furnace
quartz kindle
#

first of all, its a promise, it needs to be then'ed or awaited
second of all, it returns the guild, not the fetch results

#

because this method is used for filling up the guild cache

#

the correct course of action for getting a user by their username should be:
-> guild.members.find
-> if no result
-> await guild.fetchMembers
-> guild.members.find

restive furnace
#

k lemme try

#

this wont work ```
message.guild.members.find(val => val.username === args.join(" "))

#

@quartz kindle

earnest phoenix
#
<head>
    <title>
    </title>
</head>
<body>

Xetaah<br>
and more on your Discord server
<p> Discordtip is tutututu
</p>

<table>
<tr>
<td>Invite Xetaah</td><td>See how to use it!</td>
</tr>
</table>

<p style="background-color:#6b70c4;">
</p>

</body>
</html>
#

css doesn't work

elder oxide
#

??

earnest phoenix
#

@prime cliff

prime cliff
#

Try put some text and see if it shows the blue background

<p style="background-color:#6b70c4;">
Right here
</p>```
earnest phoenix
#

ok sure

#

@prime cliff works thanks.

prime cliff
earnest phoenix
#

@prime cliff and for add a color in all bot page

#

would be ```.body {
background-color:#6b70c4;

prime cliff
#

.body {
}

earnest phoenix
#

rip

#

i didnt add }

#

okay

prime cliff
earnest phoenix
#

let me see if it works xd

#

@prime cliff doesnt work GWpingKanyeLUL

#

should i send all code again? i think it will be more faster

prime cliff
#

You're really bad at css lol

earnest phoenix
#

really bad*

modest maple
#

just saying

#

you havent got it in between <style>

earnest phoenix
#

i mean i used css a lot but stopped using it like for months

modest maple
#
body {
    background-image: url("https://i.pinimg.com/originals/82/8b/ee/828beeae04781fb166ca613ee75603ee.jpg") ;
    height: 100%;
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
} 

.bot-name {    
    color: #fb5a04;    
}
.bot-description {
    color: white;
}
.bot-tags-title {
    color: white;
}
.owners { 
    color: white;
}
.column {
    color: white;
}
</style>```
earnest phoenix
#

oh

#

okey

#

thanks a lot

prime cliff
#

Also some elements may required !important; to override DBL's css e.g color: white !important;

earnest phoenix
#

@prime cliff but for background?

quartz kindle
#

@restive furnace val is a member, members dont have usernames, users do

#

val.user.username

restive furnace
#

Thanks it worked!

nocturne lotus
#

Check this bs

#

@modest maple

earnest phoenix
#

i mean

#

it's not bs

#

you just don't handle your errors properly

nocturne lotus
#

I do and the bot does keep running even after that but

modest maple
#

is it supposed to be tts?

nocturne lotus
#

It doesnt have perms to send embed

#

Hmm?

modest maple
#

tts=tts

earnest phoenix
#

you should always do permission checks before executing the command

modest maple
#

not needed

nocturne lotus
#

That's the core module

modest maple
#

i mean the tts part btw

#

oh

#

wait

#

good point

nocturne lotus
#

@earnest phoenix wdym?

#

How do I do that haha

modest maple
#

he means check the bot has the ability to send embeds

earnest phoenix
#

check if your bot can do x before doing x

nocturne lotus
#

No i get that

#

But how

modest maple
#

you can compare the permission ID the bot has to what it needs

earnest phoenix
#

browse the docs

#

πŸ€·β€β™‚οΈ

nocturne lotus
#

Epic

#

But that won't solve it will it

modest maple
#

well i mean

#

it does sorta

#

cuz if its missing perms

earnest phoenix
#

you'll prevent yourself from getting errors

modest maple
#

you can DM the user

#

and tell them

earnest phoenix
#

it's bad practice to dm the user

#

reply to them in the same channel they executed the command

modest maple
#

depends

#

if they cant send messages

#

theyre a bit screwed

#

xD

nocturne lotus
#

Put 3 except blocks XD

#

One for each error xddd

modest maple
#

nuuu bad practice

#

xD

nocturne lotus
#

I think I'll just let my bot rest for now here cuz it's working fine on all the other guilds

modest maple
#

saying that

#

we worked out what it is

#

your bot is muted

nocturne lotus
#

Oh !

modest maple
#

so it cant send anything rn

nocturne lotus
#

So how do I like unmute it 😳

modest maple
#

ig fix the issue

nocturne lotus
#

Wait no way it does

modest maple
#

apparently it was sending unknown command on every thing that included its prefix

nocturne lotus
#

It will only respond if there is a !dfb

#

At front

modest maple
#

ask a mod

#

cuz i cant actually see any messages from the bot

#

so not sure

nocturne lotus
#

Yeah exactly

#

That's a false case wth

modest maple
#

its not fake

nocturne lotus
#

Whom do I contact any idea?

slender thistle
#

Chill, are you familiar with libraries to play with pixel colors in real time

modest maple
#

not rlly

#

my friend does

nocturne lotus
#

Hmm?

modest maple
#

but i dont rlly use it much or at all

slender thistle
#

@nocturne lotus Contact the moderator who muted your bot

nocturne lotus
#

Okayy

#

Like DM?

slender thistle
#

Yeah

#

Do you know the lib name, Chill?

modest maple
#

well

#

xD

slender thistle
modest maple
#

my friend does real time pixel colours in pygame

slender thistle
#

Fucking 'ell

modest maple
#

i shit u not

#

xD

nocturne lotus
#

I dmed him

modest maple
#

the worst thing is it fucking works xD

nocturne lotus
#

Hope he replies quick

nocturne lotus
#

He did reply super fast

modest maple
#

what did he say

nocturne lotus
#

He's checking it in test server

near ether
#

how to i handle dms to a shard if every dm is sent to shard 0?

oak minnow
#

Ok so I'm kind of having a little bump in my code. Basically I'm trying 2 make a bug report command. So something like this -bugreport it says error 1 and my proof or image is

#

then what i need it 2 do is send the message 2 a private bug report channel with the image. The code i am currently using is right here >>> https://hastebin.com/oxocoluvih.js So if any 1 knows how 2 add this feature, just ping me. NOTE: I have tried multiple things 2 try and do this but none work. Thanks for any/all help!

near ether
#

How can I dedicate one shard to taking care of certain functions/commands?

#

Just a simple if(shard.id === n) return x?

#

else (return Y)

#

And is it possible to have one shard not deal with guilds at all? Just leave it hanging around strictly for DMs?

modest maple
#

not really no @near ether as you cant specify what guilds are on what shard along with depending on the user they will be connecting to a diffrent shard

near ether
#

Oof

#

In that case, how can I make shards that aren’t 0 handle DMs?

modest maple
#

once again

#

not rlly possible

#

as that means

#

if a user DMs your bot that is on any other shard other than 0 it just wont respond

#

which just isnt good

near ether
#

Yea my bot uses DMs for a turn based game but if sharding forces DMs to shard 0 then I guess that’s a rip

mossy vine
#

this is specifically for d.js but the core concept can be adopted to any library

earnest phoenix
#

you literally don't have to track anything i think

#

the api provides the uses number in the invite object

modest maple
#

yh

mossy vine
#

huh so that guide is outdated now? (or just useless?)

earnest phoenix
#

it has always been like that

modest maple
#

i believe atleast for D.py the invite gives you the uses

#

but it should for everything

#

as it tracks it for servers

earnest phoenix
#

that guide is probably for tracking who used what invite on member join (which spams the API)

modest maple
#
Task exception was never retrieved
future: <Task finished coro=<Server_Response() done, defined at C:/Users/ChillFish8/Documents/The_Innkeeper_Database/TheInnkeeper.py:62> exception=gaierror(11001, 'getaddrinfo failed')>
Traceback (most recent call last):
  File "C:/Users/ChillFish8/Documents/The_Innkeeper_Database/TheInnkeeper.py", line 66, in Server_Response
    description=(f"**OrcPub Server response:**\n"
  File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\pythonping\__init__.py", line 52, in ping
    comm = executor.Communicator(target, provider, timeout, socket_options=options, verbose=verbose, output=out)
  File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\pythonping\executor.py", line 224, in __init__
    self.socket = network.Socket(target, 'icmp', source=None, options=socket_options)
  File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\pythonping\network.py", line 21, in __init__
    self.destination = socket.gethostbyname(destination)
socket.gaierror: [Errno 11001] getaddrinfo failed
Exception ignored in: <function Socket.__del__ at 0x0000023C41DCE678>
Traceback (most recent call last):
  File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\pythonping\network.py", line 56, in __del__
    if self.socket:
AttributeError: 'Socket' object has no attribute 'socket'
Exception ignored in: <function Communicator.__del__ at 0x0000023C41DDCC18>
Traceback (most recent call last):
  File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\pythonping\executor.py", line 233, in __del__
    if self.socket:
AttributeError: 'Communicator' object has no attribute 'socket'
#

oh what would we do without the custom Lib not liking /

near ether
#

How do you do webhooks with sharding? Won’t multiple shards be already occupying the same given port?

vital lark
#

webhooks don't need sharding

quartz kindle
#

have your webhook server on your sharding manager

#

and then on vote send a message to the relevant shard

#

or do whatever with it

valid frigate
#

a webhook server?

#

iirc you just have to create a webhook, slap that shit in your code and send payloads to it

#

i dont see the server aspect of it unless you're talking about like a wrapper to interface with the webhook or smth

modest maple
#

sometimes

#

i just hate google

#

and their freaking api

#

how is it so complicated and have such awful docs

#

smh smh

quartz kindle
#

i just assumed he was talking about DBL webhooks

#

for which your bot runs a server to receive them

#

for sending webhooks to discord, sharding is irrelevant

earnest phoenix
#

hey i just created a canvas picture how do i put it to a embed

quartz kindle
#

add it as an attachment

#

and use the attachment url

earnest phoenix
#

.attachFile(new Discord.Attachment(attachment, 'xd.png'))
.setImage("attachment://xd.png"); ??

quartz kindle
#

something like that yes, test it

earnest phoenix
#

this was a disaster but i did it

modest maple
#

what

earnest phoenix
#

the screenshot didn't send

#

wow

#

so, quick explanation

#

server and client run mods which are able to connect to a c# signalR server

#

that way i can easily exchange data between programs made in entirely different languages

modest maple
#
  1. nice
earnest phoenix
modest maple
#
  1. every heard of multiple screens?
#

xD

earnest phoenix
#

i want to buy a second monitor

modest maple
#

overall tho thats rlly quite cool

earnest phoenix
#

but i'd also like to buy a wall mount and i can't find one around me

#

so i have to order one

modest maple
#

hmm

#

i might get two more monitors at some point

earnest phoenix
#

i've seen people use superwide curved but that's meh

#

not my forte

modest maple
#

nah i cant stand super wide curve

#

just doesnt work for me

earnest phoenix
#

same

opaque eagle
#

So I'm working on this kick command... In line 33, I want my bot to send an error when the user to be kicked has a higher role than the bot itself. But, the bot surpasses that checkpoint on line 33 and sends a Missing Permissions error. The odd thing is, it does error on line 30 when appropriate, but not on 33.
Code: https://gist.github.com/SinistreCyborg/f147da54b4d8ee7a3c1547675c22054f

#

(Eris)

zealous veldt
#

In a class, can I set up a setter or getter like this?

class whatever {
    constructor() {}

    get 'x.y' () {}
}```
opaque eagle
#

like whatever.x.y?

#

or whatever.x and whatever.y

languid dragon
#

yes

zealous veldt
#

ok cool

#

thanks @languid dragon fren

languid dragon
#

wanna know some more dumb shit you can do?