#development
1 messages · Page 1427 of 1
example if your prefix is '!' that would match:
"! help"
it wouldn't
it would match "! + help"
^
without the plus yeah
ahh
I were answering this
Is there any way to lower ping to discord servers in my bots code?
no
Darn
get a server close to either NYC or san francisco
the api servers are located there, it can significantly reduce latency
I use physical servers and I live a while away from there I would but I can't sadly
oof
Is there anyway to use some sort of CDN possibly?
for what 🤔
Yeah good, point it's a stupid question
i mean if you absolutely don't have any other option, you could go through your code and optimize every nook and cranny
I could
for example if you have any database calls, consider caching etc
I don't have any database calls in my bot it's all local
ah
And most of my code is already optimized for the most part
I'm using command handlers I'm using the least amount of code I NEED and I still need to make it so if you do E! Instead of e! It would work it doesn't do that yet
What is your ping? I wouldn't bother if the ping is anywhere around ~100
That's more than enough. I wouldn't be too worried about it.
But I can do more
You can but, I don't see a reason you want to reduce it even further. Do you have a specific purpose for low response time commands/interactions?
Not really, now that I see it I'm trying to optimize it like I would a website or something like that
Yeah I guess 59 MS is ok
any of yall thinking of developing a new Rainbow Bot
My bots latency is always like 100
But I don't get why
My servers are in states island
And when I heroku'd it it was like 20
Same code
yep I tried other hosts too its was about 100 ms.. On heroku i get about 20 - 14
Maybe cuz their servers are close to the gateway or they have good bandwidth
I doubt it
My heroku was in Virginia
And my current one is galaxygate in New York
So it should be even better
hm
does someone know how to do this
bot.comnandusages = 0
on_command:
bot.commandusages += 1
I'm slightly ignorant towards webhooks; however, are we essentially opening a port on our servers and allowing top.gg to send information?
do you know, how to do that on top.gg ?
https://top.gg/bot/628400349979344919 here you can scroll down
yeah u have to do port forwarding
haha python no ++
it's basically a peer-to-peer CDN
https://arc.io
there's but it's way slower since it copies the old value, or simply use ++<var>
For local testing, I have to port forward?
yes
top.gg needs to be able to hit your webserver
grammar 100
tldr webhooks are reverse apis
instead of you making requests to the api, the api makes requests to you
Right, it’s a push-based system.
The only problem, at this point, is local testing - but I should be able to figure that out 👍🏻
Thank you for your help!
Already fixed
How can I have all results available ? (the 2 wait_for in my asyncio.wait) ```py
def checkchallenger(reaction, user):
return user == ChallengerUser and (str(reaction.emoji) == '✋' or str(reaction.emoji) == '✊' or str(reaction.emoji) == '🖖') and reaction.message.id == ChallengerMessage.id
def checkchallenged(reaction, user):
return user == ChallengedUser and (str(reaction.emoji) == '✋' or str(reaction.emoji) == '✊' or str(reaction.emoji) == '🖖') and reaction.message.id == ChallengedMessage.id
done, pending = await asyncio.wait([
client.wait_for('reaction_add', timeout=120.0, check=checkchallenger),
client.wait_for('reaction_add', timeout=120.0, check=checkchallenged)
], return_when=asyncio.ALL_COMPLETED)
try:
stuff = done.pop().result()
print(stuff)
Hey I need help in connecting my discord.py to PostgreSQL database on RDP(windows), it works perfectly on my local pc but when I try to connect to it from RDP , create_pool throws an error that host denied the connection request.
I have explained my problem more specifically here,Please answer if you can https://stackoverflow.com/questions/65121640/how-to-connect-to-my-postgresql-database-from-rdp
I have a discord.py bot and I host it on Google Cloud RDP (windows). I was working and testing PostgreSQL database on my local computer and it was working like charm now when I tried to use the sam...
so you want to use the local Database on your PC from a server outside of your network?
I just created my bot and was able to give it the ping command and it just went offline. Is there a way to fix that or do I just have to wait it out?
check what caused your bot to go offline
How do I do that?
Check your console for any errors.
ok
Guys I’m trying to code an help me command but it’s not mention the user... can I get advice
what language, what library and what exactly are you trying to do
message.reply()
I'm trying to do a event log w/mongoose but...
client.on('channelCreate', channel => {
channel.guild
^^^^^
guild of undefined
})
I need property guild, how i can have it? (sorry for my english, i'm not en)
message.guild.members.cache.get('697348519295713302').displayAvatarURL() whats wrong in it ?
member.user.displayAvatarURL()
pls help me
What library?
I made a for loop, which will sent messages to other guilds 8 times each in one minute, how can I built in a sleep, that it does not overload the api
You should be able to get the guild that way
just incase, can you send the code? not just the error
you should be able to get the guild doing something like this: let guild = channel.guild
Ok
channel is undefined for them
is it okay, without an limiter?
No guild property
Can you not
stop it
Ban
@humble rock do u have an idea in my prblem?
fuck off
bruh pls stop use #memes-and-media
@weak parrot
ty
you know it's cringe when cry had to ping a mod
i hate children
Ban he!
@earnest phoenix you hate yourself ?
im 50o yaers
OF in 6 months, nice
@earnest phoenix when you get adult you'll die 
because it can be a DM channel, so they would not add the guild property in the properties list, but you'll see that if you add console.log(channel.guild) (if the channel is in a guild) then it will work
@strange warren do it in #memes-and-media at least
Ok
ban
the thing is he thinks he's funny
underage probably
Banned Mennesken#3750 (@strange warren)
noo not my mama :(
:D
i'm concerned that those are the only words in his vocabulary
Thanks
thank chu
They almost fucked my mama :(
Sorry was just busy with internship 😔
Node "localhost" encountered an error: connect ECONNREFUSED 127.0.0.1:2333.
Damn
Help
Insta ban
it took 5 minutes but yea
Anyone can help explain this
No
nice
"ECONREFUSED" means that the it refused connexion
Well lavalink said this
2020-12-02 08:39:19.996 ERROR 2576 --- [ main] o.s.boot.SpringApplication : Application run failed
oof
oooooooooooh you're usin lavalink
No idea what that means
I have application.yml working
Do you have logs?
ye
spring logs
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_241]
at java.lang.ClassLoader.defineClass(Unknown Source) ~[na:1.8.0_241]
at java.security.SecureClassLoader.defineClass(Unknown Source) ~[na:1.8.0_241]
at java.net.URLClassLoader.defineClass(Unknown Source) ~[na:1.8.0_241]
at java.net.URLClassLoader.access$100(Unknown Source) ~[na:1.8.0_241]
at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.8.0_241]
at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.8.0_241]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_241]
at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_241]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_241]
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93) ~[Lavalink.jar:na]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_241]
at lavalink.server.Launcher.getVersionInfo(Launcher.kt:50) [classes!/:na]
at lavalink.server.Launcher.getVersionInfo$default(Launcher.kt:49) [classes!/:na]
Yea.........
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_241]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_241]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_241]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_241]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [Lavalink.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [Lavalink.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [Lavalink.jar:na]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [Lavalink.jar:na]
@pale vessel Logs^
you're coding in xml ?
that isn't the full stacktrace
doesn't look like much yeah
It asks me to send in message file
ok.
you can post it in hastebin
hastebin is very funny with their extensions
you're running an older version of java
how do I update it 
i found
this
,v,
the same error
as yours
:o
how do I update java 
have you tried googling it
windows - https://adoptopenjdk.net/
linux - use your package manager
ok.
ooooooooh linux
windows seven, ok
oh
adoptopenjdk also offers prebuilt binaries for linux and mac
sweet
so on linux you just download the tarball
the bot page?
,_, we'll never get the answer
client.on("ready", () => client.user.setPresence({
activity: {
name: "d!help | Luckie#6313 is the best because he made me!",
type: "PLAYING"
},
status: "dnd"
}));```
Why if i use this code his status is not "dnd" but online

