#development
1 messages · Page 1540 of 1
I have that on Java, not sure if JavaScript has it tho 
it's the only one I need and my moderation bot is done
a warn command is very simple
you just create a new row in your db every time the command is called in the correct columns with the correct data
warner id, warned id, when, pk probably being the case num.
Assuming they're using SQL
But then I wouldn't assume they know what SQL is
Or what a row is
Or what a db is
true 


dropMsg.react('🎉').then(() => dropMsg.react('🎉'));
const filter = (reaction, user) => {
return ['🎉'].includes(reaction.emoji.name) && !user.id === '779130889565110343';
};
dropMsg.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === '🎉') {
let winner = dropMsg.reactions.cache.get("🎉").users.cache.filter((u) => !u.bot).random();
channel.send(`Congrats ${winner}! You win!`)
} else {
return
}
})
.catch(collected => {
channel.send('**Drop exceeded the giveaway time limit! Ending...**');
});
``` i did this but when i react, it does nothing, why?
you're using a ! in your filter
hm
the filter will always return false
okay
!user.id returns false because user.id is always a string and ! means the opposite
you need to do !==
??? Then why are you asking for help here
i don't want to include the bot in it
i want anyone to react
not just the author
... I don't think you know what I'm talking about then
but not allow the bot to pass
I know 
Then you should also know that it's going to fix your problem, lmao
okay
just gonna hop in and say top.gg is the fucking bomb and it works. we got verified two days ago and grew over 100 servers
you didn't know after all did you
UHhh OkAy
const commandFiles = readdirSync(join(__dirname, "command")).filter((file) => file.endsWith(".js"));
for (const file of commandFiles) {
const command = require(join(__dirname, "command", `${file}`));
client.commands.set(command.name, command);
}
I want to return if false value comes out in the code below, but if I put it in a for statement, the message keeps repeating, and if I put it in another column, the return value doesn't work.
fetch(BASEURL + '/bots/voted/' + message.author.id, { headers: { token } })
.then(r => r.json()).then(r=> {
if (r.voted == false) {
let embed = new MessageEmbed()
.setColor("FA003D")
.setTitle("name"
.setDescription("description")
.attachFiles(new Discord.MessageAttachment(`${__dirname}/Image/Help_Guide.png`, 'Help_Guide')).setImage('attachment://Help_Guide.png')
message.channel.send(embed)
return;
} //
})
.catch(e=> console.error(e))
I thought a lot about this, but I couldn't get an answer.
i'm not sure if this is the main problem, but your request header token should be Authorization
Oh, the request token works fine to prevent the execution of js in the command when a simple false is returned.
oh the main problem is that the return statement is inside the .then() function, which means that it's not going to do anything outside of it
you might want to use async/await for this
Okay thanks
Lol
Mines in 1 month look 👀
pog
const { Client, MessageEmbed, version } = require("discord.js");
const moment = require('moment')
var eco = require(`quick.db`);
module.exports = {
name: "userinfo",
async run (message, args) {
const people = message.guild.member(message.mentions.members.first() || message.author);
let username = people.user.username
let registered = moment.utc(people.user.createdAt).format('MMMM Do YYYY');
let joined = moment.utc(people.joinedAt).format('MMMM Do YYYY');
const embed = {
"title": `${people.user.tag}'s userinfos`,
"color": "RANDOM",
"thumbnail": {
"url": (people.user.avatarURL())
},
"fields": [
{
"name": "User ID",
"value": `${people.user.id}`,
"inline": true
},
{
"name": "BALANCE",
"value": `*`+coins+`*`,
"inline": true
},
{
"name": 'USER ROLE ',
"value": user.roles.cache.map(role => role.toString()).join(" ,"),
"inline": true
},
{
"name": "JOINED ON",
"value": `*`+joined+`*`,
"inline": true
},
{
"name": "REGISTERED ON",
"value": `*`+registered+`*`,
"inline": true
},
{
"name": "USERNAME",
"value": `*`+username+`*`,
"inline": true
},
{
"name": "Social Links",
"value": "[Invite Bot](https://dis.com/oauth2/authorize?client_id=734537695698878565&scope=bot&perm=2147483) | [Support Server](https://di.gg/)"
}
]
};
message.reply({ embed });
}
}```
For some reason this ain’t working
No errors btw
probably a very dumb question, but can private data be cached by cloudflare while still being authorized by the webserver?
the cache control header is "public" just didnt think it was possible to have something on a cdn and still be authorize-able.
https://woo.pics/images/1d43170f10.png
I don’t think so
Lol
i might not love cloudflare, but their documentation is so good
Btw do you see anything wrong with my code?
So I made a withdraw command and whenever I run the command it gives the error Command raised an exception: TypeError: 'Member' object is not subscriptable. Please not that this is a cog within discord.py and i have not defined ANY member object. Thank you for helping if you do!
Code: https://srcb.in/KxxLH4yFKo
your people variable might be a user, or a member, which wont work when its a user.
It’s MEMBER I think
i haveb't defined a member object
so it doesn't make sense
oh wait nvm
u were talking to some1 else
oh wait, what is even happening in this line
const people = message.guild.member(message.mentions.members.first() || message.author);
🤔
you can just use the message#member property rather than using the .guild.member method.
so can no one answe my question?
dont think anyone who knows py is on right now.
oh
rip
dw i can find help in another server
not to be rude or anything
them's the breaks
the py discord server is super good
i'll call a drunk python dev
shiv 
statikk shivaco
i'm a d.py dev
but sober
rubbish
what's going on exactly
um
So I made a withdraw command and whenever I run the command it gives the error Command raised an exception: TypeError: 'Member' object is not subscriptable. Please not that this is a cog within discord.py and i have not defined ANY member object. Thank you for helping if you do!
Code: https://srcb.in/KxxLH4yFKo
thats an exact descriprtion of whats going on
The error means you tried doing x[y] on something that doesn't support it
50% the internet is ~bin sites ain't it?
netflix
@severe cedar i don't see an issues with your code
from utils import permissions, default
defaultImportError: cannot import name 'permissions' from 'utils'
(C:\Users\jusmi\AppData\Local\Programs\Python\Python38\lib\site-packages\utils__init__.py)```
anyone help
but that means you most likely did ctx.author/user[xyz]
like this if amount>bal[1]:
but with a member
That's on example, but the error will tell you where
huh
@earnest phoenix you didn't import it properly
how should i do it
then
problem is errors don't show up in my console due to the fact i did that thing where it sends the actual error to the channel
so i don't know the line
im kinda confused
Then you'll need to debug what update_bank and get_bank_data return.
Because either of those two aren't subscriptable.
Anyone know how I could private my project on glitch.com?
Or if you're able to make it easier, edit where you log the error to the channel to log the error to the console so you can see where it's coming from
because it could ideally come from a lot of places
It's exposed and the only way is by upgrading.
The key is you're using a subscript on a Member instance
✨ get a vps ✨
What's a vps? lol
wh
anyone up for chess?
a virtual private server
a virtual private server.
0exe this is dev
Oh.
I don't even know how to play chess
you rent one for your projects
and your code is private
how do you set a true or false thing for the current guild using a command? (djs)
btw, i'm using quick.db
db.set('thing', true)????????????
So um guys my bot just died and isn’t booting up
you want us to work with that or are you gonna give us an error to help you
heck
Well, um I don’t really know...
i'm not getting anyway
There’s no errors @trim saddle
anywehre*
yikes
@earnest phoenix how are you hosting it and what did you build it in
is this right?
does repl.it run continuously? I think you need uptime robot to constantly ping it or it shuts off
get a dedi
yea
ok
I just resented the uptime robot and the token but still nothing @drowsy grail
dedi for something that can be hosted on repl 
^
Lmao
no need for a dedi lmao
YO top gear my man
h
Btw, is this a variable for every guild? I want something like anti spam enabled on a guild or not. is the code i made for that?
Want me to inv you to my repl.it?
thats a variable for all guilds yes
@earnest phoenix what language is it in
JavaScript
oh sure
Hmmm, it doesn't work. it's supposed to change from false to true
@misty sigil finish this for me
const overwrites = {
VIEW_CHANNEL:
}
i'm too lazy
wh
wh
i need more context if im gonna be your code monkey
fricking filling out an array of overwrite permissions
too lazy to write them all
so i'm paying you nothing to do it
the way you get a programmer to do something is you write it as poorly as possible and someone will correct you
oh yeah my bad
yea just looking out for you
var overwrites: {} = { VIEW_CHANNEL: }
perfect
Is there anyway to get an emoji media link?
Message:
Bla bla bla
Output:
https://cdn.discordapp.com/emojis/665603897095880759.png?v=1
yea, its just https://cdn.discordapp.com/emojis/<emoji ID>.<extension>
yeah, I know the raw message provides the name+emojiID, just askin incase its a way better to do it
raw message will give me !KEKW
depends on your lib
djs
Uhh so, i used quick.db
but my quick.db command changes the variable for ALL GUILDs
i want it to change the variable for only the current guild
const Discord = require('discord.js');
const db = require('quick.db');
module.exports = {
name:"test",
execute(message, args){
if(db.get('trueTest') === true){
db.set('trueTest', false)
message.channel.send(db.get('trueTest'))
}
else{
db.set('trueTest', true)
message.channel.send(db.get('trueTest'))
}
}
}```
you can use guild.emojis.cache.get(emojiID).url @ionic dawn, maybe you could find the emoji id using regex
someone help here 😐
the db is global ofc??
nvm i figured it out lol
How to fetch the last message?
message.channel.messages.fetch().then , want to limit it to "1"message
iirc it's {limit: 1}
oh, just wanted to be sure lol
how would i get each element in this object?
for, while, do while, forEach, map, peek, etc.
you choose it
You want to get all the elements of the arrays existing in the object?
Or what are you trying to do
yeah that
You should either use Object.values() and filter all values that are arrays by Array.isArray() and concatenate all of the arrays by <Array>.concat(), or use a for loop and do the same thing
Btw i would recommend using const or let in this context instead of var
okay got it!
may i ask what website or app that is? i need a good one
[sorry mods this isnt development related]
That's npm runkit
Anyone know how to get an emoji's id?
RunKit notebooks are interactive javascript playgrounds connected to a complete node environment right in your browser. Every npm module pre-installed.
With a bot?
Or just manually?
Codeblock
this is console.log(value1+value2)
const moving = dex2.findPokemon(currentMon.name);
const text = dex2.findPokemon(currentMon.name)
const charge = text.moves.charge
const quick = text.moves.quick
for(const key in charge) {
const value1 = charge[key];
for(const key in quick) {
const value2 = quick[key];
```
@quartz kindle wake up
i have a typing issue question
And why are you getting the pokemon or whatever twice
guys where can I paste a css code and call it from my website without getting the text/plain MIME error????
dont wait for me lol, ask the damn question
save it in a css file
can't
why
because I can't add or edit files
why
why not just throw the css in a style tag
then is it even your website?
you did
I'm doing a script for custom css for a website
"from my website"
my mistake
if you want to apply custom styling to other websites, use a browser extension
there are many of them like ^
@trim saddle
I wanna make my own script to do this though
+starbot
U
this dude
@rustic nova @rustic nova

