#development
1 messages Β· Page 1370 of 1
π
we literally explained how to fix it
You checking my another bot


Yes I was checking the bot that got you green roled
Because I was making sure you were not a troll
Try what
??
Nohing
this is why I'm less active in #development and more active on among us because people aren't THIS WORSE
My bot be like 
Lmfao
It's ty means thanks you for help
"Try" and "ty" are 2 different things. Please type it correctly before sending a message
ty means thank you and someone might misunderstand it
especially if you're eating their brain
Name is this for a reason :)
Ok we'll see u later ZACH. Bye ποΈ
Lmao did we started a legit conflict because of a bot
I say sorry π
pls don't fight with me i apologize
hey guys
umm
if i find a glitch or bug on discord
where do i report it?
its not like a major bug or anything
discord testers
will i get compensations? xD
No
guilt ;-;
can u share it with me. I'll not tell anybody, I swear
xD

nuuu
How can I fetch only the owner of the guild?
<guild>.owner.fetch() iirc
but that <Guild>.owner returns null also
weird
you can use const owner = <Message>.guild.owner || await <Message>.guild.members.fetch(<Message>.guild.ownerID);
Aah I see thx, I forgot there exist a members
<Message>.guild.ownerID always exists so you can use that for fetching the owner itself
But y not <Guild>.owner does that and always return a member
let a = message.channel.send("test");
Reva.run(message)
a.delete()
Why i have a error in a.delete()
Ok thank you π π
@solemn jolt you will need to await delete too probably
@waxen tinsel okπ
But y not
<Guild>.ownerdoes that and always return a member
@rocky hearth it tries to get the member from the cache
btw now that i think of it, you can just use const owner = await <Message>.guild.members.fetch(<Message>.guild.ownerID); since fetch() looks in the cache first
so if it's not in the cache, it will fetch it
no need to use <Message>.guild.owner
yes, thats even better that before
Is it valid to override a Parent class property to a getter??
Will all the bots made after October 7 2020 will not be verified?
const client = new Discord.Client({ ws: { fetchAllMembers: true, intents}})```
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.
??
fetchAllMembersshouldn't be inws, put it outside it- remove
'GUILD_MEMBER_ADD', 'GUILD_MEMBER_REMOVE', 'GUILD_MEMBER_UPDATE', these aren't intents, they are events. they are fired if you haveGUILD_MEMBERSintent on
if my bot don't use nekos.life api endpoints, how about @earnest phoenix ?
is there no way i can do something about the image flickers? ;-;
uh
is there a way to speed up a playstream on ffmpeg
currently browsing the docs but theyre beeg
same :sad:
fr look
wrong channel moon
@low orbit yes, are you using any frameworks at the moment or just pure css?
alr
how are you displaying the elements
i meant at your frontend
css grid or what
@crystal wigeon what are you trying to do
pvp card battle thing
but
everything works
except the image reloads and flickers
screen
everytime i edit "only" the description to update the health
html + css? not even like bootstrap or smth
I'm making a meme command, but I don't want any NSFW memes, here is my code:
@commands.command(name="meme")
async def meme(self, ctx):
submission = reddit.subreddit("memes").random()
if submission.over_18:
return
else:
await ctx.send(submission.url)```
Will this work?
ok
it may be submission.nsfw
ok
I have a dashboard, but if i try to go to the servers page, it redirects me to a blank index.html? Anyone know what is causing it?
@stoic hull code
Its created with react, it has no static index.
then send the whole code
It works, on localhost. But as soon as i deploy it, it says '301 Moved Permanently' (The server page).
sned code or we cant really help
Which part do you want me to send....
the index?
There is no index.
huh
React app.
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import { ThemeProvider, CSSReset } from "@chakra-ui/core"
import { BrowserRouter as Router } from 'react-router-dom'
ReactDOM.render(
<React.StrictMode>
<ThemeProvider>
<CSSReset />
<Router>
<App />
</Router>
</ThemeProvider>
</React.StrictMode>,
document.getElementById('root')
);
serviceWorker.unregister();
index.js
so either your router isnt working properly
or the server isnt configured properly
make sure your react app is on the root of your server domain/ip
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]```
and not http://mywebsite.dev/hereismyapp
did you build the react page
Yes.
or are you still in dev
Already ran npm run build.
Yeah, its in the root.
hrm weird then
Like, every part works, but as soon as you auth with discord. It just redirects to a blank index.html.
Saying the page was moved permanently.
auth with discord
uh do you have a server running?
or are you using client side oauth
What do you exactly mean by that?
It just redirects to the oath page of discord, then redirects back to the website. But instead of showing a list of all the servers, it returns an blank index.html.
ok do you have a testing url
might be easier for me to find the problem instead of asking
well yeah I guess
Try mechabot.xyz and click on the 'dashboard menu' text, i still got to fix that button.
uh ok
And?
brb ill try it in a bit
didn't react need index.html too? with div of the class you used in the dom? (root in this case)
didn't react need index.html too? with div of the class you used in the dom? (root in this case)
@restive furnace Yeah, it has an index.html but its one line of code. Only to make the app work.
how do I get the client id?
how do I get the client id?
@rocky hearth
<client>.user.id
@stoic hull show the oneline of code
But <Client>.user returns a null value too
How do I make a discord.py dank memer tax command? I know the tax rates, but how do I use it so if the amount is under 20k, it would be normal, 20k-50k would be 1% etc.
But <Client>.user returns a null value too
@rocky hearth
What the key you get on discord by valueDiscord.Client()
I'm using the get method to a specific website page and it's just giving me the html instead of the stringed json that i'm looking for.
wdym
@stoic hull show the oneline of code
@restive furnace let me go to my pc in a bit.
I'm trying to get this page https://dev.filebin.net/n6j2rlabirb6
Upload files and make them available for your friends. Think of it as Pastebin for files. Registration is not required. Large files are supported.
Upload files and make them available for your friends. Think of it as Pastebin for files. Registration is not required. Large files are supported.
the bin get method
request.get({
uri: `https://dev.filebin.net/${bin_id}`,
headers: {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9,fr;q=0.8,ro;q=0.7,ru;q=0.6,la;q=0.5,pt;q=0.4,de;q=0.3',
'Cache-Control': 'max-age=0',
'Connection': 'keep-alive',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
},
gzip: true
}, function (err, res, body) {
console.log(res)
})````
maybe remove the text/html
nop
change what
the accept header
yes
also, your headers is a mess
replace everything?
remove all headers
ok
eyy
that works.
Thank you!
Now i need to parse the response so it becomes normal json right?
yes, if its a string