Hey
Do you any npm package
which can return name of all songs
from a spotify playlist link
if you know
Then ping me
yea there is litterally an api "spotify" '-'
@delicate shore https://www.npmjs.com/search?q=spotify
Ok thanks .
{
"artists": [
{
"external_urls": {
"spotify": "https://open.spotify.com/artist/5a2w2tgpLwv26BYJf2qYwu"
},
"href": "https://api.spotify.com/v1/artists/5a2w2tgpLwv26BYJf2qYwu",
"id": "5a2w2tgpLwv26BYJf2qYwu",
"name": "SOPHIE",
"type": "artist",
"uri": "spotify:artist:5a2w2tgpLwv26BYJf2qYwu"
}
],
"duration_ms": 188520,
"episode": false,
"explicit": false,
"external_urls": {
"spotify": "https://open.spotify.com/track/18yTgk0VgjB9XDj8h2q6Td"
},
"href": "https://api.spotify.com/v1/tracks/18yTgk0VgjB9XDj8h2q6Td",
"id": "18yTgk0VgjB9XDj8h2q6Td",
"name": "JUST LIKE WE NEVER SAID GOODBYE",
"popularity": 34,
"preview_url": "https://p.scdn.co/mp3-preview/d5790004de973f83756311075125ffc965e522c8?cid=a46f5c5745a14fbf826186da8da5ecc3",
"type": "track",
"uri": "spotify:track:18yTgk0VgjB9XDj8h2q6Td"
}
]```
To get the name part
I will just do array.name
well uh
it's an array
you need to index it
i really don't understand why people bloat their node apps with REST api libs
like bruh you're already using a non typed language there's nothing to wrap
if what you sended is a variable, var[0].artists[0].name
Okk thanks
Node "localhost" encountered an error: connect ECONNREFUSED 127.0.0.1:2333.
(node:149) UnhandledPromiseRejectionWarning: RangeError: No available nodes.
Criiiiiiiii
to what did you try to connect?
Omg
Used their example.
And this happen.
so everything is on the same machine right?
yes
do you need to allow connections?
I don't know.
bcs it looks like whatever tryed to connect to port 2333 didnt found anything
Im connecting to port 7000
well the error expects 2333
what the
Im using their example
why do people with big bots not publically talk about/document what they do, implementation wise to scale their bots?
for example, its not as easy as just "i scale by adding more vps's"... theres code and infrastructure design that goes into making that possible.
I'm thinking of sharing what i've done, anyone interested in it if i do?
a lot of it if written generically works for any programming language
Mee6 made it public atleast what they do
where?
I guess that can be good yeah
a
Im using using their example and I got the error
Their Example: https://github.com/Solaris9/erela.js/tree/master/examples
the problem is from your lavalink node
Yes I am interested
not from the code
how do I fix that
i'm somewhere in the middle between 'small' and 'big' imho
because im not yet at the point where discord give better ways to scale shards up and down without restarting clusters
not till i get to like 200k servers
if you know how to setup dbl web hook u know how to setup ll node
well Kubernetis makes it super easy to scale
Im just using their example bruh ;-;
I dont 
if you need more horsepower add another worker node
you still have to code for that
yea thats sadly the issue
you cant just dump any old bot in a kubernetes and have it scale
thats the bit people dont share
but you can automate kubernetis so its possible
but i guess they wont make the scaling part public bcs its probably annoying to make or they dont want give everyone an easy way to compete
knowing how to scale doesnt give you any competitive advantage
how to setup ll node :cri:
you gotta get the users to invite your bot first to need it
well idk there is probably a stupid reason
the article contains some code snippets in how they scale
see the problem i see with discord is...
imagine i have a bot with 32 shards yes
and i have to scale up to 48 or 64
i cant just 'add 32 shards'
ALL the shards must be restarted together
because adding more shards shuffles around what servers belong on which shards
cant you make a rolling update with Kubernetis?
as its like guild_id >> 11 % shard count
and im sure that for huge bots, they do it in a way that doesnt need the total restart to scale up or down, but this is something discord are keeping tight lipped on
rolling update or not, adding extra shards means an update of every cluster, yes?
because each server then belongs on a different shard id and all shards must reconnect to establish what servers are on them and tell discord how many shards total ther are
the identify message says 'im shard X of Y', and Y has changed, so every instance needs to redo that
i'm certain that behind the scenes the monopoly bots like mee6 and dyno have dumpster fires
does anyone know a good place to host a bot ?
check out pins
thanks
cant you just force a shard id? (never did sharding so idk)
you cant assign guilds to shard ids
the only possible way to do seamless rolling update would be to tell old shards to disable specific guilds when a new shards connects
for example, new shard 0 connects, broadcast all its guild ids to all old shards, old shards flip switch to ignore all messages coming from those guilds
repeat for every new shard
once an old shard has disabled all its guilds, kill it
yeah
do anyone have any bots that track how many people they have invited to the server. and you can make it so it automatically gives you somthing when you get a certain amount of invites???
cool thx
That seems pretty easy actually
I have made myself an invite manager bot
I can put something like
if (invites >= 25){
user.roles.add()
}
its not nearly as easy as it could be if discord actually provided invite information in the memberAdd event
jeez my respect for yall and this programming thing has increased lol v clever
the inviter will get the role
wait so you can do the thing i asked
ye but to increase that number you have to fetchInvites again every time someone joins
which is a pain
async function update(guild) {
let invites = Array.from(await guild.fetchInvites())
let guildInvites = []
await invites.forEach(i => {
let obj = {
"inviteCode": i[0],
"uses": i[1].uses,
"inviter": i[1].inviter.id
}
guildInvites.push(obj)
})
db.set(`${guild.id}.invites.${guild.id}`, guildInvites)
}
ahh ok cool well i found 1 which looks alright on top.gg
but if you make 1 that is :do anyone have any bots that track how many people they have invited to the server. and you can make it so it automatically gives you somthing when you get a certain amount of invites??? dm me pls thxxxx
i think they want a bot that does it, not code it themselves
Do you recommend using PRAW for reddit memes? with python 3.9
Do u know how to make the bot send a message when it joins a server (discord.js) I tried to do it but didn't work
i suggest sending it through the systemchannel of that server if one is set
client.on('guildCreate', guild => {
<channel>.send()
})
@earnest phoenix
client.on('guildCreate', guild => {
guild.channels.cache.forEach(c => {
c.send('Hello!')
})
})
Do you recommend using PRAW for reddit memes? with python 3.9
what the fuck
yes
lmao
imagine it being added to a server with 500 channels
PAIN
ok ye bot trash
one of my bots is in a server with 500 channels lul
cwikks that bot u were just making about the invite count and the auto role added when getting to a ceratin amount of invites???
are you just messing around with t or are u gonna make it legit cuz i need it haha
i like ur prof pic of doggo
Sometimes my bot gets a 30-second gateway latency, plus super slow API response timea, and I'm not sure why
is this correct?member.roles.add(guild.roles.cache.get(`8475364274834952647`))
I've never used nginx in the past and I can't figure this out; Where do I put the config files like the one at the top of this example https://gist.github.com/thehowl/73cae5c3fb75d3557d3d724ddaa15d28
you can just .add("8475...")
Hey would be glad if anybody could help me here or had similar experiences:
I'm using ytdl-core for my music bot bot recently i keep getting this stupid error when i try const result = await ytdl.getInfo(url):
ytdl-core version ^3.4.2
what os @summer acorn
Ubuntu 20.04
okok
ah oke lemme login real quick to my server
gotcha
should be in /etc/ngnix
the main nginx.conf goes ^
the rest of the files you define in nginx.conf using includes
yes ^^
I dont use nginx, i use apache2
for example in the link you posted, nginx.conf has include /etc/nginx/conf.d/*.conf;
stage 1 complete lol
which means it will look for other conf files in that folder
oh I see, one of the people on the vps uses nginx for something, and I checked that folder and it was empty, so I was confused
apache2 u just drop the conf in sitesavailable then do a2ensite and type in the name

rightttt
for example getting messages from a channel the bot cannot access
this part breaks my code somehow but no errors appear let dm = bot.db.get(`dmmessage_${reaction.message.guild.id}`) if(dm === null) return dm = "{transcript} is your log" dm.replace("{transcript}", data)
anyone know why
guild.members.cache.get() doesnt work?!?!?!
it does, if you have caching enabled
could u stop guessing?

google -> "insert lib name how to enable cache"
look at the results
tf?
Im looking at it
how do i get a json value that is in <this image>
using node-fetch
I dont see an official docs site
how do i get a json value that is inside of something
no? I've found it just by taking a glimpse at the image
Um... in discord.js all caching is enabled by default and there is no official way to disable it (only exception to this are message caches)
Discord doesn't cache all guild members if there are more than 200 afaik
afaik
parentjson.anotherjson.yetanotherjson.someproperty
how do i get the parent json
that's the json you're trying to access
that was just an example
think of . as opening folders
a json can have more jsons
and then?
and that's it, it returns a promise which contains a GuildMember object
alrigthy
UnhandledPromiseRejectionWarning: ReferenceError: response is not defined
you're dealing with the json in the wrong place probably
for some reason roles is undefiend
show the code
guild.members.fetch(memberId) returns a promise, not a GuildMember object. you need to resolve the promise using await or then
i wanna see what on earth that'd be instead
ah right
ooh.. makes sense
@scenic kelp here too
Hey would be glad if anybody could help me here or had similar experiences:
I'm using ytdl-core for my music bot bot recently i keep getting this stupid error when i try const result = await ytdl.getInfo(url):
I tried several ytdl-core versions
ERROR: Error: Error parsing info: Unable to retrieve video metadata
how would i save an embed and then later outside of the code be able to change the color and title of it
how do i use the top.gg token and make it log the user who voted, and log it in the console? I'm on discord.js
@astral yoke you can't change the color without writing code to edit it
I want to edit it
"Outside of the code" ?
so basically
let sent = message.channel.send(new Discord.MessageEmbed()
.setTitle('**Suggestion**')
.setDescription(message.content)
.setColor('75188c')
).then(embedMessage => {
embedMessage.react(bot.emojis.cache.get("756063599469789264"))
embedMessage.react(bot.emojis.cache.get("756063645317726278"));
})
message.delete()
}```
was wondering how to make an acceptsuggestion command which changes the color and title to like "Accepted Suggestion" with setting the color green
Like on react
Fetch the message and edit the embed properties.
how would i edit the embed properties though?
This is what I do most of the time @astral yoke
message.channel.messages.fetch(ID).then(OldEmbed => {
NewEmbed = OldEmbed ;
NewEmbed.embeds[0].color = xxxx;
OldEmbed.edit({embed: NewEmbed.embeds[0]});
})
Whatsthe NewEmbed = OldEmbed part?
NewEmbed will get your OldEmbed's properties.
May be a better way to do it, I'm not sure but this work just fine
If i enable fetchMembers how long will the bot take to turn on?
I have tried it on my testing bot which is in 3 servers and its taking a long time to turn on
So I was wondering it its even worth it to put it in my main bot
If
That isn't suggested to have enabled at all. What is your use case for having all members fetched at startup?
to get all members
what should i put here
For example in client.users.cache
Itd be better if it has access to all members
Instead of the cached ones
Having the fetchAllMembers client option is really bad for your cache memory since as your bot grows, the amount of ram consumed keeps increasing. This is not recommended for larger bots.
However, to answer your first question, yes, the login times do increase but, how long it would take before it fires the ready event is completely dependent on how many members that the bot had to cache.
How do I get the name of an id of a role?
Well how before, you could turn on your bot just as fast as now and still be able to get all members?
You have to get the role from cache and then access the name property on it.
guild.roles.fetch()
then how do I get the data
let roles = await guild.roles.fetch()
roles.get()
```?
I'm not sure I quite understand this statement.
thank you @valid grotto
No problem, works fine?
Server vanity url?
dbl
Yeah, I added a title part which changes the title, works perfect, exactly what I wanted @valid grotto
You provide the role id in the fetch()
i mean
I have to do it multiple times
it will lag the bot
I have an array of which roles to collect
its better to cache it then run .get() multiple times, rather than running .fetch() multiple times
Once you fetch the roles, you can get the desired role by doing <RoleManager>.cache.get('ROLE_ID')
let roles = await guild.roles.fetch()
roleArray.forEach(r => roles.cache.get(r).name)
correct me if im wrong
ok now
You're trying to get the name?
Ah yes now
right
Do r.id
roleArray is an array that consist of multiple role ids
Also, you should be doing something with the name since right now, you're not storing those names anywhere
That means that the role list does not have the role id that you were searching for.
ok
hey how do i set my embed in python to a random color each time the embed gets called?
i know how to in javascript, just can't get the hang of it in python.
generate a random hex each time
hmm, i just found this... and it looks easy.... imho:
https://www.digitalocean.com/community/tutorials/how-to-configure-mysql-group-replication-on-ubuntu-16-04
i might make two containers on my server and put mysql in them to try it
right now im running on a single instance
RandomPuppy(RandomSub).then(async url => {
const Image = ({
files: [{
attachment: url,
name: "Dogo.png"
}]
})
const RedditEmbend = new Discord.MessageEmbed()
.setTitle("Here's a cute image of a dog!")
.setImage(Image)
.setURL(`https://reddit.com/r/${RandomSub}/`)
.setFooter(`*Dog image from r/${RandomSub}*`, process.env.bot_logo)
.setColor("#0099ff")
.setTimestamp()
message.reply(RedditEmbend) ``` `Unhandled rejection error! DiscordAPIError: Invalid Form Body
embed.image.url: Could not interpret "{'files': [{'name': 'Dogo.png'}]}" as string`. I don't know what to do.
setImage requires a string as the input iirc
Yeah. The thing I am stuck with is how I would add the image.
you should be able to do Image.files[0].attachment
but if not you have to check the docs
That would send a blank image.
what do you mean by a blank image?
blank image
so no image
Yeah.
because I would assume a blank image has size but is either all white or invisible
It doesn't attach.
im not sure you should check the docs
async def on_message(message):
if f"<@!{client.user.id}>" in message.content:
what would i use
instead of message.content
for just the message
because if it's in the content then you can do like p!battle @(bot) and the bot would send it
like
if its in the content
it would send if it's included
i want it to be
just the ping
does py have a built in mentions
You can do if client.user.mention in message.content
like how djs you can do message.mentions
or iirc user.mentioned_in exists too
but how would i make it
so it only responds when ONLY the ping
not the ping and some word
would message.content not be p!battle @(bot)
because if i mention my bot
it would send that message
when you ping it
and it's really annoying
i want it to send the "welcome" message when its pinged individually
Try it
Well the issue is Discord for some unknown to Zeus reasons has two types of mentions

So, yeah. I take my words back regaring the user.mention thing and advise you to do it the way you did
yeah i got it
async def on_message(message):
if f"<@!{client.user.id}>" == message.content:```
just had to do ==
thanks tho
Include the mention without the exclamation mark also
k
use or for that
you can just use in
so would you not just want to do if "<@{client.user.id}>" in message.content
so any message with a mention would work
that's literally what they are doing
check_with_exclamation_mark or check_without_exclamation_mark
oh so if... == message.content or if!@... == message.content?
like two if statements?
When you use or you don't need another if
mhm
the ! in the <@!>
What Cloud said
does someone know how can I build a standalone c++ executable? (CLion/MinGW)
You could try asking Brain if he has ever attempted to do that
the code runs fine when executed from clion, but the generated .exe gives 0xc000007b error
if f"<@{client.user.id}>" == message.content or f"<@!{client.user.id}>" == message.content:
so that?
Yes
inb4 message.content.lower() KEKW
.lower() is kinda unnecessary there tho
yeah since it's a ping
yeah, it's just a mention
@thick gull
theorethically there are lower/upper versions of numbers
I think he was just saying that mentions are really finicky
computers just don't use them
for once in a lifetime, I'm doing this
r/wooosh
tbh what is r/wooosh?
not a wooosh at all tho
How is that cringe though
It was a joke but definitely not a decent one
considering I've seem even worse things in this channel, I'd not be surprised if someone actually .lower() a number
building.lower()
kekw
69.lower()
[member.lower() for member in guild.members if member.nick.startswith("!")]```
so should i do .lower()?
Nah, not in this case
print message.content ffs
In color or black and white?
so this happened
when i ping it
it works
and prints @feral valve
but when my friend does
it doesn't print anything
async def on_message(message):
if f"<@{client.user.id}>" == message.content or f"<@!{client.user.id}>" == message.content:
embed = discord.Embed(title="**PandaMod**",
description=f"**Hello** {message.author.mention}**!  I'm PandaMod, a multipurpose, musical, fun, cute bot! To get started, my prefix is** `{prefix}` **and you can do** `{prefix}help`** to pull up the full list of commands. Enjoy!**\n\n[**Support Server**](https://discord.gg/WN9TDts)\n\n[**Invite**](https://discord.com/oauth2/authorize?client_id=750179163582890034&permissions=8&redirect_uri=https://discord.com/invite/WN9TDts&response_type=code&scope=bot)",
url='https://pandamod.xyz',
color=0x2F3136)
embed.set_thumbnail(url="https://i.ibb.co/4gvzWRr/Panda-Mod-2-copy-346.png")
embed.set_image(url='https://media.giphy.com/media/Dy2XVRrADOlg6x35TN/giphy.gif')
embed.set_footer(text="")
await message.channel.send(embed=embed)
print(message.content)
await client.process_commands(message)```
you dont have to set a footer if you arent going to put anything in it
thanks tho
Where do I downgrade from this clusterfuck of an update
omg shiv
do u know
what just happened
since i put the print before
it sends me every message
people are saying right now
omg privacy invasion
lemme fix that
Ah right
lmao
Probably a stupid question but
Are you sure the mentioned bot is the same bot that's running your code
uhhh odd question
should be
i mean the only other one i made
is currently offline right now
so it should be this one
works now
when my friend pings it
you should create another version of your bot just for testing
^
already have one
then how is it sending you all the messages that people send?
let bUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(argsban[0]));
if (!bUser) return message.channel.send("Не могу найти человека!");
if (!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send("К сожалению у тебя не хватает прав друг!");
if (bUser.hasPermission("MANAGE_MESSAGES")) return message.channel.send("Этот человек не может быть забанен");
let embed = new MessageEmbed()
.setTitle('')
.setDescription('Это бан! \nЯ заметила, что кого-то забанили!')
.addFields(
{name: "Забанен человек:", value: `${bUser} с ID ${bUser.id}`},
{name: "Забанен человеком:", value: `<@${message.author.id}> с ID ${message.author.id}`}
)
.setThumbnail('https://cdn.discordapp.com/attachments/463276215663591435/558746793978888212/22-20-09-5cb9faa6d6e6b2279867707da2100ea3.jpg')
.setColor('0x2c69d3')
.setTimestamp();
message.guild.member(bUser).ban("Забанен Моникой");
message.channel.send({embed});
i'm getting an error about quick.db i think but i don't know how to fix it (when i uninstall it and install one more time i'm getting found 1 low severity vulnerability
run npm audit fix to fix them, or npm audit for details) what can i do i cant use many commands need quick.db
That is not the right way to ban a user. It should be <Guild>.members.ban(bUser, {"REASON"})
?
Yes, you'll have to do this.
try either
The one that I pointed out to.
No, there is no ban method on a guild object
from discord.ext import commands
import praw
import random
bot = commands.Bot(command_prefix='>')
@bot.command()
async def meme(ctx):
subreddit = reddit.subreddit("memes")
all_subs[]
top = subreddit.top(limit = 5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
em = discord.Embed(title = name)
em.set_image(url = reddit.com)
await ctx.send(embed= em)
```
I have problems
syntax error
whats the error
щр
oh
i fixed it by deleting {}
now it message.guild.members.ban(bUser, "Забанен Моникой");
It should be message.guild.members.ban(bUser, {reason: "Забанен Моникой"});. Remember that the 2nd parameter takes an object and you have to provide a key for it.
my bot got's IA u.u
Sorry, on spanish it's IA and i speak spanish xd
What's IA
AI
But on spanish it's IA
English: AI-Artificial Inteligency
Spanish: IA-Inteligencia Artificial
uses an api
looK GUYS IM SMART I codedded AI!!
i didn't say i code AI.
for (const warning of results.warnings) {
const { author, timestamp, reason } = warning
if(warning === null){
// no warnings code
message.reply(`This member doesn't have any warnings`)
return
} else {
reply += `By ${author} on ${new Date(timestamp).toLocaleDateString()} for "${reason}"\n\n`
}
}
i did this to prevent the bot crashing where there is no warnings in the database but it doesn't seem to work
TypeError: Cannot read property 'warnings' of null
that works thx
read the error carefully, it's saying that results is null
i did read it carefully but i can't seem to fix it
i know a bit of cpp but i don't work with cmake, never really had to
meh, wonder if I'll find someone here who knows how to use it
building the executable is harder than coding itself
So i have a function that generates a random number when u run it and saves it to the database, but i want it to add to the existing number to the database if there is one!
e.g: if 4 is in the database and i generate 5 , 4 + 5 to update but all it does is overwrites
this 😔 now add keeping it cross platform as a cherry on top and you get a recipe for a mental breakdown
@valid grotto our conversation 2 hours ago, how would i edit it and add field?
check if your database has an update function
this part
findandmodify
Hi Tim
I'm actually trying to learn c++ to use with UE4. Sadly cpp's community is filled with machines that talk using memory addresses instead of words
lmao
but how would i add the number from the database n the generated number to then push it?
yes
I mean, people say java is ugly and confuse but cpp's docs are unreadable
exceptions doesn't help either
I didn't even mentioned the type declarations
@quartz kindle with this code message.channel.messages.fetch(ID).then(OldEmbed => { NewEmbed = OldEmbed ; NewEmbed.embeds[0].color = xxxx; OldEmbed.edit({embed: NewEmbed.embeds[0]}); }) how would you add a field?
use update or find and update, and add the $inc option
i have it but it just overwrites the old with the new, I want it to add to the one in the database
discord.js recommends creating a new embed
embed = new Discord.Embed(old.embeds[0])
show code
im making a suggestion command, so im wanting to edit it, and was just trying to see how to make a field into it with other stuff like .color, .title etc
because .field dosent do anything
create a new one like i showed
then do embed.addField(...)
if you want to remove an existing field, it should be embed.fields[index]
oh wait i kinda understand
i get this UnhandledPromiseRejectionWarning: MongoError: Cannot increment with non-numeric argument: {coal: "4"}
yes
you have to give it , as a number
how would you add two DB values
for example; money_user , bank_user
in a cmd, Total Balance = db.fetch(money_user , bank _user);
would that work? just an example, not actual code
you need to fetch for each field ig
then sum normally
probably mongo has a sum attribute tho
so;
db.fetch(money)
db.fetch(bank)
total balance: money + bank
idk
im using quick db (sqlite)
lol thxs 
i was coming with another error but it was simple
anyone have a good free hosting site??
How can I put this : https://codepen.io/matchboxhero/pen/JrLJeb?editors=1100 In my Server background?
heroku would be good
but it depends if you are using data files such as .json to store user files
if you would be storing those data in files don't use heroku
else it's good
@hard anchor i recommend going and regenerating your token
and then not posting it here ;)
ok
crop any screenshots you send above the bot.run part
How can I make a shout script for my bot? I'm kinda confused
😂 Bruh
@hard anchor Great job!
I think the error is from a library, because it is well written
I'm not sure
lol
The invalid syntax is probably because you aren't using python3
i am using python 3.9 and i just updated pip
does someone have knowledge with python bots and githup
oh ok
How can I make shout events bot tho? I'm confused on making that
cmd or git bash?
You need to explain what a shout event is
Sorry I wasn't replying to you in terms of python.
It's for my game :/
I don't use Windows, so try in either one.
which version of python to download?
Yes, but what is a shout event.
dang it
I need the bot to shout in a channel that I want, The prefix should be !shout
Then it will direct message you for the info of the shout
hi
Hi
only thing i wanted to know was how to add the bot to github lmao
So like !shout <channel> <message>
woops
Nanana like only !shout
Can we like add the script that when we say !shout it will only shout it on the wanted channel
If I'm saying it right
Actually that one is better you gave me a good suggestion
?
How can script that, Can you teach me? It's my 3rd day of scripting I don't really know much about scripting
How can I put this :
https://codepen.io/matchboxhero/pen/JrLJeb?editors=1100
In my Server background?
sharding isnt bad right? if i have 500 severs, 1 shard is fine?
What version of python do you recommend for praw?
dont use it
use aiohttp
i got a reddit api aiohttp that one of my devs made we r prob gonna opensource
so lmk
How can I do that too? 😂
@quartz kindle You are the developer of djs light? really?
are there any problems when you want to use djs light by sharding
guys
why it haves an error
message.guild.members.kick(kUser, {reason: "Кикнут Моникой"});
yes i am, and no there shouldnt be any problems, but i personally dont use the sharding manager so i dont test it much
but if you find any problem, report it to me and i'll fix it
it's member.kick()
do I have to change my whole code? for the light one
not
depends on the code. many things dont need to be changed but some changes do
message.guild.member.kick is not a function
literally right here wym
i didn't say that
i said Member.kick
which means a member object
facepalm
for example, if you use .cache.get() or .cache.find() or any other .cache thing, you will need to either replace it with .fetch() or enable the relevant cache in the client options. Also permissions are disabled by default, if you need them you have to enable roles and overwrites in the client options@tired panther
Why does my bot dosent connect?
maybe you hit a rate limit
what error code are you getting?
Nothing
i think discord is having a moment cause im getting 4000
O yes
debug it
Oh great
...
looks like discord is dying then
hm
does the lavalink server has to be hosted in the same server as where the bot is hosted?
don't think so
@solemn latch Improved the error message XD
oh its so much nicer
ypeError: Cannot read property 'kick' of undefined
message.members.kick(kUser, {reason: "Кикнут Моникой"});
guild.members
did you do all the stuff yourself @earnest phoenix?
message doesn't have the members property
was guilds.members
yes
one man say me just menbers
that one man was wrong I guess
@solemn latch spent about 5-6 days on it XD
it's either member.kick() or GuildMemberManager.kick()
oh
there is no kick method for guildMemberManager
only ban
its so rare to get unique stuff like it @earnest phoenix
so that's why i said Member.kick()
you need to get the member first...
then its member.kick() like Trintous already told your 3 times...

kind of stupid, they have ban but no kick
Love my nickname
because ban can ban users outside the server
so just member.kick()?
Aww thanks thats amazing to hear 
you can't kick a user 4head
yep
(node:57) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
...
my bot have all permissions
Are you sure
yep
Are you kicking an admin or owner
not
or someone that has a higher role than the bot
it doesnt have permissions
if you trying to kick someone with a role above your Bot role, you cant