can you not randomly ping people
why
thanks
@rustic nova @rustic nova


if you want to make your own script you will need something like tampermonkey
to inject js into websites
lmao
but i did need you because ts is dumb
@quartz kindle yeah I use tampermonkey
but I get the error
while injecting css from a website
@quartz kindle await await await await fetch("https://tim.gay ")
why is there a %22
yeah so which website can I use not to get that error
it's still a "
what
code?
it's a simple css code
i mean the tampermonkey code
.something {
background: #ffffff
}
oh
let head = document.head||document.getElementByTagName('head')[0]||0
this.resources = document.createElement("link");
this.resources.rel = "stylesheet";
this.resources.href = "website to call css from but not to give me the error"
this.resources.disabled = false;
head.appendChild(this.resources)```
@quartz kindle
this.resources.type = "text/css"
really?
holy crap I must be dumb
@quartz kindle it didn't give me the error but the css didn't change
do I put it before the href or after
doesnt matter
can you check in the dev tools if the link tag was correctly appended to the head?
is there any mention of its styling in the css list for .something?
did the file show up in the network tab? whats its status and response?
so the style shows up in dev tools?
it shows as a "link"
but it's to append
the head
I had an example code for a different website it worked
bit I gotta pay to use it
can you show a pic?
of the website?
of the dev tools
ok
sent
and the css list?
which list
click on the element with class .something and show the css list for it
you mean element.style
i mean what shows up in the dev tools, right side
yeah some css shows up
does yours not show up anywhere on this list?
not even crossed out or grayed out?
nope
nope
reload the page with the network tab open
doesn't appear to be anywhere in that list
what about the console tag
my adblocker blocks some scripts but I don't see it blocking my css, besides the previous example one was working with my adblocker so I don't think that's a problem
nothing about content security policy?
they allow the change of css
but do they allow linking external files?
well yeah I think
well i cant think of anything else without seeing it
are you 100% sure its not in the console tab? can you show a pic including all errors?
i got an eventhandler class with a generic type
abstract class EventHandler<E extends keyof ClientEvents> {
protected constructor(
public readonly eventName: E,
public readonly client: Client
) {}
public abstract execute(...args: ClientEvents[E]): void;
}
and i want to extend that class for my event handlers like this, but i get a "missing type argument" error:
class ReadyHandler extends EventHandler { // ERROR: Needs a type argument
public constructor(client: Client) {
super('ready', client);
}
public execute() {
console.log(`Logged in as "${this.client.user?.tag}"!`);
}
}
is there a way typescript can infer the type argument with the super() call?
anyone tho?
Hi, im trying to make a command that adds an emoji using an attachment, everything is going good so far, but im trying to make a confirmation message that includes the same emoji that has been added
idk why I can't get it to be sended.
but.... timmy senpai.... i want You to answer my question
msg.guild.emojis.create("foo/foo.jpg", "Emoji name").then(x => {
msg.channel.send(x)
});
Shouldn't that return the created emoji? 
does it work if you do new EventHandler("ready", client) ?
nu
daddy tim
yes, it should return the full emoji object
from which you have to chose what you want to send, name? id?
<:${x.name}:${x.id}>?
although emojis have .toString() methods, so they can be concatenated
.send(`bla ${x}`)
``` should work

