#development
1 messages ยท Page 1487 of 1
How do i make the picture
lol?
instead of that boring internet look
Wot
idk
@fathom nymph what is that?
html
O
uh
``@client.command()
async def wanted(ctx, user: discord.Member = None):
if user == None:
user = ctx.author
wanted = Image.open("wanted.jpg")
asset = user.avatar_url_as(size = 128)
data = BytesIO(await asset.read())
php = Image.open(data)
php = php.resize((244,306))
wanted.paste(phh, (189,262))
wanted.save("profile.jpg")
await ctx.send(file = discord.File("profile.jpg"))``
@fathom nymph
?
lol
Lol
thats py
ofc
anyone knows how to turn my project into a ARMv7 thing on Intellij IDEA
@earnest phoenix
yo
hi
Bruh, imagine spoon feeding bad and incomplete code kekw
That was their code they wanted help with. LOL
Was loling at norizon for not understanding the complete context
Oh really? Mb then, Gray was asking something about a picture which I believe has something to do with favicon, and then ctx.author just sent a code which related to image and tagged Gray and didn't ask anything
umm
ctx.author, phh is not defined
php?
And you should save the image to BytesIO, imagine 100 people were using the command at the same time, which profile.jpg is gonna be sent?
I wonder if that's gonna get corrupted
nah it would probably throw
the file would be locked
while its open
How to get a guild invite? I forgot (js)
How we use the languages.json
?
make a collection where you reference a guild to a selected language and export the collection. (or map or object also works) then just reference the guild with the key for the string you want to send
how to get the first channel of the guild that the bot sees?
yes
i just want it to send a system message, something like this, in the first channel
filter channels which are text ones and where you have permissions to send and read messagesลพ
then just sort by their position in an ascending order
A very very complete example of this: ```js
const getDefaultChannel = (guild) => {
// get "original" default channel
if(guild.channels.cache.has(guild.id))
return guild.channels.cache.get(guild.id)
// Check for a "general" channel, which is often default chat
const generalChannel = guild.channels.cache.find(channel => channel.name === "general");
if (generalChannel)
return generalChannel;
// Now we get into the heavy stuff: first channel in order where the bot can speak
// hold on to your hats!
return guild.channels.cache
.filter(c => c.type === "text" &&
c.permissionsFor(guild.client.user).has("SEND_MESSAGES"))
.sort((a, b) => a.position - b.position ||
Long.fromString(a.id).sub(Long.fromString(b.id)).toNumber())
.first();
}
// This is called as, for instance:
client.on("guildMemberAdd", member => {
const channel = getDefaultChannel(member.guild);
channel.send(Welcome ${member} to the server, wooh!);
});
you can also check for guild.systemChannel
Guys i was wondering if a feature like bots being able to stream video would come in the near future?
nobody knows
@umbral zealot arrow functiom without braces on multiple lines that's illegal
guild.somechannel.createInvite();
It's definitely not illegal ๐
so you want to take copyright violation to its extremes by streaming youtube music in a vc
I'm super dumb
I kept getting an error : Type error : Assignment To Const Value
Cuz I kept trying to change a constant value cuz I forgot u couldn't
Lol
Discord has indicated they don't have any intention to support video in bots.
I use repl.it and had no problem when my bot was in 70 servers
My old bot that got deleted
waw
How to check if guild is deleted then delete all from database?
Gives u 500 mb memory
Lol
bot*
Any help?
The guildRemove event (or whatever it is from your library)
It will work?
If a guild is deleted it triggers the same event as when leaving a guild, yes.

Hey, I wanted to check whether the user has modrole role but .roles returns all the role names and not the IDs.
The variable modrole is accessed from my database and it is the role ID
How can I get all the role IDs of the user?
P.S. Using ctx.author.roles.id gives AttributeError
if modrole in ctx.author.roles:```
.roles is a list of Role objects
Can ye use npm to update node
I am trying to get all the users that included the name Deleted User from the ban list using discord.js - v12
let users = await message.guild.fetchBans()
for (const user of users.array()) {
await user.username.includes(`Deleted User`).then(console.log(user))
}
``` - I get errors
npm i -g npm
you can update npm
if you want to update node you need n or nvm
ok
this line makes 0 sense await user.username.includes(Deleted User).then(console.log(user))
there are no promises there, just do it the normal way
Isn't it user.user.username?
ah
that has reason and user
docs are pretty cool to read right guys
idk
i love docs
same
that was surprisingly short
the easiest docs to read are the ones that always roll in from ledge
I want meme command to be fast. What options I have how can I speed up fetching and show to user.
๐
you donโt wanna cache a random api request do you?
I am fetching from reddit
got('https://www.reddit.com/r/memes/random/.json').then(res => { let content = JSON.parse(res.body) message.channel.send( new MessageEmbed() .setTitle(content[0].data.children[0].data.title) .setImage(content[0].data.children[0].data.url) .setColor("RANDOM") ) ) })
I got this code from friend
I use that too and it works just fine
It's slow?
Not really
What if thousands of user use?

fetch multiple posts, cache them, get one per command used, fetch more when the list ends
How to cache?
Oh nice
new Object() 
nah yeah obviously map
MDN

The Map object holds key-value pairs and remembers the original insertion order of the keys.
Iโd personally Map<string, Object>
How much map can hold?
string being the post title and object being the post
so it'd be a map for each guild?
Any effect on bot speed?
no, Iโd say global
yes, faster.
well
If you use it correctly that is
how many servers is your bot in
:p
alrighty then
const cheerio = require('cheerio');
const discord = require("discord.js");
module.exports = {
name: "wallpaper",
description: "info",
aliases: ["wl", "weeb"],
async run (client, message, args){
let random = Math.floor(Math.random() * 107)
let text = await fetch(`https://hdqwalls.com/category/anime-wallpapers/page/${random}`, { method: "GET" })
text = await text.text()
let $ = cheerio.load(text)
let images = []
$('img[class="thumbnail img-responsive custom_width"]').each(function(i, elem) {
images.push($(this).attr('src'));
});
let limit = images.length
let pg = 0;
let embed = new discord.MessageEmbed()
.setColor("#FF69B4")
.setImage(images[0].replace("/thumb", ""))
const msg = await message.channel.send(embed);
why aint aliases working?
aliases as in wl and weeb?
then that's your command handler or message event
how to get the first 3 characters of a user's username?
username.slice(0,3)
message.client.users.cache.get(userID).username[0] + message.client.users.cache.get(userID).username[1] + message.client.users.cache.get(userID).username[2]
Lmao
Hello ๐. I'm making a command that gives everyone a specific role. I would like to send a message after it completed the loop. How can i do that?
the add role promises?
but, depending on the size of the server it may not be ideal to do this, unless you space out the requests
I use Eris, it handles rate limits for me ๐
something like await Promise.all(message.guild.members.cache.map(m => m.roles.add(roleID)))
but in eris
then send the message after the await statement
Aha, alright let me test something like that.
I guess Promise.all(guild.members.map(x => x.addRole(id));
Can i use a forEach loop?
Hmm alright ill try map then
map AND promise.all
ok Iโm here because I cba with slowmode and the twats in general
anything exciting
no? aw
that doesnt make any difference
oh
it doesn't await it?
Seems to work.
bruh
yes, a for loop with await is the only way to do it sequentially
just for (x of members) await x.addRole(id);?
Pretty sure the loop itself must be inside an async context
the classic way is just ```js
for(const x of ...) {
await x.addRole(id)
}
but you may be able to use the new async iterators
Yep
Works
thanks
I use discord.py but I have found recently that the guild.members() doesn't work as it should, and only returns the bot itself as a member. Does anyone have the same problem and can help?
async def geton(ctx, member: discord.Member, *, reason=None):
i = 5
while i > 0:
i -= 1
await ctx.send(f"Get the fuck on {member.mention}")
this is how i used it in one of my bots lol
@earnest phoenix
i know a fuck ton of discord.py so just lmk if you need any more help
I am trying to add loads of commands this next few weeks so I'll probably need it lol
What 'language' is this?
49 20 77 6f 6e 64 65 72 20 69 66 20 79 6f 75 27 6c 6c 20 68 61 76 65 20 74 6f 20 6b 6e 6f 77 20 68 6f 77 20 74 6f 20 64 65 63 6f 64 65 20 74 68 69 73 3f```
That's just hexadecimal numbers...
thx
Does anyone know how to change style of the menu of bot?
What do you mean by that? What library do you use?
they are buffers from the Express maybe
It was hexadecimal.
hexadecimals are like number, often presented in languages they are like: 0xFF2074
```message.channel.overwritePermissions(message.guild.id, { SEND_MESSAGES: false }).then(() => { message.channel.send(Channel locked).then(() => {
how to rename channel ?
Thanks ๐
CALLback HELL
that ain't callback 
technically the .then() method takes a callback function.
promises were made to fix callback hell
then they introduced promise chaining hell
then async/await was made to fix promise chaining hell
xD
what did that bring
Heaven ๐
nothing, async await is amazing
xD
although it did bring sync/async confusion hell
xD
just unconfuse yourself
it makes sense tho
tbh most things make sense in js
its just whether or not you understand why it makes sense
am I the only one who prefer promise.then().catch() rather than try catch await? unless there's an easier way
maybe
Hey, I could use some help over here with this Problem https://stackoverflow.com/questions/65507619/req-session-is-not-working-on-another-route
try/catch is best for snippets and code blocks that require it. For a line? fine, but for a whole command/block of code? try/catch is much better
and code blocks that require it.
What would require it?
I'd say try {...} catch (...) {...} is better when you have multiple expressions that may throw an error and you want them all to be handled the same way.
Or if you need to do a side affect that can't be restricted to the function call you provide to .catch
Like returning early.
Which language?
what if i told you that i downvoted all anime bots in the bot suggestion form v2 for being anime
@placid iron @old cliff ok so like how do i like give js the response i want to show
from flask/quart
@sudden geyser
say you have a variable
let foo= {
}
db.fetch(thing).then((thing) => foo.db = thing).catch(e => console.log(e));
try {
let bar = await fetch(url, params);
bar.parse();
let _bar = await fetch(e.anotherURL, params));
foo.response = _bar
} catch() {}
return foo```
In this example, foo is not dependant on anything.
the first db fetch is also not dependant on anything, as if it fails, nothing would go wrong.
However in the try catch block, _bar is dependant on bar, for chaining promises and parsing, things might go wry. Not only for promises, but that parse too for example, if you get an error, you cant parse it, and normally you would need to check if bar was returned, and its type. With that try catch you are expecting that whole code block to perhaps fail and not be added onto foo.
if its not urs or public and the owner tells you to take it down, yeah
use ajax
dude
bruh
gimme 5 mins
stop
why are you using flask
mhm
not ajax
is it ?
ajax is used everywhere
jquery moment
IM SO BIG BRAIN
not only for bots, for anything. If its not yours, dont use it, rule of the thumb. Copyright applies to anything really
๐
you think i haven't read the docs?
he is talking about front end js @thin apex
rip
@drifting wedge teh website makes a request to the server to edit teh data, if the server says it is ok then the website stays as it is otherwise it changes teh data back
nhn
@drifting wedge learn frontend js ig
no i'm not
mhm*
I am not
However in the try catch block, _bar is dependant on bar, for chaining promises and parsing, things might go wry. Not only for promises, but that parse too for example, if you get an error, you cant parse it, and normally you would need to check if bar was returned, and its type. With that try catch you are expecting that whole code block to perhaps fail and not be added onto foo.
So about the same thing I was saying about multiple expressions being handled the same way, but including errors not caused by a promise rejection.
I am talking about discord.js
You want browser to send request or server ? @drifting wedge
ok so
yeah?
i have flask validate the reponse
So grab the member?
see that there is no "Playing" in front?
also in what i have said, flask doesnt edit the page at all
but i want to SHOW like a text or something saying: worked | not worked
yes
so now you're ignoring me?
but i need flask to send the validation TO js
Bots can't have normal custom statuses
bro flask is for backend
do you even read what i have been sending and saying
you're doing frontend
yes
well clearly you didn't see the image
wtf that's XHR
im looking at the docs you prick
chill your tits
Be patient for god's sake
what the fuck
discord doesn't allow bots to have normal status
@drifting wedge
a custom statis
exactly
i send a delete thing to the server, if it deletes it then the page will remove it to show it has been deleted
how a normal status ?
otherwise it doesnt remove it from teh page
using*
Discord.js
that's illegal
for the 7th time
ok so basically, flask will send a var called response with the value of ok or not? or none?
in Js you can simply use ".setActivity"
no you can't
@thin apex can we stop spamming?
it has a game
remoe that div
look in the docs
i'm not spamming lol
You cant have a status without playing or listening or streaming or watching
i thought so
but then how is this image hacked?
oh you want to set it to 'gaming' ?
no I DO NOT
you are being rude and you're sending the same image over and over again
then..?
where did you even get that pic from?
@drifting wedge flask will send a response with the STATUS of 200 or whatever error applicable, if the status is 200 then the page will show a div saying edited sucessfully otherwise it will say it didnt edit
it could very well be photoshoped
i sent a message link like 500 times
i know
it is completely utterly impossible to do that
oh i just understand
Discord api says you cant
yes, but how will flask like update a variable, or send a new variable to js without reloading the page?
Now if you want to continue yelling at us read the fucking api docs
im checking my payloads to see if its doable, but it'll 100% get a FORBIDDEN
very photoshopped ey
oof document.getElementById("demo").innerHTML = this.responseText;
something like this ?
this is how you edit html without reload
how will flask send it to js
flask DOES NOT EDIT THE PAGE OR VARIABLES. you have to code js in the website to interact with the server
USE FETCH
u using python ?
bots cannot have custom status because custom status is wrapped rich presence
rich presence is user token & client only
yes
In the HTTP response body
oh my god
ok so i have flask getting the form awnser
hes just using another language
and since the custom status is long, its a status that rolls
@drifting wedge try looking up a recent tutorial on yt for it
U using py or js ? @drifting wedge
that's from my client
but i dont know how i wopuld
the text above means "Playing"
@thin apex dude you asked a question we answered it and you're continue to ask how they did it
it wasn't answered
oof you dont understand @placid iron
if you know we're wrong what's the point of asking
i was still confused
how do i get the bot dev role again
also yall keep forgetting that discord is a website (including the desktop client) and that everything can be edited with inspect element lmfao
chill your tits jerk
I was confused, ok?
Inspect element? Nah, that's photoshopped
inspect easier
ok so flask can send variables with the website, but like how can flask send something to js, without having to reload the page?
thats the thing
it ๐ is ๐ impossible ๐ for ๐ a ๐ bot ๐ to ๐ have ๐ normal ๐ status
with post requests / get?
did you even take that screenshot
when you boot up ps but ps says scratch disks are full ๐
@thin apex i told you to double check yet you kept on perstering
flash can respong with json @drifting wedge
yes it can
and ajax could interpret that @drifting wedge
anyone?
and edit page accordingly
but how would it update the variable
it can
without reloading the entire page?
the person they copied that image from was likely using client mods
yes
@pure oar submit a bot and get it approved
oh my god
no reload needed
i gtg sorry
TURKEY๐น๐ท๐น๐ท
you don't need to reload
the whole point of ajax is to make a request and fetch and not reload and update page @drifting wedge
websockets
you just wait for the response from the API
wait till they discover SPAs and state management
unlocking a whole another realm
Oh man wait until they discover REACT.

stop spamming jerk
Where are you from
#general-int for turkish chatting
Not Turkey
mars
Pluto
Sorry
This
@drifting wedge this is what you want to do
FRONT END
async function onClick() {
r = await fetch("update_page", {method:"patch", body=data))
banner.style.display = "block"
if (r.ok) {
banner.innerText = "saved!"
} else {
banner.innerText = "coulnt save!"
}
}```
backend```py
async def update_page(requqst):
# validate data
if valid:
return flask.ok
else:
return flask.badRequest```idk fask so idk how to do that but something like that
beautiful kwargs
how do people always skip all of these channels and click on development to chat
@placid iron yo u having a stroke with that much spelling mistkae
acrylic background
is replit good?
No
vps > most
Well, whenever I say anything in #support #general #general-int #memes-and-media #topgg-api they tell me "go to #development"
im not actually writing it for myself so i dont mind if i get spellings, its just less pesudo pesudo code so dude knows what to do
not you
as long as you dont want big shit that takes more resources
best free hosting?
for like 80 ish server
o
i have three servers rn so ยฏ\_(ใ)_/ยฏ
dbl
lawl
Is a raspberry pi good?
yeah
yea
yea
anything paid is good
'
contabo isn't good..
aah btw what is uptime of repl
lawl agreed
with free version + uptimerobot it is like 90% uptime
with hacker plan we're getting 99.999% uptime in 2021
hacker plan
The original HackerTyper. Turning all your hacker dreams into pseudo reality since 2011.
anyone help me how to host it
smh repl is confusing
idk how to host there
literally just open an http server then set uptime robot to send an http request every five minutes
fuck this shit i dont want to type py
wait we need a dashboard or a web server for it?
lawl
just a simple server
@stuck pike https://anidiots.guide/hosting/repl for a guide on how to host with repl.it (this is for discord.js but it works for any language, basically)
evie advertising his website
i use discord.js lmao
@modums ban ban ban ban
Good!
nice website ngl
When you find a dude called "Evie" lemme know, because I've yet to find one.


and this is why we use gender neutral pronouns on the internet!!
this is all the code i have:
const app = require("express")(app);
app.get("/", (req, res) => res.status(200));
app.listen(8080);
// =====botum code
I mean it's literally not my website tbh
banned for ads
could you ping role in embed ?
I don't own that domain. Or that gitbook team. Thanks.
bruh this is ez
ban speedrun time?
could you ping role in embed ?
No
There was a time when we blacklisted that in Dyno server
sad
embeds dont ping
you have to put the ping in the message content
because people kept posting links to stuff asking how to code it 
and we were like...no why tf would we give you a tutorial on how to follow a tutorial
But the guides literally say how to code it! ๐
That's why you need a jsfirst tag in every programming server, tbh
ehh...
lol
like this one #development message
yeah we have something like that in pins
how much ram replit gives tho?
kids never read it though
e
Tylers never care, do they?
lol
That's what used to be the primary use of my own selfbot actually. Tags.
ยฏ_(ใ)_/ยฏ
๐ฎ
lmao
mine just used to post my messages as pink embeds
I miss those times lol
the only reason I would selfbot would be to have 24/7 online
simpler discording
so people disturb even more in your sleep?
no one dms me lol
I had other features, actually. Like ghost ping detection, and kick/ban commands (all with the / prefix which was super convenient)
why should they
exactly
only selfbot i would use is the ones to auto delete links in my dms if the dms are new and their first message contains a link.
im not a weeb lmfao
from luca
everybody gets shitty dms
saying botum got declined
I get people asking me for help
Sure bud
oh geeze I had a lot more commands than I remember.
if I had a selfbot I'd use it for bot reviewing ๐
oh and the other thing I used it for
Obviously eval is bae
and your last two braincells ignored using a normal bot instead of a selfbot
its 2020 and we STILL do not have a built in UI element just to tell us how many fucking servers we're in lmao
scratch that
its basically 2021
minecraft villagers have a 5head
did you know?
?
client.on('message', (m) => {
if(m.type !== 'dm') return;
if(/fancyURLRegexhere/g.test(m.content) || /fancyDiscordInviteRegerx/g.test(m.content)) {
m.user.block();
m.user.report();
}
})```
Someone make this selfbot pls
fuck regex
regex good for finding URL's
if (m.content.includes('discord.gg')) doShit()
remove the two ifs 
Whenever I see a message from you, I instinctively hover over your pfp to see it move...and get disappointed each time when it doesnt.
wtf
lost nitro 
cried in nitro expried yesterday
See the thing is a selfbot is consistent over all the guilds I'm in, so I do'nt have to remember, "does this server have Dyno? TypicalBot? Skyra? Some shitty off-brand duplicate?" because my commands always worked for me in all servers.

@opal plank here's your regex:
const urlRegex = /https?:\/\//;
const inviteRegex = /discord\.gg/;
thats cool tbh
imagine taking off the bot that was doing gods work in the stead of R.Danny
since R.Danny cant be added on other servers anymore since it aint verified
thanks for regex
yw
anime of culture is the right term
@opal plank steam...
i should be coding rn
or drinking?
both
get to coding code monkey
i need to start getting the framework for the votes in place
when you get happy that you get free regex but you dont know the invite for erwin's botum
yes I need that bot
How to make the bot 24h open and not lock I have tried except for sites and it didn't work
What?
Hosting
Please help me
How to make the bot 24h open and not lock I have tried except for sites and it didn't work
help me
lol
- Stop spamming
- What host are you using currently?
You must be one of the worlds most impatient people
Probably self host
self host is good tho
Is there any method to keep bot online 24x7?
A VPS
Yeah
Uh what's that?
A virtual private server (VPS) is a virtual machine sold as a service by an Internet hosting service. The virtual dedicated server (VDS) also has a similar meaning.
A VPS runs its own copy of an operating system (OS), and customers may have superuser-level access to that operating system instance, so they can install almost any software that run...
A
Thank you :)
Brand new at this is there a guide?
A guide for what?
I am not able to keep my bot online 24x7 ๐ฉ
bots are a program
the bot is only online while the program is running
the program needs to run somewhere, either in your computer or in some computer somewhere
a vps is a private computer that you rent and connect to through the internet
so for those who dont want to have their computers turned on 24/7, they rent a computer for their bots
Is it a good idea to switch to Commando for my command framework?
no
*24/7
commando is not very well regarded
plus i believe its outdated
no
outdated?
*24/7
no its not
commando is not good
don't use it
if you don't wanna make a command handler urself when making a bot use something like slappey
its a package
for discord.js
Yeah I used slappey.
Klasa was an okay choice but that got nuked
command frameworks can be extremely opinionated and personal, so most people just build their own
Can anyone tell how can we login in to the bot Account?
you login with your bot's token through a program
you need to build the program
do you have any experience with a programming language?
its against tos I believe so you shouldn't do that anyways
oh you mean login as the bot using discord's client?
Yes
yeah thats not allowed and may get your bot banned
Hi, can someone help me?
Like I saw on yt
They guy used botclient.tk named site in that we filled our bot code or something, then we can get the access to the bot Account.
If you want to check if the bot has permission in the guild to do something, you should get its guild member instance (such as <Guild>.me). Keep in mind, just because you have permission server-wide to do something doesn't mean you have permission to do something channel-wide
May anyone help me to use mongodb? I use java. My work is much simple or give me a doc so I can read and get all knowledge
Is that Even possible?!
@quartz kindle may u help with this?
TypeError: Class constructor YouTube cannot be invoked without 'new'
``` what does this mean?
In what context?
in a music bot; searching for tracks using ytsr
yea but how do i do that in this?
by the way im tryna convert a spotify playlist to youtube for more context
let s;
for (var i = 0; i < playlist.tracks.items.length; i++) {
let query = `${playlist.tracks.items[i].track.artists[0].name} - ${playlist.tracks.items[i].track.name}`
let results = await ytsr(query)
if (results.items.length < 1) {
s++
continue;
}
const resultsVideo = results.items.filter((i) => i.type === 'video');
tracks.push(resultsVideo[0])
}
Uh
if its a music bot i dont think creating a whole yt playlist per spotify playlist scales pretty well
May anyone help me to use mongodb? I use java. My work is much simple or give me a doc so I can read and get all knowledge
is it possible for me to just invoke outside of the for loop?
i don't know about this because this is the usage in the docs
const ytsr = require('ytsr');
const searchResults = await ytsr('github');
dosth(searchResults);
this is bot dev, your questions seems more general for java development and im sure there're lots of tutorials on the internet @earnest phoenix
The ytsr variable is that just: const ytsr = require('ytsr')?
yep
Console.log that please and try
aite
Ping me once done
May anyone help me to use mongodb? I use java. My work is much simple or give me a doc so I can read and get all knowledge
If anyone relplys me ping me, ty
I'mma sleep
It is
Anybody knows how long does a refresh token lasts?
HEllo
ok so
you should make a randomizer using Math.random
for example
let awnser = ["test1", "test2"]
then
Ok
let ranswer = Math.floor((Math.random() * awnser.length))
then you can see what the awnser is by doing
awnser[ranswer]
so yeah
and you can add more to it
ok
I need something to get me random words into the array
I can't make an array of 50000 words
So, is there an api, or random word generator to use
so like a captcha or something?
Ok sure
Wait
const possible_words = ["abruptly", "affix", "awkward", "bagpipe", "blitz", "absurd" , "abyss", "duplex","dwarves","embezzle", "zombie"]
This is an array I made
I need possiblewords to not be an array, rather a generator
ok so
which gets value from an api maybe
you can search npm or api for this
Doing so. Was seeing if anyone knows
Yup
this.word = possible_words[Math.floor(Math.random() * possible_words.length)].toUpperCase();
I need them to be uppercase
So
ok
ok
discord refresh tokens? they don't have an expiry date
they can be used until they're revoked
or refreshed
hey i have a question. Someone made a blackjack bot and made this message purely in Discord markdown.
Does anyone know how to make that red bar on the left?
oh thanks!!!
RENO i wouldn't recommend you use requests
didn't realize it was an embed
aiohttp
I assume thats for your bot
Requests would be blocking then
aiohttp is async
Much better
error?
can you try debugging?
(Printing)
Authorization should be in header?
thats really good to know, thanks
Hold up lemme write that in aiohttp for you
both aiohttp and requests have params kwarg
Its done btw. Updated and hosted. Fully Functional
noice
i used a 'random-words' api btw
ok
how do i add the ability to allow either selecting a user via Discord ID or a mention in discord.py? like in my arguments for a command?
If anyone else needs help, I can surely do!
message.mentions.members.first()
isn't that for discord.js?
yeah idk python
Or is it same
Wait I have a docs bot too
ik somebody who does this in python but he is offline
i thought that was just for mentions thank you
Does anyone have experience with puppeteer willing to DM me about an odd issue I'm having. It's pretty specific.
does the format ping (ctx, *, member: discord.Member, *, message): also work
do you mean custom status or like dnd
no, you can only have one asterisk
so if i need member and a message after it what would i want to do
It can only have 1 keyword argument, so remove the asterisk before the member
so member without an asterix will only allow one member to be messaged?
and with an asterix multiple people to be messaged
You want to use this then https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html#greedy
you could make a randomizer but use `` instead of "" then put the code in there
it would work
Use greedy
from discord.ext.commanads import Greedy
async def foo(ctx, members: Greedy[discord.Member])```
import discord as well^
asterisk will break the purpose of greedy though
ah true 
i need to sleep
Eeee
why is com.my.calculator.Main.Window at com.my.calculator.Main.main(Main.java:15) and how to fix this
you need to put a token i think
btw whats the problem
just reading the docs it looks like the api wants the guild count as the server_count parameter
hi, this is not discord related but
data = {'server_count': len(client.guilds)}
that's just internal stuff, if you wanted to have the local port be different from the outside facing port, ie the outside facing one can be 80 but internally the program sits on the 2000 port
may be rate limit
could someone help me with this please
Guys, what can you recommend me to integrate chess into a discord.js bot. Any api?
pls why no one helpin me
Btw its not an only chess bot, so nothing too big with extreme computation needs
I don't know too much about java but is it because you're trying to access the method like it's static?
I mean it's probably not a good idea to try to integrate chess into a discord.js bot. Discord isn't exactly a proper gaming platform.
no its not static i think, btw im not so good at java, im still learnin it
Still. its possible, isn't it?
did you import window.java somehow?
I mean yes, with message edits, a lot of emojis, and two people that already know how to play to the fullest.
because the error is saying that Main.Window is null
But yeah I might try some other games easier than chess tbh
The problem with discord is that it doesn't have appropriate inputs for a game
Well, that means it's not appropriate as a platform to do these games.
btw i dont know how to make this main not static
im not a java user, but doesnt the file window.java has to be uppercase to match the class Window?
it dooesn't
and @quiet topaz you never initialize window
it never gets a value
that's why you're getting a nullptr
did that change or is this stackoverflow answer straight up wrong?
i mean about file names needing to be uppercase
What's missing from all the explanations is the fact that Java has a strict rule of class name = file name. Meaning if you have a class "Person", is must be in a file named "Person.java". Therefore, if one class tries to access "Person" the filename is not necessary, because it has got to be "Person.java".
thats from an SO answer
which year is that answer from lol
lmao 11 years ago
the only place where i'd assume that had to be true was for the main file
so java has no concept of importing files? it automatically looks for a file named whatever class you're calling?
so it always loads all files in the dir?
i guess so
you still have to import them to actually use them
but importing works by using namespaces and class names
file names and folder hierarchy are irrelevant
so basically doing new ABC() will work if you have a public class ABC in any file somewhere in the directory
correct
and under the condition that you imported it obviously
there's also a * wildcard which allows you to import everything from a namespace/package
is this a good way to check if a server is added in the database?
if this would run every time the bot starts up and joins a new server
so you do need to import it after all? or does the program import it automatically somehwere?
because in huz17's code, i see no mention of importing window.java in his main code
you do need to import it but most IDEs are smart enough to do it as you type
they exist under the same namespace
serverid should be unique, so why use findAll instead of find.
so package com.my.calculator
Ah, true. Everything else good?
all files with that line will get compiled together?
yes
well
everything gets compiled together
importing is just syntax sugar to prevent pollution
yeah I don't think there's a better way of checking if a guild is in the database



