#development
1 messages · Page 1484 of 1
but it's just key and value
also isnt is KV
im sorta a beginner tho
well trueeee but there are some other db that you can learn that is just as easy as quickdb
like mongodb
just findOne() or updateOne() with upsert
- if you like schemas use mongoose
some people don't like it since it defeats the purpose of having nosql
yeah mongodb is ez
wait rlly
idk, i use mongoose
i started with mongoose but then i switched to psql because i just found better tbh
dk
i meant there isnt much comparing them, one is sql on is nosql
something like typeorm makes postgres pretty effective
PoggersDB tho 😎
lmao
yep, poggersdb is part of jason.db
o
ye
PoggersDB has an encryption method so strong, it might not even be able to decrypt it 5% of the times
and then theres me that actually thought poggersdb was a real meme db
and tryed to search it up
i started a conversation here that i have 0 involvement in
tried*
yes
thats pog
gers
"DO NOT USE THIS IT WAS MADE AS A JOKE"
ok at least i was rgiht
that it was a meme
lmao
lmao yes
million was attacked by everyone so he was forced to put that warning and enmap as an alternative
i added object nesting support but that's it
made my first bot, but feel like I am spending so many time checking input types and coding things like resolving mentions and I really want to use a framework now
you using any lib?
Ehh, yes, Discord.js, validator, prisma etc.
But I find coding command parsing and input parsing a bit tedious, was thinking about switching to Akairo, but I am afraid of losing flexibility that come with not using someone else's framework
parsing isn't hard
what's hard is making everything fool proof
because most of people that are going to use your bot are going to be idiots
discord bot is user input hell
you have to think of users that didn't pass 2nd grade
i mean
i thought it was the database or calculation or shit that is complicated
but after i learned it
it is like 20% of my development time
but like
80% of my code in my command consists of chekcing whether they gave me the right input
and telling them which one is wrong
like youll tell them to do [p]x y and they'll do [p]y x for shits and giggles
does your bot use complicated input or something?
you could simplify it in some way to reduce the amount of validation
and remember
regex is always your friend