idk why i was trying to get the emoji after the emoji was created using guild.emojis.cache.get. blablabla
like other emojis
Sorry for bothering you
should work any way
Couldn't find the emoji object on the guild
did you await it?
yeah
anyways, that should work, just need to add something like if(x.animated) etc
thanks anyway 
👍
hey tim, is there an easy way to TTL a file on the filesystem?
i can do it by hand just checking expiration times, just wondering if there was an easier way.
just making my own image hosting for woo.pics, want images to expire after some time.
or well specific images.
yea it does work that way
but not with super calls
hmm i guess you'd need timeouts or cron
i have the mongo entires with an expire time, i was hoping to ttl them at the same time. think i will just ttl them together with something custom, for the fun of it.
does mongo have pub/sub? or an event that fires when a file expires?
can you show the full error?
oh pog it does, thanks
@quartz kindle dadddyyyyyyyy 
owo
uwu
the error was just Generic type 'EventHandler<E>' requires 1 type argument(s).
i got it to work in the end, thanks for the help anyways 
is there any way to timeout regex without forking a process?
actually
never mind
else if(db.get(`${message.guild.id}.welcomeChannel`) === null){
const embed = new Discord.MessageEmbed()
.setTitle(' To enable welcome messages, you need to set a welcome channel!')
.setDescription('You can set a welcome channel with `p!set-welcome-channel [channel]`')
.setColor('RED')
message.channel.send(embed)
}``` so i checked if a variable is null. it passes it, why?
because it is null
it's like undefined, but it's not undefined 
basically means "this is defined, but doesn't have a value"
so can i use undefined instead of null?
you probably want to use null
but i did, and it passes the else if statement?
here
else if(db.get(${message.guild.id}.welcomeChannel) === null){
oh in that case you should use whatever the function returns as "not found"
sooo, undefined?
mongoose returns null for not found documents, but idk what it might be with quick.db
dunno
Okay
just use !db.get('thing')
javascript has some "falsey" values, which include null and undefined
ok
so uh, undefined work
aight
client.on('guildMemberAdd', member => {
})``` how do i check which guild the member joins?
member.guild
okk
like this?
client.on('guildMemberAdd', member => {
const currentGuild = member.guild.id
})```

client.on('guildMemberAdd', member => {
const currentGuild = member.guild.id
if(db.get(`${currentGuild}.welcomeStat`) === true){
const welcomeChannelSend = db.get(`${currentGuild}.welcomeChannel`)
const welcomeMsgSend = db.get(`${currentGuild}.welcomeMsg`)
const welcomeChannelSend1 = client.channels.cache.get(welcomeChannelSend);
welcomeChannelSend1.send(welcomeMsgSend)
}
else{
return
}
})``` it does nothing. Why?
make sure you have the guild members intent
aight
why are you doing so many calls to your db wtf
can't you just keep those three in a single object?
^
just db.get(currentGuild)
should return an object containing all of it
also, this doesnt do anything, you can remove it
hi guys need some help on my bot development
discord has been constantly shooting down my server members intent verification
I have a guild leaderboard feature, is there a way to implement without the intent ?
depends
what exactly does your leaderboard need?
what does it do with the members intent?
so I currently have a database of user profiles based on discord id
currently what i have is get the list of a guilds members and check which ones in that list have a game profile in my database
but this one needs the intent
why not the other way around?
check which profile is in the guild ?
get list of game profiles from db and fetch their members
this would mean i'd need to fetch every member each time i refresh the leaderboard would it not?
yea top10
so just fetch 10 members
of the current guild
you can fetch them all in one request
guild.members.fetch({user:[id1,id2,id3,...]})
actually its user, not users
but yes, user accepts an array of ids
and iirc you can fetch up to 100 at a time, without the members intent
limit is set to 50 by default
would I not be sending my entire list of ids everytime i need a leaderboard refresh though with this ?
depends
fetch also checks the cache
what kind of refresh do you need?
Has anyone with bigger bots (like more than a few thousand servers) had Broken pipe errors? No idea what it means and it seems to stop the bot working in certain servers
after i fetch once does it cache indefinitely as long as my bot is up ?
yes
but without the intent, the members wont get updated, for example you wont receive nickname changes and role changes
so heres the issue in my mind i need to know which of my list of profiles is the in the current guild that i'm trying to rank the top 10 by
for that I need to recheck on each leaderboard call because they could leave the guild, new ppl could join
I have both, per guild and global
global is fine
no issues
its the per guild I'm struggling
so the per guild list should have guild ids stored with the profiles, no?
yes but they would be in different rankings in each guild no?
i was relying on the guild list to check against
yes theyd be differenly ranked
so if you have a guild-specific ranking, how do you know which ranking belongs to which guild in the database?
What I currently do is check which profile ids are also in the guild's id list, then rank those
i mean yea i guess, it would show 1 through 10 of the members of that guild
but if a member is in 2 guilds, he would have the same amount of points in both right?
yea but he could be #8 in one and #1 in another
yes points are the same
so in this case there is not much you can do besides fetching the top members 100 at a time until you found 10 that exist in the guild
kinda
they will get cached, so whatever can be reused later will be
but still
worst case scenario, you got a guild with 9 members and one of them has the lowest points in the entire database
you will fetch your entire database until you end up with those 9
right which was what I meant by wouldnt i need to run my entire list each time i refresh my leaderboard
kind of defects the leaderboard purpose if I dont update it live no? haha
that's such a weird to handle this though, usually you'd either show your global top 10 regardless whether they're in the guild or not or you would store per guild 🤔
i have a global top 10
didnt tatsumaki do things like that tho?
what do you mean by store per guild
different ranking per guild
aka you have 50 points in one guild, you join another, you have 0 points there
ahh i see
well was working fine till i hit the intent verification wall
such a frustrating verification process
ye
the best you can do is fetch 100 at a time
and beg discord to give you the intent
how many users do you have now?
in the db
they aren't budging
its even worse that the members wont even get cached if the guild is wrong lmao
lets say you fetch the top 100 in a specific guild
currently about 200
if one person of those top 100 is in the guild, the fetch call will return 1 member, and cache one member
all other 99 will not be returned
you're still at quite a low user count, theoretically you can start storing the guild ids in which the user has been using your bot
yea tough, have to explicitly design to not use the intents
yea I was planning on redesigning to store latest guild id
you'll have to make do with what cry said
or something or the sort, no other way around it
lets say a person has to send at least one message before they get a ranking
once they do, you add them to the list of users that exist in the guild, in your db
you wont know if they leave the guild, but at least you know they were in it at some point
when you try to fetch them, if they are not in the guild anymore, the fetch will fail for them
at that point you remove them from the db
do you guys have experience with the verification? did you manage to get the intent whitelist ?
I applied for it 4 days ago, no response yet
i got the members intent for my captcha bot
my main bot doesnt need any of the intents tho
so i didnt ask for them
you could save the total amount a server has in the db every time the server runs the leaderboard command, and then make the server leaderboard from those saved totals

