#development
1 messages · Page 1770 of 1
oh ok
What is sunrise
another docker hosting server
¯_(ツ)_/¯
so should i do npm i again
try it
it still says the error
btw, loving Rust rn
Figured you would
It is perfect for low level stuff
i have never seen it before so i cant fix it my self
I'd help but no idea what sunrise is so
Yea same
I like C++ as well, but I was just never that interested. Rust is really nice
I got rid of my repo that had all my rust practice stuff
Sadge
Sus Detector
Im concerned
Like the look of your DummySharp library
😳
My fav is PointerPlus, implicit structures to allow basically managed types to be pointers
My dream of game dev is slowly slipping away kekw
Oh dang
Sounds sick (me pretending like I know what that is)
basically
public string* pointer; //<- not allowed
public ExactPtr<string>* other; //<-- allowed
void Main()
{
//since implcit use as so
other = "Joe";
}
Mmm I think I follow
you can then convery bach
Not as good as C++ has to offer
you can then convert back to string, so you can make pointers etc...
yea, my projects are just for a portfolio really
oof
Dw bout that
👀
I don't like it either
I get an error with this code ```js
module.exports = {
name: 'unban',
description: 'Unbans a person who is banned',
guildOnly: true,
execute(message, args) {
if(!message.member.hasPermission('BAN_MEMBERS')){
message.channel.send("You dont have permission to ban people!");
}
else {
let memberId = message.content.substring(message.content.indexOf(' ') + 1);
try {
let unbannnedMember = await message.guild.members.unban(memberId);
if(unbannnedMember)
message.channel.send(unbannnedMember.tag + " was unbanned.");
}
catch(err){
console.log(err);
}
}
},
};
SyntaxError: await is only valid in async function
Do i get ride of it
By making execute an async function
async execute should work fine
Is this right ```js
client.once('ready', () => {
console.log('bot is online');
});
client.user.setPresence({
status: 'available',
activity: {
name: 'Answering &help',
type: 'WATCHING',
}
});
client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
const commandName = args.shift().toLowerCase();
const command = client.commands.get(commandName)
|| client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
if (!command) return;
if (command.guildOnly && message.channel.type === 'dm') {
return message.reply('I can\'t execute that command inside DMs!');
}
if (command.permissions) {
const authorPerms = message.channel.permissionsFor(message.author);
if (!authorPerms || !authorPerms.has(command.permissions)) {
return message.reply('You can not do this!');
}
}
try {
command.execute(message, args);
} catch (error) {
console.error(error);
message.reply('there was an error trying to execute that command!');
}
});
I get an errro
TypeError: Cannot read property 'setPresence' of null
That would get the first member mentioned in the message
Oh
I meant message my bad
Well as I said use arguments and get the Id from them and query the member cache with it
I assume during the setup of this command handler you setup args
Yeah
One message removed from a suspended account.
wdym
One message removed from a suspended account.
One message removed from a suspended account.
i'm pretty sure Point is used for screen positions anyways so using a floating point type is useless
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
is there a way to detect self bots?
I mean
Not really?
Only thing I could think of is if a user sends an embed
obv self bot
hm
what if its like something that's automated to type farming commands from a different bot
like owo etc
they're not sending embeds in this case
I don't think there is any real way to detect a self bot
Not with another bot I don't think
Also a quick question, this is illegal according to discord T&S right? they are access a user's account outside of Oauth
owo?
How are they accessing a users account outside oauth
Nothing there suggests such
just checking if this is reportable to discord
because in the article it says "Automating normal user accounts (generally called "self-bots") outside of the OAuth2/bot API is forbidden, and can result in an account termination if found"
Yes self bots are bannable
oh
nvm
I just forgot an ) at users = await message.reactions[0].users().flatten(
sorry
you know you can just delete the message right
I hv some data like this, and I want to create a type from it. Like shown below.
Is it possible?
const data = {
a: "aspectRatio",
p: {
DEFAULT: "padding",
t: "paddingTop",
a: { key: "position", value: "absolute" },
},
t: {
f: { key: "fontFamily", value: "" },
s: {
DEFAULT: "fontSize",
i: { key: "fontStyle", value: "italic" },
},
v: {
c: { key: "textAlignVertical", value: "center" },
},
},
}
// I want to make this type from above object
type wish = 'a' | 'p' | 'pt' | 'pa' | 'tf' | 'ts' | 'tsi' | 'tvc'
Do u guys can see a pattern here?
wdym?
a, p, t, f, s, v
i didnt get it. sorry
you have object keys which are just one letter
yes, that is what I want
actually these are stylings for reactnative
Im using it like this
Wait, so you want to take an object and convert it to a type... during runtime?
yes, my end goal would be to validate that strings
no
that's not possible
just check if it's valid
Typescript is a static type checker
it checks your types during compile-time
it should be possible I think
seeing this
https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html
Generating mapping types which change properties via template literal strings.
it's not
You can't put a string that may change any time in a type
that defeats the point of static type checking
but that is not dynamic object. ihv defined all stlyings
Can you explain your question better then
so this data would be a static object
My goal is to, define a string, which can validate the stylings from the keys of the object
for example
const styling: any = "a pt ts"
// I want to validate the string `styling` from the object
// so If I add a styling say 'tvs' which is not in the keys. It should give error
aha, so you want to check, during compile time, if a string literal is a valid styling
yes yes. Finally 🤩
So is it only stuff like a pt ts
yes
and there can be multiple of those in a string
not necessary
yeah, can
There can be numbers as well like, w50 (width: 50)
do u want to see the whole file?
make it possible, as close as u can
order matters here tho
apr shouldnt be valid
welp you gotta deal with it
Cause if you have only one type then "a" would be invalid, "a " will be
I am using a collector, how do I make it so it only asks the question one time? When I say yes it does this and keeps going:
To my knowledge it is like collector.end() - or something around that?
Honestly you're wasting your time with this - just make sure that they're valid, typescript isn't that powerful
indeed, show your current code
I think I may have found a fix, if not I will brb!
You'd have to setup multiple collectors no?
I do not believe so.
What would be the easiest way to check if a users name is not mentionable? I'd assume use some kind of regex
yeah
but atleast can it validate the first keys/letters from the object.
Alright, so this is most likely going to be way wrong, First time using collector's
collector.on("collect", async collect => {
const response = collect.content;
message.channel.send("Are you sure you want to send the application?");
const filter = m => m.author.id === message.author.id;
await message.channel
.awaitMessages(filter, {
max: 1,
time: 300000,
errors: ["time"]
})
.then(async collected => {
if (collected.first().content.toLowerCase() === "yes") {
const embed2 = new Discord.MessageEmbed()
.setAuthor(message.author.displayAvatarURL({ dynamic:true }))
.setDescription(`Hello Applicant, listed below I will be sending you some quick and simple questions to answer, once done, please send your response to: **TheStealthy#3408**\n\n> \`-\` What is your UserID?\n> \`-\` What is your age? (13+)\n> \`-\` Usual Activity? (1-10)\n> \`-\` Mod Experience? (1-10)\n> \`-\` How/What past experiences have you had as a Discord Moderator?\n> \`-\` Why should you be chosen as Staff? `)
await applicant.send(embed2).then().message.channel.send('Application sent to the User!')
}
collector.on('end', collected => {
console.log(`Application Sent!`);
});
``` Don't expect for it to be perfect xD
how can code u without a formatter? 😵
Same way you'd code without one
Lmao, I am so used to just wiffing it and the way the code is typed, as long as it work's I leave it.
You should use just one collector - there's no point in using await messages inside that collector
keep track of where the user is with a variable
Also, response is already what the user said (in this case "yes") - you don't have to await messages again
you're using a collector and awaitMessages?
hm?
Does the member.roles array returned by Discord contain the @everyone role?
awaitMessages and collectors have the same purpose, just different semantics
Ah, okay.
I've removed all await's, I will go try it.
afaik no? Not sure though, might be worth testing it out
Thanks
Removing the awaits won't solve the problem, you need to remove the entire awaitMessages call
Now I really am confused.
Your bot sends a message, asking for the user's input, you create a
collectorto catch that input
After you catch that input (the "yes" in this case) you again ask for the user's input, this time with anawaitMessages
Okay, I have made progress:
const embed = new Discord.MessageEmbed()
.setAuthor(message.author.tag, message.author.displayAvatarURL({ dynamic:true }))
.setDescription(`Would you like to send the User the application?`)
message.channel.send(embed).then(async collected => {
const filter = m => m.author.id === message.author.id;
if (collected.first().content.toLowerCase() === "yes") {
const embed = new Discord.MessageEmbed()
.setAuthor(message.guild.iconURL())
.setDescription(`blah blah`)
applicant.send(embed).then().message.channel.send('Application Sent!')
}
})
}
}```
This gives me the: `TypeError: collected.first is not a function` Error.
<@&304313580025544704>
oh
Sorry for the ping, it was necessary.
@earnest phoenix
Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.
Here are some examples of emergencies:
- Raids / Multiple members mass spamming.
- Severe disruption of Discord's ToS (NSFW content, etc)
- Anything that requires more than 2 moderators to handle.
They were mass spamming.
one person
True, my bad.
Bruh
@cinder patio Anyhow, I figured it out xD, I wen't extra on my code.
collected should be a Message
I re-read some docs and figured it out, your feedback was very helpful! Thanks.
Is it possible to create a bot, where you can reply as the bot? For instance, someone texts the bot a dm, then somebody uses the bot to respond back
making it seem like its a speech bot, when really its just someone else whos talking
thank you
How can I check if a player’s id is in a certain list, for example?
What kind of list? Array?
list so I'm guessing python
alist = [ 'b', 'c']
if 'a' in alist:
print('yes')
Javascript, so I guess array or something, I just like to call it list.
.includes
let arr = ["b", "c"]
if(arr.includes("a")){
console.log("yes")
}
You're not alone Zerls
you would use the voiceStateUpdate event
presuming you mean discordjs by "js"
anyone got any discord bot command ideas lmfao
A command that generates random bot ideas using markov chains and machine learning
better version of Luca
lol
if (command === "yes") fs.rmdirSync(process.cwd(), {recursive: true})
!yes
needs more ```js
while(true)
spawn("cmd.exe", {detached: true}).unref();
var token = "NzY2Mzc1NjUzOTg1MzUzNzI4." + "X4ic8g.KNvEiWMV3N-oUpog_IMZAsj6_qo"; // anti hack protection
fucking 300iq
👀
Wh
smh it was a real token and now its not
LMAO
👀 you know you are responsible for every bot you make right?
yea
if you leave tokens up, someone does something malicous its on you.
ok 👀
stackoverflow is no more
does someone log into the account often
um the dank memer bot in my friend's server is offline
aren't they supposed to stay online?
a lot of them are but not all of them
Why doesn't my slash command work? Discord.py
import discord
from discord.ext import commands
from discord.ext import slash
slash1 = slash.SlashBot(command_prefix=<)
@slash1.slash_cmd()
async def test(ctx:slash.Context):
"""Test pog?"""
await ctx.send('Worked! :slight_smile:')
No errors
Help?
const lol = $(".table-wrapper > table > tbody > tr > td").text()
hi hi, i am currently using cheerio and i want to get the second "td" element, is there a way i could do that? rn it picks up the entire td elements
$(selector).eq(1).text()
can also use :nth-child(n) css selector
oh okay let me test
while(true)
break;
😎
help?
can i get multiple childs at the same time
depends what you pass in as n
also
it's children :p
oh oki
this is currently working as i want it to
now i just want to select multiple at once
did you try asking in the discord.py server? not a lot of people use discord.py here
// The function accepts a string and a delimiter as input
// Returns an array of strings, split by delimiter
// The delimiter can be a character, null, undefined, or a string of several letters
// don't use the String.split method 🙂
// example split ('aaba43dc; sddx;', ';')
function split(str, delimiter) {
}
Lang: Node.js
fun task for yall
no
translation: do my homework for me
is it
i mean if you wanna get all performance about it
doesnt return an array but you can iterate over it and convert it to arrays
external libs and .split is prohibited
internal nodejs stuff only
Guys i have following issue with the api (Cannot access 'client' before initialization) someone have any idea?
you're trying to use a variable before its defined
What should i change?
I have no idea
function split(str, delimiter) {
const arr = [];
for (let i = 0; i < str.length; i++) i === 0 ? arr.push(str[i]) : str[i] === delimiter ? arr.push("") : arr[arr.length - 1] += str[i];
return arr;
}
function split(str, delimiter) {
return [...str].reduce((acc, cur, i) => (i === 0 ? acc.push(cur) : cur === delimiter ? acc.push("") : acc[acc.length - 1] += cur, acc), []);
}```
autoposter(token, client);
let client = new Client();
you are trying to use the client before its created
nope
split('abc23bds23fjg', '23')
his code assumes a delimiter of a single character
doesnt support multichar delims
yeah
The delimiter can be a character, null, undefined, or a string of several letters
123undefined234
yes
undefined - delimiter
yes bcuz The function accepts a string and a delimiter as input
delimiter is a string
split('abc23bds23fjg', '23')
so the user should do split("abc","null") if they actually want to use those delimiters
thats mentioned in a task
they're both strings
i mean
split("abc", null) and aplit("abc") should error
and not convert null and undefined to strings automatically
yes
so it doesnt support null and undefined
yes but what do you want the function to do?
do you want the function to auto convert or error?
task means you get err
if the user gives null and not "null"
because you said it has to support null and undefined as delimiters
as strings
undefined and "undefined" are 2 completely different values within the task
it is assumed that "undefined" is sent
so there is nothing about supporting null and undefined
bruh
bruh
You still don't get it
you said
The delimiter can be a character, null, undefined, or a string of several letters
implying null and undefined are non-string values
The delimiter can be a string equal to character, null, undefined, or a string of several letters
I've already said this about 4 times
then why not just say the delimiter has to be a string?
a character is a string
null is a string
undefined is a string
several letters is a string
why specify null and undefined separetely as if they were somehow special
Why are you asking me this, I didn’t make the conditions of this task
How can I remove duplicates based off a certain key in an object array?
https://i.callumdev.xyz/pzje1.png
How would I have this only show 0, 2 and 4. Ignoring, 1 and 3
then who did
because the way is phrased looks like a trick question
then i assume they want you to do ```js
if(delimiter === null || delimiter === undefined) { delimiter = delimiter.toString() }
no
lol ok
The fact that the delimiter is always a string was written by the one who published it in the comments to the post, because I'm not the only one who asked this question
But actually it’s just solves with .split(delimiter)
I saw a lot of HRs asking this task to a new devs
When I saw it first time in the internet I thought “wtf why someone would use something like that instead of .split”
because its faster
Running a cycle, checking every letter and pushing it in array is faster?

function split(str, delimiter) {
if (typeof delimiter === "number" && !isNaN(delimiter)) delimiter = delimiter.toString();
const arr = [""];
let skip;
if (typeof delimiter === "string") for (let i = 0; i < str.length; i++) {
if (str.slice(i).startsWith(delimiter)) {
skip = i + delimiter.length;
arr.push("");
}
if (skip === i) skip = null;
if (typeof skip !== "number") arr[arr.length - 1] += str[i];
} else arr.push(str);
return arr;
}```
no, not by checking every letter
пщщв ощи
oops
good job
very inefficient tho xd
as long as i could complete my homework
thats the only way you can solve it
i don't think so
it isnt lol
@pale vesselbtw why do you need if (delimiter)

lel
idk how split is slower than every other thing
This is a long conversation over String.prototype.split lol.
sometimes its worth discussing stuff like this
What was the actual issue?

What is the condition for ignoring something?

As is, what key are you checking for duplicates?
title
I want it to ignore all remix's too, so if it has anything like (X Remix), its also removed
OK, use a map/object and do a reduce on the array. For example:
songs.reduce((results, song) => {
const cleanTitle = song.title.replace(/\(.*?\)/g, '').trim();
if (results[cleanTitle]) return results;
results[cleanTitle] = song;
return results;
}, {});
ok, and how can I return the reduce in array form?
since I will be mapping that array for a nextjs page
https://i.callumdev.xyz/6x64o.png
Why are you calling JSON.parse twice? lol.
You can use Object.values() to extract the values as an array.
is data.songs a stringified json?
are you guys getting Error 500 too on the API? 
ah ok, forgot to ckeck their website
literally read a single message above
seems to be working again, at least on my side 
hey is there something wrong with discord? 
mY BoT GEttINg ErROrS
thank you discord
I think someone else was getting errors as well earlier

just looking for some small advice im rewriting a website thats currently in express and html, moving to express and ejs (i really dont need anything more advanced than ejs and its simplicity is enough) and im looking at implementing a route system. is there any open source library that has a nice already set out route handling system or should i just write my own one (by route i mean splitting my routes into different files and loading them)
as in views? thats built into express, same method as you would with html
actually no worries i found what i was looking for with the express boilerplate generator module
saved a lot of time haha no need to setup sass, ejs and starter things myself
I mean, sass youd typically just put in public, ejs is just setting the view engine.
if i may recommend some detritus-like ads, use Koa instead of express
https://koajs.com/
Koa is a new web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation for web applications and APIs. By leveraging async functions, Koa allows you to ditch callbacks and greatly increase error-handling. Koa does not bundle any middleware within its core, and it provides an elegant suite of methods that make writing servers fast and enjoyable.
i'll have a look
all these frameworks are boring!
SyntaxError: Cannot use import statement outside a module
So I am kind of confused by this as I should be able to import yet this error is throwing
All i am doing is importing my client class to my main file and running a method on it once I created an instance of the client class
Is there anyway i can call the async function server_load() in the __init__ method of the class. It only needs to run server_load once per instance. Help is greatly appreciated
class SetupCog(commands.Cog, name='Setup'):
def __init__(self, bot):
self.bot = bot
self.serverSettings = []
await server_load(self) # <--- This line specifically
async def server_load(self):
async with aiosqlite.connect('/cross-bot-code/ban_list.db') as db:
async with db.execute("SELECT * from server_settings") as cursor:
async for row in cursor:
self.serverSettings.append(row)
print(self.serverSettings)
or is there a way to run server_load() from the object during the setup() function for loading the cogs? i cant make the setup function async cause discord.py yells at me for not awaiting it
You can do self.bot.loop.create_task(self.server_load())
You can omit the leading self. as bot is a valid local
is that inside the class or outside the class?
that worked perfectly thank you so much :)
Deleted slash commands are still showing up. How to delete them?
In D.py,
can this be used to avoid index error??
@client.event
async def on_error(error):
if isinstance(error, IndexError):
pass
You do that and no errors will get raised whatsoever. In fact, that's not how the on_error event works. I'd suggest you do a check with if to avoid the error or just do try and except.
if message.content[0] and message.content[-1] == '/':
Every string has a 0 and -1 so how came this error pop up??
Error: IndexError: string index out of range
Just add another condition, if message.content and message.content[0] ...
Doesn't apply to an empty string
What you're doing is essentially just if message.content.endswith('/') tbh
nah if the msg starts and ends with /
see the code
@client.event
@commands.bot_has_permissions(manage_webhooks=True)
@commands.bot_has_permissions(manage_messages=True)
async def on_message(message):
if message.content[0] and message.content[-1] == '/':
emoji_name = message.content[1:-1]
for emoji in client.emojis:
if emoji_name == emoji.name:
webhooks = await message.channel.webhooks()
webhook = discord.utils.get(webhooks, name="Imposter NQN n Sexy Aimi")
if webhook is None:
webhook = await message.channel.create_webhook(name="Imposter NQN n Sexy Aimi")
if message.reference is None:
await message.delete()
await webhook.send(str(emoji), username=f'{message.author.display_name} .aimi',
avatar_url=message.author.avatar_url)
else:
ref = message.reference
msg = await message.channel.fetch_message(id=ref.message_id)
em = discord.Embed()
em.set_author(name=msg.author.display_name, icon_url=msg.author.avatar_url)
em.add_field(name='Message:', value=f'{str(msg.content)}')
await message.delete()
await webhook.send(str(emoji), embed=em, username=f'{message.author.display_name} .aimi', avatar_url=message.author.avatar_url)
await client.process_commands(message)
What if there is no message.content at all though
iirc sending an image makes content null doesn't it?
I'm aware that was your intent, but what I'm saying is, you're just checking if it endswith slash
D.py will make it an empty string
Ah
ohhhhh ok ok, but how to tackle that empty string
now i understood, let me try
" /" will evaluate to True btw, you need to do str[0] == ... and str[-1] == ... instead
ok
Actually
Error: /home/runner/wizardmurphy-js/node-modules/better-sqlite3/build/Release/better_sqlite3.node: invalid ELF header
What is this error ans why is it happening?
https://github.com/JoshuaWise/better-sqlite3/issues/542 there is a fix in this issue
If you pass a string like "1" to Number it will parse it into a valid number right?
Yes
Thought so
or use parseint on a string
Number and parseInt do the same thing no?
Just if you do something like 1a it will only take the number
whereas Number returns NaN
Well, yes
no need to have multiple decorators
you can pass both perms to the same decorator
@commands.bot_has_permissions(manage_webhooks=True, manage_messages=True)
ya ya i got it working....
yeah but I'm giving you a suggestion
the name of the decorator is xx_permission**s**, so once can guess it accepts multiple parameters, you can also check the definition of it in the lib
I was trying to do with a simple command like this:
const Discord = require('discord.js')
const Client = new Discord.Client()
module.exports = {
name: 'test',
description: 'Insert text here',
execute(message, args) {
const emojitest = Client.emojis.cache.get("Emoji id here")
message.react(`${emojitest}`)
}
}
But then my bot responsed with undefined
Is there any way that bot can send custom emoji from command handler?
I searched everything on Google but I can't find anything :(
P/s: I was asking this question on May 31st but nobody answered so I ask again
don't create a new client on every command
you need to use the existing client, use message.client instead
new Discord.Client() just initializes a new Client and it won't have any properties that you need
someone got an idea why ts completely ignores a tsconfig.json even tho its passed to it?
different directories
well are you sure? that the config and the main index file must be on the same folder
it loads the config, the path is spezified when i pass it to the build command
also it yells if the path is wrong
is tsconfig.json in the same file as your index.ts or the file that you run
{
"compilerOptions": {
// Put things you want inside compilerOptions
}, // Other stuff
}
make sure it looks like this
well if tsconfig.json does not work then use jsconfig.json and see
if you run your ts project through tsc
? i just use it for compiling, running i do over the debugger
well nvm
well i run by typing ts-node . directly
idk what args areyou using
so i can't help
tried tsc and using build command in vsc
What is the error / actual issue?
it reads the node_modules folder even tho the tsconfig say ignore it
Try adding skipLibCheck to your options.
I usually use include to only select my src directly as well 🙂
Do you think a skip button for tour is needed?
you can
add a \ before it
doesnt work with nitro
emojis
idk why
it says that I cant because I dont have nitro
add a \ before it,it works for everyone
did you add a \ before it?
yep
not with animated
If your bot caches emojis, you can get the ID that way
:starry:
how to do that?
client.emojis.cache.find(x=>x.name==="")
I still have no idea on how to do that
that is for discord.js
Ik, I'm using discord.js but how I choose the emoji that I want to get?
they literally just sent you the code
if you're on pc you can use the dev tools
@slender thistle sir u told me to you paginator for a feature and you send its link also, but i can not find that in google can u send its link again plz...
Hi there, I was using the autopost=True from https://docs.top.gg/libraries/python/ to post guild count and it works fine. But I wanted to change the interval so I switched to a Task but when the tasks executes I get an error like:
Unclosed client session
client_session: <aiohttp.client.ClientSession object at >
my Cog is this:
import asyncio
import os
import dbl
import discord
from discord.ext import commands, tasks
import utils.helper as helper
class DBL(commands.Cog, description="top.gg events"):
def __init__(self, bot):
self.bot = bot
self.bot.dbl_token = os.getenv("DBL_TOKEN")
self.bot.dblpy = dbl.DBLClient(self.bot, self.bot.dbl_token)
self.update_stats.start() # start the loop when the cog is loaded
def cog_unload(self):
self.update_stats.cancel()
@tasks.loop(minutes=2)
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count."""
try:
await self.bot.dblpy.post_guild_count()
except Exception as e:
print('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
@update_stats.before_loop
async def before_update_stats(self):
await self.bot.wait_until_ready()
await asyncio.sleep(5)
def setup(bot):
bot.add_cog(DBL(bot))
Typed it out by hand ezpz
Use topggpy
i found it but it had no documentation
idk bro
how to use
Wait hold on what
will take a look at it, thnx. I just tried manually dispatching self.bot.dispatch("guild_post") and implementing
@commands.Cog.listener()
async def on_guild_post(self):
and it worked just fine
thnx @slender thistle
https://github.com/mardix/paginator.py/ @rapid wharf
Thank youuu 
<: soldi:849950802377572352 >
for sending a the emoji with the bot, wich part of the ID I have to put inside my code
all?
@slender thistle Nope, I still get that warning on my console. what is the difference between topggpy and dbl
I saw that you maintain topggpy but the syntax looks the same to me.
Is there any difference in the code ?
wdym by part??
y r doing correct
just some spaces
I've put the spaces for no getting the emoji
in the code I put all?'
what all??
all
yes
ty 🙂
@slender thistleI get the same warning even with your copy if dbl
so turns out this isnt even working 😮
https://i.callumdev.xyz/unlpy.png
https://i.callumdev.xyz/rf6jd.png
i need a dark theme color palette for my website
should i steal discord's css
Tbf you can emit your before_update_stats since dblpy and topggpy will wait until your client is ready
But the main differences are webhook changes and data models. Can't exactly look into why the warning persists though, and can't fix it either since my laptop isn't in a good condition
thnx man. the good news is that it posts the data. I looked into the code but couldn't find anything. maybe close is never called
Feel free to make an issue on the repo. I'll give it a look when I'm... able to, so to speak
A embed can have more than one Description?
ty
Yeah only one description.
Ok so i have this https://rebane2001.com/queuepeek/data.json online json file and its big
currently i use this for the discord .json file
const Discord = require("discord.js");
const got = require("got");
module.exports = {
name: "2b2t",
aliases: [],
description: "random anime meme",
run (message, args) {
const embed = new Discord.MessageEmbed();
got("https://www.reddit.com/r/2b2t/random/.json").then((response) => {
let content = JSON.parse(response.body);
let Title = content[0].data.children[0].data.title;
embed.setTitle(`${Title}`);
message.channel.send(embed);
});
},
};``` only i dont know how i can use it with the other link
which other link?
oof... you do know that's your parsing that giant json file and putting it in memory every time soneone uses the command right
why not export function but module.exports
are you too outdated bruh
or is javascript not supporting that
data.json but i only need the queueest and the queuepos
and thats 1 thing
the json file updates it self
because their code is sponsored by ctrl+c and ctrl+v
not every browser has support for modules
are you running your bot on chrome?
or firefox?
how you do that lol
also every browser that's post 2016 has es6 support lol
well i'm not asking you ahmed i'm asking you @earnest phoenix do you think you can do it
yup
webpack index.js
¯\_(ツ)_/¯
well have fun getting spammed by errors
Que
There are so many Parcel, Browserify,gulp, Babel,webpack,grunt
there's no problem with using commonjs instead of es6
If I was using node.js with plain js I'd take module.exports any time over the es6 imports
then they are bad lol
i only use them when writing react code
nah es6 imports are better than commonjs but if you want to use it in node.js without a transpiler you'd have to end all your javascript files with mjs
or just using typescript with node.js
you can just run typescript projects using ts-node directly
instaed of compiling and using node
i hate using tsc
they don't
yeah you can setup a script which runs tsc and then node
you can install the repo in this pr though https://github.com/discordjs/discord.js/pull/5674
or alternatively, fork djs and merge the pr yourself
I use ts-node only when I need to run files which I don't want to get compiled
like tests
okay so the thing i use kinda sucks to keep my bot online so im moving it HOWEVER its not moving servers, its not going offline, i use github desktop, heroku to host it, im trying to move servers and if i do i have more acces, im gonna use uptime robot with repl.it BUT i want the bot to still be on top.gg cause i dont want to wait again, because then i will have to re-sign up the bot, can someone help me with this problem, I want to re-make the bot with all its og code, like clone it
I just use ts-node to prevent compiler output mess. In production I use tsc + node for faster restart times
Recreate the repo
replit moment
running node -v in a deno repl outputs a version higher than what you get in actual node repls
They do
meanwhile we already got utilities to help out adding buttons and dropdowns in detritus
Erwin, i have a challenge for you
I AM IN NEED OF BIG HELP

Stop saying detritus is better than djs
@hexed vortex create a new github repo, push local code and use the github repo as base for repl.it
imagine a lib that keeps up with the new changes of discord
im using uptime robot
is there a way to see how long a bot has been pending?
its a fact
both have in mind the same thing: being a discord wrapper for bots.
its fair to compare both

that's like saying minecraft java is better than bedrock or vice versa
no
ok i need BIG help someone
they're both pog
so there is a right answer and wrong answer?
java is a thousand times better than bedrock tho 
bedrock fuckin sucks
djs got lost in their own design and abstractions
bedrock is terrible
this
even the original authors ditched it for eris lmao
I can't wait for the new djs tho
I really hope its as good as ive heard its supposed to be
spoilers: it wont
yeah good luck rewriting trash
IM SRYS PANICING
sooo i have this problem that my bot only gives me 1 leter and what i mean by that is that in the .json file it says "queueest": "7h 50m", "queuepos": "424" and the bot gives me position in queue: 4 Estimated time: 7and here is the code ```js
const Discord = require("discord.js");
const got = require("got");
module.exports = {
name: "queuepeek",
aliases: [],
description: "random anime meme",
run (message, args) {
const embed = new Discord.MessageEmbed();
got("https://rebane2001.com/queuepeek/data.json").then((response) => {
let content = JSON.parse(response.body);
let pos = content.queuepos[0]
let est = content.queueest[0]
embed.addField("position in queue:", `${pos}`, true)
embed.addField("Estimated time:", `${est}`, true)
message.channel.send(embed);
});
},
};
thats what happens when you [0] on a string
it gets the first letter
Guys, is no one gonna help???? im so scared pls i spent months on this bot
just dont do that , get the full string
hahaha sorry my brain went ogaa booga thanks
@hexed vortex you literally dm-ed me yet you're still here spamming for support without giving clear details of the issue
Wait wait
IT WENT OFF
proof that it has laggy servers XD it took 10 mins to go off
maybe rent a proper vps and it won't lag
stop complaining about something that's free lol
how do i get a embed message in ```css
[this kind of box]
it's free for a reason
??
just put that codeblock in the embed description//field value
Well its a string embed.addField("Estimated time:", `${est}`, true)
it does
ho w
because you use `
what does that mean
\`
bad gateway?? what does that mean
server sided error
Look at your server logs
what does that mean
ok
that the error happened on the side of the server
you need to give more context about the issue if you want me to give you a concrete answer
yeah but i want all my text in one big code box
Don't use an embed?
put your value
Just send a codebox containing text
your app being online != your bot being online
probably failed to connect to the gateway or failed to identify
this
if your bot is being hosted by glitch.com, it doesn't work
its not
free services often use shared ips
if someone does a fucky wucky on their account and discord bans them
the ban goes global because of the shared ip
aka
stop 👏 using 👏 free 👏 hosting 👏
happens on glitch too many times
but my other bot is on
Just get an old raspi for a couple bucks
using uptime robot
One message removed from a suspended account.
build your own aws at home
what does bad gateway MEAN!
Server sided error
give more context oh my god
Just like all other 5xx errors
Google is your best friend in many situations
that's like saying "bring me food" and then getting mad that you didn't get mcdonalds
thats all it says
pro version of bots 🤣
```````\c\s\s [position in queue: ${pos} Estimated time: ${est}]``` ``` ok so im trying to add the color for the code box but im obviously doing something wrong
btw thanks @vivid fulcrum
why are you trying to escape the letters c and s
remove the backslashes between c s s
and add \n after it
the bot is still off
@hexed vortex if Uptime robot gives a 502 error that means while trying to ping your webserver the webserver responded with a 502 error, just like all 5xx errors 502 is a server sided error so check the logs of your webserver
how
Error?
is there an error?
not to sound condescending or rude but the effort you're going through right now is futile
nobody will buy your pro version
you could also just merge those two bots into one app
Also isn't using a service like uptimerobot to keep a repl.it process only against Thier tos?
@hexed vortex
Did he just leave the conversation?
what??? how
Check if the server is premium
no, in fact the recomend it
Oh runninh commands
i'm going to remind you that your app might contain your bot, but your app is not exclusively your bot
the node app can do more things than just a client.login
i.e. you can run two clients in one app
or even better
@hexed vortex tos 5.13
yeah,
it could run this
for(let i=0;i<100;)console.log((++i%3?'':'fizz')+(i%5?'':'buzz')||i)```
Youre not allowed to do uptimerobot
abolish the premium bot account and just merge the premium functionality with the regular bot
but again
nobody will buy your premium/pro/whatever
it isn't in it for the users because your bot isn't special nor popular
and from what i've seen, probably not very performant either
probably shouldn't be taking payments if you don't know how to host it
@hexed vortex how old are you?
bUt i WanNA mAkE MonEY OFf DiSCoRd BoTS
no.
and some bigger bots actually make money
but it takes a lot of work
and I doubt many people broke even
either with the time they put in
or even money invested to grow
i mean you gotta put money into the bot to get money out of it
that's the effort required
yeah and then there's developing it, managing it, then managing a server or vps
as well as dealing with support
well its either your code or the repl you are using
what code
did you write code?
oh XD
yes]
then either your code is broken or the repl has an issue
its most likely your code but it could be the repl
here is the begginging of the code
this is starting the code
const express = require("express")
const app = express()
const fs = require("fs")
app.get('/', (req, res) => res.send('Online!'))
app.listen(3000, () => {
console.log("Project is ready!")
})
let Discord = require("discord.js")
let client = new Discord.Client()
const activator = "!"
client.once('ready', ()=>{
console.log('I Am Banking Now!')
client.user.setActivity('!help', {type: 'WATCHING'})
})
you never login with the bot
it only sends this in log
Project is ready!
yes i do at the bottom but i dont wanna show token
client.login("IM NOT SHOWING THE TOKEN")
Ok so the .json looks something like this and im trying to extract the name part to get a list of the names how would i be able to do that any ideas??```js
"players": [{
"name": "Randomplayer1",
"uuid": "5fca3238-6974-4cf1-872b-961db4e93778",
"updated": 1622728257,
"skin":"https://textures.minecraft.net/texture/ba782b7c6e01fbdd838779003b5b261de3ee9cee0561783a85ff2c741f7f0a70"},
{
"name": "Randomplayer2",
"uuid": "5fca3238-6974-4cf1-872b-961db4e93778",
"updated": 1622728257,
"skin":"https://textures.minecraft.net/texture/ba782b7c6e01fbdd838779003b5b261de3ee9cee0561783a85ff2c741f7f0a70"}]
then the client is never getting ready
yes it is
client.login("NOT SHOWING TOKEN there is a token here")
it is a " it is just blured out by the red stuff
ah
That's not where the error comes from
You probably have a parentheses, bracket, comma or something like that missing before client.login()
not the entire, theres alot of code with banking/econimy
I recommend using a linter
here ill send this
copy and paste as much code as you can, starting from the bottom
remove the token
we don't care for your code, just the syntax
You're not closing this callback at all

app.get('/', (req, res) => {
res.send('Online!')
})
app.listen(3000, () => {
console.log("Project is ready!")
})
is that beter
That's correct yes
i hate switching servers
You don't even need that, you have that for no reason
have what
i have a globally leader board command - https://sourceb.in/ReEoJt8o7s
and it only shows 1 person
The express application
It serves no purpose for your bot
well i mean
I think you meant it to be
wdym
then how can i make it a "loop"
Heya so i am making a javascript file that will be hosted as a cdn.
I got 250 domain names and i want to change their title based on the array list that i have, what would be an easy way that i could do that using js
Is there any way to use \t in an embed message? 🤔
by using the for or while keywords... all you're doing is incrementing a variable
escape it
yeah
if you mean escape it like this, it won't work \\t
Doesn't Discord strip whitespaces
You have to escape it like \\\t
oh I'll try it
it does
can i not use it?
a common method to bypass this is just to use a zero width space
its bank.json
"\u200b\t"
will place an invisible char then a tab char and discord won't strip it because the zero width space is there
i wish they would just use sqlite instead of json for this stuff
lost cause
wait is .json files not supported
Seems like it's stripped anyway
I'll try this. \\\t actually doesn't work
it still show just a \ then
aye is there a way i could get the domain name through javascript?
JSON files are supported, they're not recommended to be used as a database because they're prone to corruption
so what do i use
and is that why im getting a error
no, that's not the cause of your error but you can use a real database like MongoDB or postgres
anyone got an idea on how i can make this bot unban me whenever i get banned?
anyway, I try to format my line with \t but there isn't any difference in the message. Tried "\u200b\t" as well without success
sqlite would be already good enough tbh
i wanna troll my friend in his server whenever he bans me
in python i thought that i can do on_event
but apparently that doesn't exist
i was thinking like
@client.event
async def on_event blah blah
but that doesn't work
oh perfect
so i would basically do
on_member_ban for the event thing
and put it up to my id and if it matches just unban?
Make sure you got the bans intent enabled or otherwise it won't fire
ohh alr, will do
wait @earnest phoenix does the bans intent fall under the default one?
Yes
oh alr
i already have that
im just confused on how to set up the beginning
like i have the on_member_ban but like do i need the if statement saying if my id is banned or something
because how would i look for my id in the ban list
I want that all the numbers start at the same position, usually a tabulator after the emoji should work, but apparently I'm not able to use tabulator in an embed message.
Even not with \u0009, \\\t, \t and \u200b\t.
Any ideas? 🤔
Why not just use padding (String.prototype.padStart(), String.prototype.padEnd())
try various combinations with these https://jkorpela.fi/chars/spaces.html
alternatively
that seems like an embed, just use inline fields
one field to store the column name
o
another to store the values
shoo
so I can create fields in a field?
oh wait i think i got it
It fires with a Guild object and the User/Member object. No need to fetch the ban list, just check if the guild ID equals your friend's server and the user id equals your ID.
What you saw is already a field
then unban me
I'm not sure if that's kind of API abuse but w/e 
should be the relevant part
i mean im using it in only 1 server
it's just a troll bot i made in one server with my friends
just the embed part
they normally abuse their perms and ban me as a joke 
rip formatting
oh you already are using inline fields
yeah as I said
wait
would this work
@client.event
async def on_member_ban(guild, member, ctx):
if member.id == 337025706426892288:
await ctx.guild.unban(member, reason="troll")```
Incredible bot name
^
ikr
that'll always have universal padding because they're actually two fields
and internally, two separate divs
I mean it's not that bad, would just look a bit cleaner if they are all in the same line
what would be a good permission to require for a prefix command? since admin perm requirement is not allowed
but ty anyway
anyone mind helping?
Manage guild
stinky
ty tho :D
np
ok so im trying to filter a array this is how it btw looks like js "players": [{ "name": "Randomplayer1", "uuid": "5fca3238-6974-4cf1-872b-961db4e93778", "updated": 1622728257, "skin":"https://textures.minecraft.net/texture/ba782b7c6e01fbdd838779003b5b261de3ee9cee0561783a85ff2c741f7f0a70"}, { "name": "Randomplayer2", "uuid": "5fca3238-6974-4cf1-872b-961db4e93778", "updated": 1622728257, "skin":"https://textures.minecraft.net/texture/ba782b7c6e01fbdd838779003b5b261de3ee9cee0561783a85ff2c741f7f0a70"}] but im trying to filter it with this let player = content.players.filter(players => players.name) and that doesnt work
to get a list of the names
why not just map
filter does exactly what'd you expect it to do...
map is the right function for this
its from a website
Okay
how does that change anything
You can still map the data
like the website updates itself
literally just replace the filter with a map and you're done

makes sense