can i auto nickname Joined users
with a bot ?
ye
which Bot
what which??
bot
:c
wat do u want then?
@queen kelp if you wan i can create for you
I'lll be glad if you can ReVa
@queen kelp come to privet
@stoic hull just tried and it works?
Do you see the servers page?
yup
with the setup bot buttons
so might be your browser cache
clear cache and cookies
great
I'm so dumb that i didnt think of that.
client.on("guildMemberAdd", async member =>{
console.log("test")
member.setNickname(ββ ${member.author.username}).catch(err=> console.log("we have some err "+ err))
})
This code don't work and don't give me any error in log
did you enable the server members intent?
Bruh I am gonna die reading this JavaScript code ngl
did you enable the server members intent?
@quartz kindle i don't now
^^same
bottom one
did you restart your bot after turning it on?
it needs a bit of time for discord to update the settings
Hey Tim
the <Guild>.me does return a null value. But it is not mentioned in the docs
anyone knows about python and praw?
@rocky hearth it shouldnt ever return a null value
unless you manually remove yourself from the member cache
typings maybe
techincally yes, its a nullable value because its a getter
its also marked as nullable in the docs
but in practice it should never happen, unless you manually remove it from the cache
feels nullable man
@hasty mulch anything within the a tags will be turned into a link
wdym
Only tried the ID.svg end part and the :ID.svg part with the ID being the bot ID
And I have it at the bottom of the long desc
you need to insert it as an image then
and if you want it to be clickable, then you use a tags
so <img src="ID.svg">
and wrap that with a tags, if you wanna link it somewhere
Alright, Iβll try that and lyk
im so dumb- i wasnt getting a reply from commands bc i forgot to use message.channel.send(insert text here)
dumb is part of bot development
oh wait no i messed up the command all together so i deleted it hehe
so
<img src="ID.svg">
@sinful belfry Thank you, it worked
how would i be able to send a canvas image in a discord embed?
turn it into buffer and upload it as attachment
could you please explain the attachment part
im buffering it but it would return a body too big error
like channel.send({ embed: { image: { url: "attachment://image.png" } }, files: [{ attachment: canvas.toBuffer(), name: "image.png" }] });
TypeError: Found non-callable @@iterator
ah right
getting the error i was getting before The resource must be a string, Buffer or a valid file stream.
show your code
so client.cardGen('param1', 'param2') is a function that would return canvas.toBuffer();
https://6n.wtf/p/canvasthing is the function itself
so you're doing attachment: client.cardGen('param1', 'param2')?
message.channel.send({ embed: { image: { url: "attachment://image.png" } }, files: [{ attachment: client.cardGen('aa', 'aa'), name: "image.png" }] });
yeah
<client>.on("guildMemberUpdate") is only fired when the bot itself is updated, is this normal ?
like whenever I add a role to myself or anyone else this isnt fired
well, do you have the guild members intent
do I need to ?
ye
tf are these tho
for guildMemberAdd, update and leave
is this new ?
@honest perch i have no idea
did you restart your bot
@river thistle yes or https://ziad87.net/intents/
ah right thanks for the help anyway
also need the intent enabled in developer portal
if your bot is verified and its not whitelisted, you need to request for that intent
oh wait @honest perch
you didn't await the method
it's an async function
ah right ill try that
yes, itll 100% work
mb!eval (async()=> {
message.channel.send({ embed: { image: { url: "attachment://image.png" } }, files: [{ attachment: client.cardGen('aa', 'aa'), name: "image.png" }] });
})()
``` like this?
Guys
I need help
I am coding from a website named Glitch.
I need ban, unban and mute, unmute codes.
i have some code that sends a message in the channel and then dms the person and for some reason the message gets sent twice but the person only gets dmed once
And Δ± want to ask anotherthing. @pale vessel
When did you get DM from discord for verify your bot?
when it hits 75+ servers
bye
i made an bot XD
@earnest phoenix no
it called Cloudyce
@pale vessel what are they
it's 'message', msg => {})
yes like that
what does that mean
but add message inside
Oh
it means that it is a function

() => {}
The () is just the args passed onto {}
also
does discord.js use strict mode
can i just do x = 5, or do i have to do var x = 5
what is postinstall in package.json
Ooh! that is just a package. lol
Random things appearing in package is just the best
does js have a string.sub() or string.split() method?
Then how do I move a package from dependencies to devDependencies
well
Then how do I move a package from dependencies to devDependencies
@rocky hearth like{ "dependencies": {}, "devDependencies": {} }?
I made a kick sorta thing in lua, ill show what i did and see if this is possible in js
if msg:sub(1, 6) == "/kick " then
does js have a string.sub() or string.split() method?
@earnest phoenix Theres a yt playlist of LearnWebCode called "10 days of javascript"
That will walk you through all the js concepts easily
Yes flaze
should I just move the packagename in json file
maybe like if (message.content.substring(1, 6) == "kick") {}
idk why you would want until 6 though
the point of the sub is so it ignores the kick message
and the other arguments after it are taken in
so the prefix + the args
yeah that's def possible
/kick bob
it ignores the prefix and so now it has only bob, which makes things easier
wait
When doing console.log(<channel>.members)
Do arrays start at 0 or 1 in js @pale vessel
0
ok
well, no cached members that can read the channel
I am in it
are you cached
can you try guild.members.cache.get("300438546236571658") just in case
client.on('message', msg => {
if (msg.content.substring(0, 5) === "/kick") {
var User = msg.content.substring(0, 6);
}
});```
so would something like this work?
but if you're removing the first character, there would be no /
yes
Hey guys
if i said /kick @someUser, would it interpret User as just a string, or would it recognize that as someUser?
@pale vessel
Anyone know how to code bots?
as a string, since message.content is always a string
So how would I convert it to a ping
Anyone know how to code bots?
My music bot isn't working again, it's joining and says it's playing but no sound comes out
you have to parse the string (a mention or an id) to a member
@tight cradle only about 10000 people here know
but thats not enough π
flaze do you know why
did you try debugging
@tight cradle only about 10000 people here know
@quartz kindle lmfao idk how to i want to code a bot
I don't wanna ssh
did you try begging
hey im makin a backup command, not sure what i should put as the required permissions
try client.on("debug", console.log);
UUUUUUUUUUGH
@tight cradle have you ever coded anything in your life? do you have any experience with any programming language?
would have just done Admin but then my bot won't be accepted lol
@tight cradle have you ever coded anything in your life? do you have any experience with any programming language?
@quartz kindle i have never coded anyting in my life
damn
so the first step would be to learn a programming language and get an online course
you're in the wrong channel mate
there are good websites where you can learn, such as codecademy and others
there are good websites where you can learn, such as codecademy and others
@quartz kindle Ok
you will need to pick a programming language to start with
good languages for starters are javascript, python and C#
@tight cradle I would try to get a decent understanding of atleast scripting logic before u attempt to make a bot
@tight cradle I would try to get a decent understanding of atleast scripting logic before u attempt to make a bot
@earnest phoenix Ok
ill try coding bots
i want that early verified bots
you cant get that anymore
I would recommend an ide
you need to learn how to code first
Notepad
@earnest phoenix i have NotePad
if you want to make a bot without coding, look into discord bot maker or bot designer
how to update this to v12 ??
client.users.size
How do I keep my bot online?
VPS's are great options
If I do node . It only stays on for like a few hours
it stays on as long as your system is on and the bot doesnt crash
a process manager can keep it up through crashes.
a VPS or proper server can keep it up without depending on your system being on.
Yo Guys so like i am watching yt how to code bots and i am doing it with them but i am coding with notepad but like is it still gonna code my bot?/
like valurim said, notepad is a bad idea
you should look into getting visual studio
or any IDE you like
like valurim said, notepad is a bad idea
@solemn latch o
yo @solemn latch can i code bots with github?
github is a platform for devs to work together.
you should really use an IDE
Maybe something like Visual studio code
π€·ββοΈ
It converts the image in the URL twice.
function isUrl(s) {
var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
return regexp.test(s);
}
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'rainbow.png'));
if (isUrl(args[0])) {
const {
body
} = await request.get(encodeURI(args[0]));
const data = await loadImage(body);
const canvas = createCanvas(data.width, data.height);
const ctx = canvas.getContext('2d');
ctx.drawImage(data, 0, 0);
ctx.drawImage(base, 0, 0, data.width, data.height);
const attachment = canvas.toBuffer();
if (Buffer.byteLength(attachment) > 8e+6) return message.channel.send('Resulting image was above 8 MB.');
return message.channel.send({
files: [{
attachment,
name: 'dosya.png'
}]
});
}
I just want it to transform once, what should I do.
hmm check if more than one attachment is sent
i did, no problem
message.attachments.first().url converting. converting user avatar. but it converts the URL 2 times.
Can I create a Webhook URL with heroku (free) and if yes how can I access to it ? or no, how can I create one for cheap pls
yes you can
the url is YOURPROJECTNAME.herokuapp.com/dblwebhook if you use dblapi.js
I'm trying set a process.env variable like in console - set NODE_ENV=development&&yarn start, but it is not being set
what did you try?
I'm trying to deploy the app to heroku. I've used the dotenv till now.
Now I want not to run the if block on heroku
This is my config.js
also flaze, one more thing, how would the image thing look if done with an embed constructor instead
use new Discord.MessageEmbed().setImage("attachment://image.png").attachFiles({ attachment: buffer, name: "image.png" });
I think that is a mac issue.
@quartz kindle do I have to create a webhook like this? if yes, I've enter the link like you said for webhook url and when I press "test" , nothing append 
though im getting TypeError: Cannot read property 'path' of undefined which im guessing is something with discordjs?
havent used the embed constructor in a long time
I think that is a mac issue.
@rocky hearth well, is theNODE_ENVenvironment variable set todevelopmentor not
this should do it #development message
@earnest phoenix no
@earnest phoenix is your bot made with discord.js or discord.py
@sudden geyser thx, it just worked. On windows set is used but on mac export is be used
I don't think you need to prefix it with export
You should be able to set it as any KEY=VALUE
@pale vessel https://6n.wtf/p/npcmd
@quartz kindle discord.js
@sudden geyser Nope, it is giving errors that way.
interesting
@earnest phoenix do you use dblapi.js?
someone can help me with lavalink?
yes @quartz kindle
just ask your question
@pale vessel so simple, how i can add lavalink in my discord bot
then all you need to do is enable a web dyno in heroku and configure your dblapi.js for webhooks
well first, you need a lavalink node
once you get your node working, you can get a lavalink wrapper for your bot
a good one is shoukaku
some use erela.js or whatever its called
....
personally i use erela.js, its gotten much better over the time
so how
you should read their readme first, it tells you all the requirements: https://github.com/Frederikam/Lavalink/blob/master/README.md
download the server https://github.com/Frederikam/Lavalink/releases
create an application.yml, you can see an example here https://github.com/Frederikam/Lavalink/blob/master/LavalinkServer/application.yml.example and start the server
so @quartz kindle , I only need to activate this option on heroku webhook ?
and complete this (yourDBLTokenHere means top.gg token ?)
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});```
how lavalink will work with heroku??
you need to host a node server somewhere
its possible to host it on heroku but it needs the web worker, which sleeps
so its not ideal
note that you shouldnt even do this in the first place
heroku is not good for these types of things lol
you need a very stable connection for lavalink
one that wont drop
else the song also drops
does yarn not work with heroku?
Yarn works with Heroku
it says it does not recognize yarn
do you have the yarn.lock file
@earnest phoenix you dont need heroku webhooks
you just need heroku web dyno
the same web dyno you use if you want to run a website in heroku
it needs it in order to detect yarn
So say goodbye to your brains
connection.query(`SELECT * FROM publicguilds WHERE status = 'true'`, (err, publicguilds) => {
var bar = new Promise((resolve, reject) => {
publicguilds.forEach(r => {
amount = 0;
client.shard.broadcastEval(`this.guilds.cache.get('${r.id}')`)
.then(gs => gs.filter(g => g)[0])
.then(g => {
var bar2 = new Promise((resolve, reject) => {
g.channels.forEach(c => {
const channel = client.channels.cache.get(c)
if (channel.type === 'voice') {
amount = func.calculator(amount, '+', channel.members.size)
resolve()
}
})
})
bar2.then(() => {
if(amount === 0) return;
guilds = `[${g.name}](${r.invite}) | ${g.members.length} | ${amount}\n`
resolve()
})
})
})
})
bar.then(() => {
//end code here
})```
Trying to make it wait for the foreach to end with the promise before doing the rest
Not waiting for some reason
does yarn use package.json?
@quartz kindle so I just need to activate that ? (sorry if it's not again that
)
oh it does
yes, I work with yarn
@earnest phoenix yes
@quartz kindle okay thx u very much, I will try it and I will keep you informed
seems like its still using npm for some reason
are you sure you committed the yarn.lock file?
@blissful coral you could directly return the bar2, and use one more then
@safe creek you don't need it
@rocky hearth wdym
Oh ok
just don't
@pale vessel nope I didn't, I told before that I added that file to gitignore
you don't need
But what does it serve?
idk 2
you have to do that in order for heroku to use yarn
This is the procfile worker: npm run build && npm start now
otherwise it will use npm by default
pr ?
ok
@pale vessel do i have to create a branch have name gh-pages?
but aren't they are just to run the scripts
ok lemme switch back to yarn
@pale vessel do i have to create a branch have name
gh-pages?
@willow mirage nah
ah ok
@pale vessel
do i have to edit here?
ah not
so just add the name.js.org to custom domains
that is ?
wtf
yes i did
then it should be clear
Step 4
To finish the procedure, make a pull request in this GitHub repository that adds your subdomain to the list of existing JS.ORG domains. Your new URL should go live within 24 hours (keep an eye on your pull request in case of a naming conflict).
i don't understand this step
@blissful coral you could directly return the
bar2, and use one more then
@rocky hearth Just going to use Promise.allSettled()
you have to fork the repo and modify that file
add your site in the correct order and make a pull request
weary
sorry man, thats the best i can explain to you
im really tired
how to make this?
Does anyone know the cause of the problem?
[Python]
If anything happens, just label it.
with the field?
Does anyone know the cause of the problem?
[Python]
If anything happens, just label it.
@granite canopy you do not have return
ah
i understand it
so
i have to add the domain in add custom domain
and then make a pull request of their repo
@pale vessel right?
@granite canopy you do not have return
@tired panther how so?
For some reason it sends the message 3 default
is it working?
yes
all right then
nvm
yeah, you changed the CNAME, right?
you have to before creating the PR
yes
fork it
clone it first, yea
and then?
Well, I dont know whats this now
im pretty sure theres no fork in git itself
try cloning it first
i don't even know why you're using the terminal
just use github web
edit the file
what file
i dont think you read the README
ah
@pale vessel
"moddy": "cutiecat6778.github.io/ModeratorBot-web-gpages"
like this?
ah shit
imma fix the name
@pale vessel like this?
that looks right
now go to https://github.com/js-org/js.org/pulls and press "New pull request"
oh lord
im braindead
he didnt create a pr yet
oh shit
wait did you delete your fork?
ye, i think imma give up. Imma use freenom
you were so close lmao
hi
@pale vessel no
well, you do you man
i see
No
go to fiverr or freelancer, not here
It takes longer to make a bot then a hour with some
well, just not here
Im back.
@quartz kindle huh so I try for port 5000 and 3000 and It doesn't work
(the yellow error is when I test the webhook with top.gg)
Has to have custom commands
Is it possible to color the selected star amount when reviewing a bot with CSS? I can do a hover effect and change the fill color of the stars themselves, but I'm unsure about adding a secondary color to represent the amount chosen for the review. Has anyone played around with this yet?
You make them
We are actually coders not people that sit behind a dashboard that does it for us
So we do not know how it works
So we do not know how it works
@blissful coral
^
Read the message, we don't know how Botghost works. Better to ask somewhere else MagiYT.
502 Bad Gateway
nginx/1.14.0 (Ubuntu)
Dude
This channel is meant to help with coding
Not with a dashboard to code for you
Oh ye
Is it possible to color the selected star amount when reviewing a bot with CSS? I can do a hover effect and change the fill color of the stars themselves, but I'm unsure about adding a secondary color to represent the amount chosen for the review. Has anyone played around with this yet?
@craggy pine probably needs javascript for that
I miss my JS abilities.
ah, wait you mean the bot page?
Yas.
@pale vessel thhx but I get the same error =(
like this? @craggy pine
Eh not quite. I'll make you a gif.
these
Like if I wanted to change the blue to something different.
ah, when reviewing
I've gotten the pretty much everything in review customized besides those.
One message removed from a suspended account.
One message removed from a suspended account.
there's the shardReady event that provides the shard id as it goes ready
One message removed from a suspended account.
One message removed from a suspended account.
Can a bot avatar be changed after getting verified?
One message removed from a suspended account.
One message removed from a suspended account.
but not name right?
One message removed from a suspended account.
u sure?
@craggy pine i tried playing around with it, it seems that it needs javascript since it checks for the data-stars attribute to set the blue color
One message removed from a suspended account.
@client.command()
async def getspam(ctx):
if ctx.message.channel.id == 764903888054517761:
with open("spam.json", "r") as f:
spamloaded = json.load(f)
listing = spamloaded.keys()
n= len(listing)
num = random.randint(0, n-1)
spammm = listing[num]
await ctx.send(spammm)
else:
channel = client.get_channel(764903888054517761)
await ctx.send(f"You are only allowed to use this command in {channel.mention}.")
no error but it doesnt send anything
Anyone an idea how to catch if the bot cant add reactions to a message? (JDA)
As error is shown ContextException but when i try to catch it with ContectException the IDE says me: The exception is never thrown in the try block
https://www.mongodb.com/
How do I import this into Python
find a python driver for mongodb
you can ping shiv for help, maybe
i'm not familiar with these in python
Iβm friends, so I might just message him
Anyone an idea how to catch if the bot cant add reactions to a message? (JDA)
As error is shownContextExceptionbut when i try to catch it withContectExceptionthe IDE says me:The exception is never thrown in the try block
@tranquil copper anyone?
how do i make something like that
ty
Hii, I need help : the error is that my bot restart automatically alone ( i do anything ), my bot is hosted via a VPS ( pm2 )
What can i do to fix that?
@earnest phoenix It could be anything you need to provide a log or something or screenshots so we can help you
channel.sendMessage(RulesBot.getInstance().getUtils().SETUP_MESSAGE).queue(msg -> {
msg.addReaction("\uD83E\uDDED").queue();
msg.addReaction("β").queue();
msg.addReaction("\uD83D\uDCDD").queue();
msg.addReaction("\uD83D\uDD10").queue();
msg.addReaction("\uD83D\uDCCC").queue();
msg.addReaction("\uD83D\uDD11").queue();
});
Anybody know how to catch if the bot has permission to add reactions?
@delicate zephyr If you are able to answer my question from #general in here, that would be nice.
Or wait lemme just paste it here:
So here (in screenshot below) is where the main magic happens within the run method of d.py client. runner function results in a aiohttp websocket loop btw. dpy allows you to give it your own loop object when initializing client, so do i just need to do something like:
loop = asyncio.get_event_loop()
loop.create_task(my_websocket_function())``` and pass that loop object into client?
@ me if responding please, and thanks.
Which option do I download, do you know?
server, i guess?
And platform?
@restive furnace On a Raspberry Pi?
raspberry pi is debian, right?
yes, thats debian
Thereβs 9.2 and 10
ah hes installing mongoose nvm
@hasty mulch do neofetch and see which is urs
sudo apt install neofetch
and neofetch
sudo rm -rf / --no-preserve-root
@pale vessel invalid option '/'
ok then select the 10
@restive furnace And package is mongos?
i think its server, but it can be mongos tol
yes
@restive furnace
i hacent honestly installed mongo ever so i cant really help
ask flaze or someone else
@pale vessel
how do i make my bot on top.gg to customize the page like other users
iknow its code
@earnest phoenix elaborate
to make the page colour-full
color changing css bad
...
@earnest phoenix You mean a custom color?
To my knowledge you cant change the color of the page itself, but you can do what you want for most part in the Long Description field.
you can change everything
you can throw whatever html or css styling (that isnt flashing and is just solid and chill obviously) in long description, but as far as editted the rest of the page I dont think so
or not
listen to @pale vessel not me they are more reliable lul
ineed help like a skeleton of the code.
@pale vessel how would you do it basically
like wut
change literally any element outside of long description on your bot page
the <style> tag can change any element in the page, it doesnt really matter where you put it
you can use normal css selectors
im back
ah ok fair enough
what does tag mean, I am confused
bot.on('message', msg => {
if (msg.content.substring(1, 5) === "/kick") {
var User = msg.content.substring(1, 6);
}
});``` @pale vessel you said i should parse it too a tag/ping
how can I do that?
look up html style tag on google @earnest phoenix
i want "@earnest phoenix" to become @earnest phoenix
@pale vessel
except the first one doesnt ping me
like
because its a string so it cant
ah
thanks
it'll be converted to <@id>
How would I transform it too a ping exactly
like
User.Tag
thats not a valid string operation
but it is for a user
so how do i make it a user variable if u get what im saying
so you want to convert "valurim" from the message content to a member that you can kick for example?
does thumbnail accept attachments?? images only
yes
ok so
everything supports attachments
flaze, you know how if u want to do any sorta operation too a user you have to have their user obviously
anyone on this?: #development message
do you mention the user for the command or do you just put their username
mention
ic
you can just use message.mentions.members.first()
that would get the first mentioned member
the tag?
string > user
bot.on('message', msg => {
if (msg.content.substring(1, 5) === "/kick") {
String StringUser = msg.content.substring(1, 6);
let User = msg.mentions.members.first(StringUser)
}
});```
so like this?
types 
what
is it possible to create 2 attachments and send it with embed?
so then what do i do
const attachment = new MessageAttachment(`url1`, "enemy.jpg"); // const playerAttachment = new MessageAttachment(`url2`, "player.jpg") embed .setImage("playerAttachment ://player.jpg") .setThumbnail("attachment://enemy.jpg") .attachFiles([attachment, playerAttachment])
dos this look right?
im getting an error
what error
message.mentions.members.first() gets the first member that is mentioned
you dont need to mess with message.content for this
you can kick, ban, etc
its still all a string
yes
"not well formatted " is the error im getting
everything is a string
theres no such thing as a member inside a string
its all a string
i know
the library parses the string
thats why im trying to convert it
the library converts it for you
yes
user:kick()
not a user
users dont have anything to do with guild/server
members are
for example users dont have the roles property
members do
you want member.kick()
well you need a valid member
no, you're trying to convert it to a user
like i said, you cannot kick or ban a user
it doesnt have any guild property
omg ill change the variable name to member
thats not the point
im just asking how i kick them
find a way to get the member first
how