thats another option
You can still get whitelisted despite your bot already being verified right?
if you use an SQL database or similar, you can either put a list of guilds in each member row, or a list of members in each guild row
leading to some of my commands not working that was initially using the intent
i got the intent first try so i guess i was just lucky seeing how many people are struggling to get it
or maybe my usage of the intent is actually good or something idk
I'm still waiting for a reply. They said up to 5 days, so hopefully I'll get it today
whats your usage noob27 ?
since when to companies respect their deadlines lul
Tru
reward roles, blacklisting/whitelisting roles
plus i need member nicknames but i didn't need it at the time of applying
It's a bit annoying, but understandable that they're needed
i think the solution of storing guild ids is the best option
i just feel like im doing gymnastics to workaround the intents
yea i'd probably redesign
you can do something simple like this:
on message
- check if user exists in ranking, if not create it
- check if user has current guild id in ranking, if not add it
so you will have a user profile with a list of guild ids it exists in
and you can simply filter by it
get all users whose guild list includes current guild
then try to fetch them, to get their nicknames, etc
and if the fetch fails, remove the guild id from their guild list
@quartz kindle timmy, shard meh non complicated bot pliz

tis good ts practice for you
why cant my bot purge
Well, that's gonna be hard to say if you don't show the code or the error
So then your bot needs permissions to manage messages
so how do i give it permits-
It needs it on it's role
okok
icic
how do i make it on its role-
like it generates it
like carl
You can check what permissions your bot needs when you generate the invite link on your developer portal
Here
The invite link changes depending on what permissions you check
it doesn't save it to the entire bot
only to that specific invite
oh
oh
it works
tyty
!rank
async function initDrops(array, validateRaid, user, isRare = false) {
return await new Promise((resolve, reject) => {
if (!Array.isArray(array)) resolve([])
if (array && array.length > 0) {
var rewards = [];
array.map((drop, index) => {
if (isRare) {
const dropchance = [drop.rate, 100];
const ratebool = [true, false];
if (!ratebool[probability(dropchance)]) resolve(rewards);
}
validateRaid.raid_boss.map(async (c) => {
for (var i = 0; i < drop.number; i++) {
try {
const ranks = await getRanks({ rank: drop.rank });
var level = randomNumber(2, 5);
var options = {
character_id: c.character_id,
character_level: level,
r_exp: Math.floor(baseXp * level ** exponent),
user_id: user.id,
rank: ranks.rank,
rank_id: ranks.rank_id,
exp: 1,
};
rewards.push(options);
if (index === array.length - 1) resolve(rewards);
} catch (err) {
console.log(err);
reject(err);
}
}
});
});
}
})
.then((res) => res)
.catch((err) => {
console.log(err);
return;
});
}```
Hey guys, so im trying to call this in Promise.all() but it doesnt seem to be waiting for everything to be pushed to the array rewards
its only pushing the first 1 and then completely resolves
ik im missing something
someone help
thanks!
@solemn latch
yo, im doing bot reviews rn
ah mb
how can i add server count like other bots
use the api
py
array.replace doesnt exist afaik
i have a bot which is pretty much a fake stock market
it gets irl stocks and u trade them w/ fake money
i only have the barebones (invest,sell,portfolio,graphs,database) anyone have ideas for other stuff to add
hastebin having problems
whats the json
k nvm i just delete it lol
reasonable solution.

anyone know anout discord rpc?
var rpc = require("discord-rpc")
const client = new rpc.Client({ transport: 'ipc' })
client.on('ready', () => {
client.request('SET_ACTIVITY', {
pid: process.pid,
activity: {
details: "Skynet",
assets: {
large_image: "/botpic.jpg",
large_text: "Skynet!" // THIS WILL SHOW AS "Playing <Status>" from the outisde
},
buttons: [{ label: "Vote!", url: "https://top.gg/bot/788612480636944414/vote" }, { label: "official Website!", url: "https://skynet.schwitz.repl.co/index.html" }]
}
})
})
client.login({ clientId: "" }).catch(console.error);```
is this correct?
only one way to find out
any api that gets info a a anime character? not anilist
One message removed from a suspended account.
One message removed from a suspended account.
In promises, when u call resolve(), it gets resolved immediately and the rest of the code is also executed.
But it has no effect on the resolved value.
Do you've considered that?
But it so hard u need to reset ur token many times i think
myanimelist
its not official tho
Wait no i didnt know u can also use their api without token ima just use anilist
anilist-node
hmm
Anyone know of any anime gif APIs?
Jikan API
yeah thats un official myanimelist api
works fine for me 
@craggy pine Did you mean to tag me?
#development message I responded to this
Oh, ok
idk anime gifs api unfortunately.
try to nekos.life npm
pretty sure Nekos.life isn't allowed for bots on top.gg | Or its a similar api due to loli NSFW
oof yea tho
Thanks but i just tested anilist it returns many options so good lol
👍
But AniList GraphQL API is cool too
Aight
@craggy pine It’s a private bot, but because of the loli NSFW, I am not comfortable with using their API
does anyone know how to save an image in mongodb for later use for a canvas? and are you able to provide the doc or an example. thanks :3
Store it in base64
Retrieve it from the database, convert it to a buffer and use const image = new Canvas.Image(); image.src = buffer;
makes sense, thx I'll try it out later
message.guild.me.permissons gives undefined
and yes I fetched the botmember (client.user) already
tried it also with .permisson
do you have node installed
my rpc is not displaying the large_image
in programming, why do multiplication and division has same priority?
Because, division is not always accurate...
multiplication comes before division
const reason = message.content.split(" ").slice(2).join(" ") || 'N/A';
so what's wrong?
alrighgt thanks
Hey today mornig my bot was in 58 servers now in 100 so i wanna know how tf it got from 58 to 100 in like 4hrs
How can i see every guild my bot is in?
Please help
Hello
hello i need help for developing a bot
As in?
module.exports = {
name: 'help',
run: (message, args, client) => {
message.channel.send(`<@${message.author.id}> check your DMs!`);
const help = new MessageEmbed()
.setColor('red')
.setTitle('command list\nban')
.setDescription('')
message.author.send(`**thank you for adding this bot**\nPrefix: ${client.prefix}\nCommands: https://discordgg/5AJFadyJKZ`, help);
}
}```
I need help, is there a way I can make
Name:
Value:
And so on
Can you elaborate
Like
Banana
Does banan stuff
Naughty
Dad bad cry
Oof
Yes no bruh
Like the titles are a bit more thick
Or lighter
@pale vessel
@earnest phoenix u can make the text bold in the embed's field title, by **your_text**
.addField("**your_bold_text**", "its value")
Alr, I can add multiple lines of this right?
yup
Thanks man
hey how can i get a list of all servers my bot is in
add a command for bot owner and iterate over client.guilds
do you have any code for that?(py)
i dont have it handy..dm me i can send u later
It's <client>.guilds
it is pretty easy
yes it's full
i want that only i can exe it
u can do it in 2 ways u can do it through commands ..keep on printing all guilds in each message..or just open a file and adding it through loopand finally saving it
oops wrong channel
@commands.is_owner() decorator on a command
Exe what exactly
my discord rpc doesn't show image
I have saved asset and selected large_image
still
also what to enter in client id ?
Should I use that
Or this
nobody cares
@earnest phoenix nobody cares about you too
my code is working fine but this annoying message keep popping up I don't know why
code works as expected
how to fix ambassadors bot offline on my server
Ask the owners of Ambassadors bot...
whats a good tutorial for sqlite
that annoying message is actually an error, so something is definitely not working as expected
you're trying to retrieve an item at an invalid index somewhere
How do I make a GitHub repository like this?
Is this channel related or should I change channels?
what do you mean by "this"
Like the design
But I feel bad I don’t wanna copy hers
use markdown
Hi, I know maybe this is a stupid question, but do you know what command in ubuntu can replace existing files (downloaded from the same github repository) with new ones, replaced in this repository?
When I write a git clone I give a link, it won't work for me.
Like when you copy codes?
what.
I just wanted to move files by putting them on github, then download them from google f1 micro which is ubuntu
but before i downloaded files from my repository and the folder has the same name
git clone only works the first time, then doesn't
it is private repo ; )
someone can help me with this?
🥺 pls
I Have a problem
My bot thinks an user has a ticket but i triple checked and he dosent have a ticket open
I Checked my code and saw his id in the database
How can i edit a database? like what programs to use
SQL syntax
Something like DBeaver or DataGrip
Well it actually depends what database you use
it later uses that item that it says not found then idk why it say that
can you show me how you're getting it?
maybe you've mistaken the max value
loopcounter = 1
while loopcounter <= 10:
one = message.content.split('D: ')
two = one[loopcounter].split('\n\n')
await message.channel.send(two[0])
await asyncio.sleep(10)
loopcounter += 1
const discord = require("discord.js")
const db = require("quick.db")
module.exports = {
name: "msg",
aliases: ["msgs", "mymsgs"],
description: "Find out how many messages you have",
run: async (message, args) => {
let msgs = db.fetch(`messages_${message.guild.id}_${message.author.id}`)
if(msgs === null) msgs = 0
message.channel.send(`${message.author} has ${msgs} messages`)
}
}```
For some reason it only shows 0
?
do you save messages
Wdym?
const Discord = require('discord.js');
const client = Discord.client();
client.once('ready', () => {
console.log('Doggo is online')
});
client.login('');
thats the code without token
wait
const Discord = require('discord.js');
const client = new Discord.Client();
client.once('ready', () => {
console.log('Doggo is online')
});
client.login('');```
yea
now it says its not a constructor
loopcounter = 1
one = message.content.split('D: ')
while loopcounter <= min(10, len(one)):
two = one[loopcounter].split('\n\n')
await message.channel.send(two[0])
await asyncio.sleep(10)
loopcounter += 1
try
you need to consider array size
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log('Doggo is online')
});
client.login('');```
use this
;D
My bot won't respond to me
client.on('messsage', message =>{
if(message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/+/);
const command = args.shift().toLowerCase();
if(command === 'ping'){
message.channel.send('pong!');
}
})
That is message cod
code*
What is missing/ is the problem
what?
hes saying don't try to code, because your getting that from the web, or YouTube.
if(message.content.startsWith(prefix)) return; lul
"If this starts with the prefix, quit"
LMFAOOOOOOOOOOO
nah dont code, ur just coping stuff from the web or Youtube
not being rude
Put a ! before you check if the message content starts with the prefix. ! meant NOT. So it would become if (NOT message starts with prefix || ...)
not being rude, but why u spoon feeding him? he have to learn the basic of js the hard way.
if (NOT message starts with prefix || ...)
he'll copy this
exactly
you're being too harsh to someone who has 24 messages in this server. I'm not giving them code, I'm telling them what they need to do to fix it and what it means
how did you learn js?
my going to others people code any copy and pasting it? like he did.
last time i checked that aint it
@limpid moth ^ right code. sorry for my rudeness earlier. but this is the right code.
ty
oh my
I dont have much experience with text based coding and am trying to start
I'd suggest u start with simpler apps
like console programs
you have to start from somewhere. You don't magically start writing code. Whether it's copying what your teacher wrote or from a blog or video
@limpid moth .
there's no shame in starting with a calculator project
and it'll help u learn the lang you're using
bots aren't a beginner-friendly project
I was a brginner when started my bot
But i knew a little bit of JS and i learn fast
i started with py and moved to js
now im tryna do ts which will be easy if i know js
Nice
my bot was removed from all the server how and why??
did you ran a eval command or have a open eval command
Oh all
my bot doesnt have a eval command
does your bot got a major issue that caused all guilds to remove it? like spammy behavior, broken commands?
Any chance of token leak or server hacking?
Or any other devs which had access to those things
HELP THAT IS EMERENCY
my bot uses all prefixes
but i have type const PREFIX = "&"
code
const PREFIX = '&';
var version = '1.2';
var servers = {};
bot.on('ready', () =>{
console.log('Bot Enabled') ;
})
bot.on('message', message=>{
if(message.content === "Hi"){
message.channel.send('Hello');
}
if(message.content === "How Are You"){
message.channel.send("I Am Good")
}
let args = message.content.substring(PREFIX.length).split(" ");
Uses All Prefixed For Commands Next This Code
you are not checking message content for prefix
Like &play it works with ^play too
i have more code @summer torrent
const PREFIX = '&';
var version = '1.2';
var servers = {};
bot.on('ready', () =>{
console.log('Bot Enabled') ;
})
bot.on('message', message=>{
if(message.content === "Hi"){
message.channel.send('Hello');
}
if(message.content === "How Are You"){
message.channel.send("I Am Good")
}
let args = message.content.substring(PREFIX.length).split(" ");
switch (args[0]) {
case 'play':
function play(connection, message){
var server = servers[message.guild.id];
server.dispatcher = connection.play(ytdl(server.queue[0], {filter: "audioonly"}));
server.queue.shift();
server.dispatcher.on("end", function(){
if(server.queue[0]){
play(connection, message);
}else {
connection.disconnect();
}
});
}
if(!args[1]){
message.channel.send("You Need To Provide A Link")
return;
}
still
play command works with all prefixed
i know Hello And How Are U Dont Need Prefix
but play is the problem
just check if message content starts with your prefix
let args = message.content.substring(PREFIX.length).split(" ");
where is the problem
The startsWith() method
determines whether a string begins with the characters of a specified string,
returning true or false as appropriate.
is
const PREFIX = '&';
const PREFIX = "&";
dude
using " instead of '
can you read my messages please
yes
this
Guys is there any better code editor on mobile not including repl.it, glitch.com
Yes, a pc with vscode or intellij
I really have a lot of problems... with the hose
it is a cloud editor
Well I mean it kinda is
i know Heroku
Is there any other ones?
Huh?...
know*
Repl is a fine web editor, just don't expect anything fancy.
Most programming apps on mobile are intended for learning, not making stuff like bots.
If your looking for better experience when programming a computer is the way to go.
Yes, computers have not gone away yet.
Repl.it is being racist
It dies every 2 minutes
I wonder if using uptime bots with repl is even allowed. From their acceptable use policy.
Interfer with or disrupt the Services or create an undue burden on Replit's website or the networks or services connected to Replit's website;
@solemn latch no it’s allowed since many famous bot devs do it lol
Someone else breaks tos so it must be okay!
Repl dont really do anything against it, which is fine, just the TOS reads like its not allowed.
I don't know any 'famous' bot devs that host their bot on repl
Also, wow repl pricing is pretty reasonable.
https://repl.it/site/pricing
Lol, well some people with verified badge
2vcpu 2gb of ram $5 a month.
No one really uses that one unless 120 commands lmao
Your usage mostly depends on user count not command count
not bad at all
but its still not a full vps is it?
so that hurts your use case possibilities
Oh totally, but just looking from the perspective of someone who doesn't know anything about Linux, it's not a bad option for just a one click upgrade.
Glitch and heroku the upgrade path from free to paid was kinda expensive iirc, figured repl was the same way.
Pong! Latency is 66ms. API Latency is NaNms
Any idea why
is its $5 for unlimited repls or per repl?
Per repl I'm guessing
@solemn latch
We would need the code

const m = await message.channel.send("Ping?");
m.edit(`Ping! Latency is ${m.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ping)}ms`);
}```
Client.ping doesn't exist
You need to use the websocket to get ping
@client.command()
async def cookie(ctx,member : discord.Member):
await ctx.send(f"{ctx.author.mention} you gave a cookie to {member.mention} :cookieeat:")
``` this is my cookie command but the cookieeat emoji wont work