wanna talk about complicated intputs?
you can literally make a 2000 char command with my bot
"hello this command help you convert between currency"
[prefix]convertcurrency [currency type] [currency number]
and that does not crash your bot?
nope
User: *Prefix 100USD
"i worked really hard on this please dont screw it"
lmao that happens all the time 
I always put checks to see if input is higher than like 450
Y UR BOT NO WORK?11!!11!??!
y your bot not intelligent enough to parse my currency symbol no matter which end of the command i put it in
granted my docs could be better but
basically "why doesnt your bot have ai to handle my stupidity!!'???!"
what I do whenver they miss an argument is just send the help command for that command
I still haven't added the ability to parse mentions so I am forcing all users to use their UserID, and I was wondering if I am reinventing the wheel and just better off using a framework like akairo for task like
fixes everything
discord.js parses mentions
finding if a user exists given a id / mention / name etc.
message.mentions.users.first()
atm i have my command parse arguments by position
ohh yea doing that is one hell of a time
xyeah, it is slighlty more complicated commands I am struggling with
yeh
I'm just trying to see if I can improve the usability
by changing the parameter in my commands that require userID
to accept also mention
laughs in py doing this automatically
because it is kinda tedious
for my user to copy their own ID
or someone else's to do every action that need a user
discord.js dosent auto convert?
don't judge me i set up database and everything but not even how to parse a mention
it does
but he wants mentions on specific arguments
alllowing only mentions is kinda 
sus
^
i prefer parsing mentions with regex
that way it works for both mentions and ids with the same code
haha capture groups go brr
Hey
i dont even use them
https://discord.com/api/v8/guilds/789704325899223110/ where do i put the authorization after this
in the request header
in the guildCreate event, is the guild name and ID as guild.name and guild.id?
Correct guys?
see your library's docs
https://discord.com/api/v8/guilds/789704325899223110/Authorization:Bot mytokenhere but that doesn't work returns 404
.heading {
padding: 300px 50px !important;
color: #fff !important;
background-image: url("../imgs/wavy-purple-by-nouridio.svg") !important;
background-position: bottom !important;
background-size: 400% !important;
background-repeat: no-repeat !important;
}``` is there a way to only animate the image?
that's not a header
google http headers
create another element that actually has the image or just use the actual img tag
and then animate that
what would the element be though?
...anything you want
i don't suppose u can use the node-fetch module to use headers?
ah kk
you tried and that's what matters
wait @earnest phoenix is there a way to change image color only
i only know background-image
what
dw
if(message.author.id === "723081690792067143") return message.channel.send(` ${args.slice(0).join(" ")} `)
i want it to slice nothing,
its always slicing the first word
lol that is exactly what i did
how do i get a webhookauth ?
how do i set a image background for the page? kinda new to html/css
background-image?
yes but where and how do i put it
if you want to set the background for the whole page you can use body I guess
body { background-image: url(<url here>); }
thx, worked
Can we get members and channels without having privilege intents
nop
no
you don't need privileged intents for those
you do
Oh
For members yes
you don't if you're not planning on fetching all members
Can we actually do that
yes
for loop
I will try
Oh
I don't have either of the two turned on
And when I asked discord to turn them on for my bot
They replied with a big no

you need to send in an example of why
I did
including code, and why its needed
you can't if it's not for original commands
like statistical commands
userinfo for example
greet?
why?
greet dms
like carls highlights?
you need intents to fetch all
am i able to customize the invite button color?
yes of course
whats the selector for it, like i said, new to html/css
how i can check if a user vote or not?
ok tnx
body {
font-family: 'Poppins', sans-serif !important;
background-color: #1B1B1B;
color: #fff;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
font-size: 16px;
line-height: 5px !important;
border-top: 6px #9e8ff6 solid !important;
animation-name: animateWave;
animation-duration: 0.1s;
}``` i only want to animate the border top not the whole body?
yea ig
in my case discord.js uses strings so thats what i use
but i guess some libs like jda also use numbers
Hm..
I am trying to make something where people can set a channel for message events
you can't use number for ids in js because they won't transfer properly
but when the bot joins a server, it register's the server's data, including the server channel events where it sends out the message events, but since the owner didn't set the channel, I put it as undefined, but it didn't work since I set it as a string, what can I do instead?
eventsChannel: String
When I register it's data, I made it:
eventsChannel: undefined - cause since there is no channel to send to
.. but it didn't work..
is undefined not considered as a string? should I make it like "undefined" instead? 🤦♂️
@client.event
async def on_member_join(member):
print(f'{member} Sunucuya Geldi, Hoşgeldi!')
channel = client.get_channel(711189995431395378)
embed=discord.Embed(title=f"{member} Sunucuya Katıldı.", color=0x000000)
embed.set_image(url=f"{member.avatar_url}")
embed.add_field(name="ID", value=f"`{member.id}`", inline=False)
embed.add_field(name="Hesabın Yaşı:", value=f"`{member.created_at}`", inline=False)
await channel.send(embed=embed)
discord.py rewrite
the on_member_join is not detecting when a user joins the server
i cant see any problems
what did i do wrong?
@feral aspen undefined is a different type than string
What can I do?
If the eventsChannel is a string cause it's an ID, and now when the bot joins a server, there will be no server channel so it's undefined, but undefined doesn't work. What can I put instead?
i guess you can just leave it as undefined
unless you want to always have a channel registered, then finding some other channel is up to you
or an empty string
@mellow kelp Should I put "undefuned" with the ""
an empty string is a falsey value
intents
just put null
null?
kk
null is treated as an object
oh yea
it's an actual value, unlike undefined
for some reason typeof null === 'object'
It worked!
gotta love js
My bot’s Profile Img Is Not Working. Mide if you can take a look?
would this function work with webhooks
client.on('message', async (message) => {
no bot token or anything just a webhook sending requests
or should it be webhook.on 
time to test
Yes
oh rip
I’ll probs use slash commands
when they’re fully released
cuz if I make it now I’ll probs have to some more changes in the future
@sterile lantern slash commands are epic for everything and i am waiting like fuck till discord.js v13 is released so i can use them
they're trash
you lose more than what you get
they would have been better if they had been introduced long ago
but for dumbos like me they're revolutionary
look, if you can help me, I appreciate it I'm trying to use innerHTML to set a text for the username of the user who logged in to the site (html) my code is:
<!DOCTYPE html>
<html>
<head>
<title>Fleeh</title>
</head>
<body style="background-color:gray">
<div id="info" style="color:white">.</div>
<a id="login" style="display: none; color: white;" href="https://discord.com/api/oauth2/authorize?client_id=753658112728105000&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&response_type=code&scope=identify">Login</a>
<script>
window.onload = () => {
const fragment = new URLSearchParams(window.location.hash.slice(1));
if (fragment.has("access_token")) {
const accessToken = fragment.get("access_token");
const tokenType = fragment.get("token_type");
fetch('https://discord.com/api/users/@me', {
headers: {
authorization: `${tokenType} ${accessToken}`
}
}).then(res => res.json()).then(response => {
const { username, discriminator } = response;
const texxt = document.getElementById("info")
texxt.innerHTML = username;
}).catch(console.error);
} else {
document.getElementById('login').style.display = 'block';
}}
</script>
</body>
</html>
How Can I Import Text From pastebin?
wdym
probably copy-paste
no
like in stead of putting lines like this
test
test
test
test
and then use \n
can we use this https://pastebin.com/raw/xKnsGb0y
you mean to import code from pastebin programatically?
is it being complicated?
like, using code
kinda yeah
so im making a generator bot
pretty sure you can just use fetch() or axios
make a request to the raw text and get the response data
fetch it then just get the text from request body
I want to use pastebin instead of writing each link line by line

Oh god
What the fuck did we just do
@mellow kelp
that's a... generator bot
we?
excuse me?
wat
oh no
but its also a generator
yeah
can you tell ?
the solution?
generator bots are against tos
we're not helping
Do you have a different message listener for each one of your commands?
yes
awful isn't it

wtf dym shoudl i use else if now?
He is too dangerous to be kept alive!
kill me then
use a command handler
we've been telling you that since like
that direct-link domain does not look legit at all
yeah at least use commando
commando is kinda dead tho
that one should be easy enough
and also PLEASE STOP TRYING TO MAKE A GENERATOR BOT
whats the point of sending in caps?
well im using it for testing shit because yes
lmao
i just write a simple command handler for every bot i make
takes about 3-5 minutes
or i just copy code from older projects and re-adjust it
thats what every one do like 90% of the time.....
when slash commands are released all command handlers will be a joke
because it's better for the user
i guess each bot will have 1 slash command with sub-commands right?
because nobody wants karens screaming in #support that they can't follow instructions
because many bots will probably have commands with the same name
there can be multiple commands with the same name, they just have to belong to a different bot
Oh that makes sense
How can we get inputs from cmd, for nodejs application?
message.content.doSomethingWithTheMessageText
No no! I'm not talking about discord bot dev
use std or readline
oh you mean from the console
use readline
and use yargs if you want a fancy syntax for args
can u share any good article/videos or anything?
😅 OK
(╯°□°)╯︵ ┻━┻
Is there an if statement to detect if a message in the messageDelete event is an embed?
It errors unfortunately.
oh wait
but
embeds are too easy
anyone got an idea on how I can do something everyday at midnight?
cron jobs
or how to get the 12 am time in js
Can you use the "this" keyword in JSON?
nope
Ok
@stark abyss i'd say use node-cron
oh
you can schedule functions to be ran at certain times
alright ty
np
12am in which timezone lul
local
how about utc 0
I need to do something every 24 hours, doesn't really have to be local ig
i just use a timeout and an interval
i have a script that posts a webhook every 24 hours too
thats why you use both
but my bot isn't very stable it goes down every day bad vps xd
a timeout to find the next desired moment, then a interval to start from there
how about cron jobs
this is my script ```js
setTimeout(() => {
run();
setInterval(() => {
run();
}, 86400000);
}, 86400000 - (Date.now() % 86400000));
those use date to schedule stuff
no need for cron jobs
but if my bot goes down it will mess up
nah
with the proper calculations, nah
only if it goes down precisely at the moment it was supposed to send
then it will only send the next day
then you gotta wait another day 

but like
scheduling with cron is easier i think
just google the crontab for what you want and let cron do the scheduling for you
I read their docs
cron is easier yes, if you're ok with relying on your system
i prefer having my scripts self contained
yeah guess it depends on that
Yeah I think I'll just do what tim said, thx both of you
I also gotta do one for weekly
that number * 7 should do it right?
yup
okay 
looks like math at school actually had a purpose 
not reeally
more or less
early math is super useful
yeah definitely

there is like a json file. I need to parse it through js so that when a user provides a query,
It can search through the json file and find the optimal result
//json file
{
name: "test1"
},
{
name: "test2"
}
//user query
!search test1
im kinda to new to it
so yea
I think people recommend not using json file as database
not as a database
use object
Matt
oh my bad
i have a predefined json file
wait am i
hm
So you can just require the file and JSON.parse it
if json file is an array
there are two ways
which it seems to be
it is
because there are no keys
//json file
[ {
name: "test1"
},
{
name: "test2"
} ]
// Way 1:
const json = require('./my-file.json');
// Way 2:
const fs = require('fs');
const data = fs.readFileSync('./my-file.json').toString();
const json = JSON.parse(data);
np
?
const hour = new Date(Date.now()).getHours();
if(hour == 24){
console.log("F")
}
``` I realized I could just do this xd
and are you gonna run that in a loop?
oh shit I didn't think about that 
does anyone know if i can run 2 for loops in javascript parallel to each other
you mean workers?
basically not waiting for one to be complete
just running 2 for loops at the same time
thats what I wanna do
lol
at the exact same time, id think workers would be the solution.
oh ok
you can still only done one thing at a time with async
just the async ones would be done after
cant find module ./xp.json
Yet its a file and there is the corresponding file.
is it in the correct location?
./ checks a specific point in your projects folder, is xp.json in that location
everythings in a folder, unless you put it in your c drive 🤔
The command is in src/commands
I have many folders
Events, Commands, Database, Handler,
Then no folders
Which is what xp.json is on
so, the ./ is looking in the commands folder(./ is relative to the file that the code is running in)
Yyp
and your xp.json isnt there
There is an xp.json
in the commands folder?
No
Moved it
How Can I Add My Bot To The Server?
to this server?
Yeah
we dont add bots here
You Dont?
What About The Testing
There Are People With Their-
where 🤔
What About The 6000+ Bot Devs
those are bot developers
How Do I Become One Of Them
Oh Ok
yeah, you have to have a host
It is erroring the whole code now
I Use Heroku
what did you put 🤔
./src/commands/xp.json
your already looking in the relative file.
Which is corresponding to where the file issss
your looking in /src/commands/src/commands/xp.json
which doesn't make any sense.
lemme see if i can find a guide that explains relative pathing
Why is it called the C drive
a and b where taken
grr
Hey guys. For some reason this very easy code isn't working and.... I don't know why. Any ideas?
client.on('guildMemberAdd', member => {
client.channels.cache.get('793215879264731146').send("Test");
});
do you have the members intent?
Well what isn't working about it
Does it emit anything, does it throw an error? Like woo said you may need the members intent
The bot isn't sending "Test" in the specified channel.
going through errors is normal in programming
@sly fog We Have The Same Code
Mine isn't working, I don't know why. :/
If You Are Doing A Welcome Thing And The Bot Adds A Role
You Have To Specify What Role
that looks like api abuse
I just want the bot to send a message.
tfw you don't know ids exist
your bot will probably be ratelimited every time a user joins.
spam giving roles will get you ratelimited quite quickly.
let welcomeRole = guildMember.guild.roles.cache.find(role => role.name === 'Role Exact Name');
welcomeRole Is The Name Of The Thing
And Then Role Exact name Is What The Welcome Role Will Be
guildMember.roles.add(welcomeRole);
Thats After
So It Adds The Welcome Role
To the User Joining The Server
It Pretty Much Just Creating a Variable
And Giveing User a Welcome Role
Anyways, I Have To Go Rn To Get Covid Tested
Its Going To Hurt ;-;
@sly fog
Look
he just wanted to send a message my man
lol
Me?
yes
and i'm bill gates
:/
I don't need roles, and I know how to do it. I just want to know why my code isn't working lol, but thanks for your help! @glacial pagoda
np
guildMemberAdd needs the member intent iirc.
which is probably why its not working.
channel.cache.get not good
dont think any channel types have .cache
so it wouldnt work
client.channels does however
ya
if anyone wants my script that I use to test my ai just look at this
lol
3 files
that I use
full src code
no api keys doe
ofc
you can use it to test my ai
how do i create an emoji with a link to the image in dpy
like
!add <nameofemoji> <emoji_link>
hmmm looks interesting. Using tensorflow, i assume this is a nsfw filter?
depends on the lib, if you look at your libs docs it will explain it.
k
Im not so sure if it is good
dealing with emojis are fairly easy, should just let them use an actual emoji
@opal plank do it
i want to, but its sooooooo annoyingly big
i need to do another framework for the childprocess to work on that though

yeah it just gets random images from 2 subreddits and scans each image and then prints out results on how the perfomance was after a set amount of scanned images
i saw
pretty much the accuracy is always 95% for me
lol
and 4 to 5% false negatives
no matter how many images
95.16129032258064% accuracy to be exact
if only it was 95.16129032258065%
lol
i am trying to add an emoji by link but not sure how to do it without downloading the emoji (dont want to do this as it wastes a lot of space)
you need to download it
did you look at your libs docs?
downloading != saving on your drive
^
You dont have to download the emoji...

ok
Read the docs for emojis lol
ok
so im trying to make a command where it says something, then prompts you to respond
and if you respond the right thing it does something
and if you respond the wrong thing it does something else
discord.js
how do you do that exactly
lol
how do you do that exactly
lol
a message collector, and an if else statement
read the docs
or the djs guide
Use discordjs.guide rather than docs imo, it's well and simply explained there
https://discordjs.guide/popular-topics/collectors.html#message-collectors
glad to hear! well done 😄
docs are for explaining things in a way devs understand, the guide is more for learning how it works.
its important to learn how to use the docs, as many libs dont have a guide
just docs
document.querySelector('.toggle').addEventListener('click', function() {
this.classList.add('animate');
setTimeout(() => {
this.classList.toggle('active');
document.querySelector('.wave').classList.toggle('active');
document.documentElement.classList.toggle('theme-dark');
}, 150);
setTimeout(() => this.classList.remove('animate'), 300);
});```
can I do this in python or is that kinda not possible
This is on html?
yeah looks like front end js
dont think python has any front end capabilities right now.
well maybe not
https://brython.info/
js is the standard way of doing front end web development, but seems a few python front end's exist. not sure how much browsers support them.
I know, that's why I asked.
True
😭
that brython.info thing is really interesting
SSR?
the reason why people don't really do that though is because there's lack of community libraries for building your site
Oh nvm
server side rendering
wasm
yum
hopefully one day we'll get to the point we won't need js to invoke wasm
just imagine publishing a qt app to the web and avoiding html and js
That would be really cool
Rust to wasm tho, imagine the potential
So many UI libs
I mean you can already do it
I think
But having chrome be able to render raw wasm "would be cool"
Cock
rock
@misty sigil
bro
@misty sigil
stop
Chill it’s a joke


<p class="cardone-title" style="font-size: 50px !important;line-height: 15px !important;letter-spacing: -0.06em !important;font-weight: bold !important;"><%guilds%></h1>``` guilds dosent show anything ``` res.render('index', {guilds: client.guilds.cache.size});```
same thing
did u define client?
Should work in my eyes if you change this <%guilds%> to this <%=guilds%> in the .ejs file
Could you try to console log it out like this? console.log(client.guilds.cache.size); right after the res.render line
const Discord = require('discord.js')
const { MessageEmbed } = require('discord.js')
module.exports = (client, message) => {
const channelId1 = client.channels.cache.get('792313562520485932') // Welcome Channel
const channelId2 = client.channels.cache.get('792313562520485932') // Farewell Channel
client.on('guildMemberAdd', member => {
let avatar = member.user.displayAvatarURL({ dynamic: true })
const greeting = new MessageEmbed()
.setTitle('New member! Let\'s welcome them!')
.setDescription(`Warm welcomes to <@${member.id}>! :partying_face:, We hope you enjoy our server!`)
.setThumbnail(avatar)
.setFooter('A new member!')
.setColor('#77dd77')
const channel1 = member.guild.channels.cache.get(channelId1)
channelId1.send(greeting)
})
client.on('guildMemberRemove', member => {
let avatar = member.user.displayAvatarURL({ dynamic: true })
const farewell = new MessageEmbed()
.setTitle('A member just left!')
.setDescription(`<@${member.id}> just left the server... 😧`)
.setThumbnail(avatar)
.setFooter('We lost a member')
.setColor('#ff6961')
const channel2 = member.guild.channels.cache.get(channelId2)
channelId2.send(farewell)
})
}```
Hey when i do that
It logs when another user joins in another server
but its supposed to log it in the server who joined in That Server
@knotty carbon returns zero idk why
the number 0?
yes
is the bot in any server?
yes
(async () => {
client.commands = new Map();
client.events = new Map();
client.prefix = process.env.DISCORD_BOT_PREFIX;
await registerCommands(client, '../commands');
await registerEvents(client, '../events');
await app.listen(port, () => console.info(`Listening on port ${port}`));
await client.login(process.env.DISCORD_BOT_TOKEN);
})();```
this correct
const session = require('express-session');
let port = 3000;
app.set('port', port);
app.set('views', __dirname + '/website/views');
app.set('view engine', 'ejs');
app.use('/assets', express.static(path.join(__dirname, "/website/assets")));
require('./website/router')(app);```
its weird because the command works
and shows the guild count
Okay, that's definitely weird. But i don't think that i can help with that, sry.
thanks anyways
And can't do much if i don't have the full code and not only small areas
im pretty sure you don't need path.join for express.static if the static folder is at the root
its not
it shows guild count as 0
is the cache empty?
login where?
Someone know what its the meta tag to set a embed color?
pretty sure its theme-color
just do channelId1.send(embed) ?
How does one filter roles by ID again? I am apparently having issues with this and what I am getting on my searches is turning up empty.
Or can I use message.guild.member.roles.has somehow? Cause it can't read "has" of undefined and I'm trying to figure out what my syntax error is or what I'm just not filtering right.
cache exists
Found the documentation, all good now.
-needdev
DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.
hmm
so oauth2 without redirect_uri will invite the bot to our server and oauth2 with redirect_url will send a data so we can use it on bot control panel like https://discord.com/oauth2/authorize?client_id=340319472357474304&redirect_uri=https%3A%2F%2Fkitrobit.com&response_type=code&scope=identify guilds, am I right?
yes?
that is how css works
.classname1 {
background: green;
}
#classname2 {
background: white;
}
that's python, not js
The library is messing
Hello??
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
When you try importing in the library, it should be discord — not discord.py
@sudden geyser ohk
I have a non-public registration bot. But I want that bot to send a login message when someone joins my server. You'd better send the code to me private
Secondly, I don’t know if you’ll have access to it in the terminal. Maybe in the environment
You'd better send the code to me private
Thirdly, use python3 instead of python for the interactive shell command
ohk sir
If anyone knows the code, please send it to me
if you don't send to dm...
i will find you
and i will kill you
which type of code?
Oh god

Registery bot login command

if (user.isRegistered()) {
user.login()
}
that looks so java
Lemme cry inside of trying to write js 
Though we cannot help you with your idea @austere herald, we can only link you to resources that might help with your goal
ok
How to set our music bot deafen when joining a server?

😩
how can I send it to log when the channel I specify on Twitch starts stream (with which module or api)
@earnest phoenix show your code
Hello guys?
@earnest phoenix show us your code
import os
from itertools import cycle
import discord
from discord.ext import commands, tasks
from dotenv import load_dotenv
# import praw
load_dotenv()
bot = commands.Bot(command_prefix='$')
@bot.event
async def on_ready():
print('We have logged in as {0.user}'.format(bot))
change_status.start()
#status = cycle(['WhiteHatJr SEO', ' with wolf gupta', 'with Lana Rhoades'])
status = cycle(['Alexshcer-Bot is being upgraded by his owner Alexshcer','Playing music','Listening Mine by Alexshcer!'])
@tasks.loop(seconds=300)
async def change_status():
await bot.change_presence(activity=discord.Game(next(status)))
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CheckFailure):
embed = discord.Embed(title=':x: oops! You do not have permission to use this command.',
color=discord.Colour.red())
await ctx.send(embed=embed)
elif isinstance(error, commands.MissingRequiredArgument):
embed = discord.Embed(
title=':x:You are missing the required arguements. Please check if your command requires an addition arguement.',
color=discord.Colour.red())
await ctx.send(embed=embed)
elif isinstance(error, commands.CommandNotFound):
pass
for filename in os.listdir('./cogs'):
if filename.endswith(".py"):
bot.load_extension(f'cogs.{filename[:-3]}')
bot.run(os.getenv("I can't give you the token"))

You're shitting me
what?
The struggle of helping people who send you code snippets in DMs and then say "don't use or share it"
And that doesn't even use PRAW so I don't see how that helps
@earnest phoenix I know you downloaded it, talk here instead
I am not a good developer of py basically
Show me where you actually do import praw and ACTUALLY initialize its client
How can i see colors on mobile??
Christ Lord help my soul
You can only view colors for supported languages
Ohh what's the supported languages?
@earnest phoenix See my messages here and stop DMing me with things that don't help in any single way
I know you downloaded praw and that it's installed
Chose memes by hot not top
What exactly is set as a value for client_id?
What does that environment variable resolve as?
yes
It's not a yes/no question
i can understand the question
Seems you actually can't, so let me rephrase it

What does os.getenv("sfgsfsd") return
Recommend you Google it like discord android markdown colors or discord android codeblock colors
As I don't remember
Ty
pain
Is that how you set your env var or do you just want to set your client_id to that ID
just want to set client_id to that ID
Then why do you use os.getenv
I never prefer os thing...Easiest way is just make one py file and import from it...
guys how to handle DiscordAPIError: Unknown Message at RequestHandler.execute
In regards of saving data yes i use Pgsql but for keys like token, db connection url i use py file
Try to fetch a known message
how to do
Aka the one that exists
I want to set it as env var
I am mediocre
Python files? Wew, I have a friend who does the same
JS
I want to set it as env var
Yes like i did secrets.py and in it i have tokne and now import secrets then secrets.token
I love short way hehe
Do you know what env var is
Sure, that works 😂
I'm just used to JSON files
Enviromental Variable
And do you know how to set one?
ya
How?
are you talking about setting the environmental variable for the system for using command in cmd
I'd say that's a good guess
can someone help im tryna make both text inline witht he image css <h3 class="cardtwo-title" >Astrah#2377</h3> <p class="cardtwo-role">Core Engineer</p> //css .avatar { width: 45px; height: 45px; border-radius: 50%; margin-right: 4%; display: inline-block; } .cardtwo-title { display: inline-block; font-size: 20px !important; color: #7289da !important; font-weight: bold; margin-top: 0; margin-right: 5%; margin-bottom: 30; } .cardtwo-role { display: inline-block; font-size: 15px !important; color: #7289da !important; font-weight: bold; margin-right: 50px; } //img <img src="../assets/imgs/astrahicon.jpg" alt="Avatar" class="avatar">
no then i don't know
How to set our music bot deafen when joining a server?
mute that guy
But, groovy or mee6 automatically deafen when joining my server
Yeah through code.
How to do that?
varies from library to library
you okay?
`const { prefix } = require('../config.json');
const Discord = require('discord.js');
module.exports = {
name: 'prune',
description: 'Prune up to 99 messages.',
aliases: '[p]',
execute(message, args) {
if(message.member.roles.find("name", "Helper")){
const amount = parseInt(args[0]) + 1;
if (isNaN(amount)) {
return message.reply('that doesn't seem to be a valid number.');
} else if (amount <= 1 || amount > 100) {
return message.reply('you need to input a number between 1 and 99.');
}
message.channel.bulkDelete(amount, true).catch(err => {
console.error(err);
message.channel.send('there was an error trying to prune messages in this channel!');
});
}else{
message.channel.send(`Access Denied`);
}
}};`
Anyone know the prefix?
I'm struggling
Use ```js
what do you mean by "know the prefix"?
I'm trying to use the purge command
okay... what's wrong?
I can't figure out the prefix
Or how to set one
const { prefix } = require('../config.json');
Has this got something to do with it
Why do you want to get the prefix it doesn't look like you are using it in the command
Wym
I think youhv copied the code from somewhere? right?
Yeah
And want to use this command
Yeah
😆
Huh
U need to open the file config.json, and see the prefix there!
.bar {
height: 5px;
background: crimson;
text-align: right;
p {
color: white;
font-size: 8px;
padding-top: 5px;
animation: fadeIn 5s;
}
}``` can someone help
no, you need to understand how the code works and implement it yourself. The code you copied uses a specific command handler.
what is your le goal?
to create bar
I'm pretty sure you can't have nested rules in css
yeah like GoogleFeud said, you can't use nested rules
thx
ask somewhere else
dm
Anybody can teach me how to setup mongodb for d.js bot
you can use mongoose as library
https://mongoosejs.com
i need help
Ok
I need to do is the Database
I'm going to add my discord bot to top.gg but I don't know how to write the css code. If there is a css code that can change the background, would you assign it?
but I would be glad if you send it anyway
i won't spoonfeed you
ok
@austere herald
body {
background-color: red;
}
hi need help
if (!message.mentions.users.size) {
return message.channel.send(`Your avatar: <${message.author.displayAvatarURL({ format: "png", dynamic: true })}>`);
}
const avatarList = message.mentions.users.map(user => {
return `${user.username}'s avatar: <${user.displayAvatarURL({ format: "png", dynamic: true })}>`;
});
message.channel.send(avatarList);```
when i execute this code
instead of avatar image it sends link of image
i want the image only
Either use embeds or fetch user avatars from the returned URLs and upload them
you can't use an embed for multiple images
k
You in theory can but its weird
Yes*
any ts guy here??
yes
class Square {
piece: Piece | null;
constructor(piece: Piece | null) {
this.piece = piece;
}
get isEmpty() {
return this.piece === null;
}
}
const square = new Square(null);
if (!square.isEmpty) {
square.piece.alliance;
}
How do I get my editor to not complain, about the square.piece to be null (empty)
can you show error
You should directly do !square.piece
the typescript compiler isn't smart enough to recognize that the isEmpty getter checks if this.piece is null
try square.piece!.alliance (non-null assertion operator)
you can also do (square.piece as Piece).alliance
yes that, works. But can't I let the ts compiler know about the getter
(square.piece as Piece).alliance
hmmm, but instead of this, I will go with non-null assertion operator. That's a bit more clean
but then you don't use the getter
(square.piece as Piece).alliance this tells the TS compiler that square.piece is of type Piece so it should also remove the error
//Google Map
var get_latitude = $('#google-map').data('52.379189');
var get_longitude = $('#google-map').data('4.899431');
function initialize_google_map() {
var myLatlng = new google.maps.LatLng(get_latitude, get_longitude);
var mapOptions = {
zoom: 14,
scrollwheel: false,
center: myLatlng
};
var map = new google.maps.Map(document.getElementById('google-map'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map
});
}
google.maps.event.addDomListener(window, 'load', initialize_google_map);```
ts already knows, that my piece could be of type Piece or null
... no







