#development

1 messages · Page 1659 of 1

blissful coral
#

What about it?

crystal wigeon
#

when a user votes. its sending the same user multiple times

#

and they are getting dms

blissful coral
#

@final lynx you clearly are not reading what the user is saying

crystal wigeon
#

like 10

#

dms

#

per vote

modest maple
blissful coral
#

Please stop attempting to help others if you don’t know exactly what they are talking about

modest maple
#

if your vote handler isnt responding correctly it's gonna resend them

blissful coral
#

Makes it harder for us to explain when someone is giving wrong information

compact valve
#

How to do the vote count in dbd.js

pale vessel
#

is that even possible

blissful coral
#

Your gonna have to make manual requests

boreal iron
#

To do or to get?

slender thistle
#

Not possible

blissful coral
#

Either that or it isn’t even possible lmao

pale vessel
compact valve
#

So must l ask dbd.js support server

blissful coral
#

You can try

#

Don’t know if it is even possible

boreal iron
#

Still don’t know what he’s trying to do?

#

Just getting the total vote amount of his bot from top.gg?

blissful coral
#

No

#

Posting votes

boreal iron
#

Oh ok nvm

crystal wigeon
#

it kept triggering multiple times for the same user when others voted. which ended up in mass dms for the same user

#

hopefully it gets fixed by tomorrow

modest maple
#

well that depends on who made the lib lul

#

the site working as should in that regard

slender thistle
#

Respond with 200 if you processed votes successfully and don't bother with rest

#

ezpz

sick fable
#

my bot doesnt reply with the message

#

its a mod bot type of shit

#

i enabled intents

blissful coral
#

What is the message

sick fable
#

but its still not haplening.

blissful coral
#

And is there a error

sick fable
#

happening.

sick fable
zenith terrace
#

would be helpful if you showed the code and error....

sick fable
#

Sure

#

@zenith terrace

zenith terrace
#

ah, python...idk python

sick fable
#

:(

#

whyyy):

copper cradle
#

hmm

boreal iron
#

Because we don’t deal with snakes but @slender thistle
You can ping @slender thistle multiple times.
He likes if somebody is screaming his name

modest maple
#

well so many things are a yikes in that code sad

#

please tell me this bot isnt made for anymore than 1 server 👀

slender thistle
#

I know that name

#

And we're off to a great start

sick fable
#

help me shivaco AFfacepleadinguwu

boreal iron
sick fable
#

btw does it show the same as in here?

steel arch
#
const fs = require('fs');

const ascii = require("ascii-table");

// Create a new Ascii table
let table = new ascii("Commands");
table.setHeading("Command", "Load status");

module.exports = (client) => {
    // Read every commands subfolder
    readdirSync("./commands/").forEach(file => {
        // Filter so we only have .js command files
        const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
    
        // Loop over the commands, and add all of them to a collection
        // If there's no name found, prevent it from returning an error,
        // By using a cross in the table we made.

        for (const file of commandFiles) {
            const command = require(`../commands/${file}`);
            client.commands.set(command.name, command);
        }
            // If there's an aliases key, read the aliases.
            if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name));
    });
    // Log the table
    console.log(table.toString());
}```              **if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name));** `ReferenceError: pull is not defined`
sick fable
slender thistle
#
  1. lo = log
    why

  2. Do you plan on having your bot used in multiple servers? If yes, you need to use a dictionary, preferably as an attribute of your bot object.

sick fable
#
  1. For fun sake.

  2. Yes. and how.?

modest maple
#

yikes

#

and yikes

slender thistle
#

Welp

lusty quest
#

i think he wants array.pull

slender thistle
# sick fable 1) For fun sake. 2) Yes. and how.?

If you are familiar with the general concept of OOP, you would be familiar with properties and methods. In this case, you have your bot object, so in order to actually have it shared between multiple files (if you need that), it's suggested you attach your dictionary as a property, e.g. bot.logs.

By default, that dictionary will not contain anything, and you will have to rely on using dict.get and settings/getting key values. In your case, it's preferred that you use the guild ID as they key and the channel ID as the value. On each on_member_update event emit, you get the ID from either of the sent member objects and use bot.logs.get(<guild_id>). If that returns None, don't send anything. Otherwise, generate the embed and send it

#

Gives me memories of how I had to rewrite this exact system in one of my bots to support multiple servers at once

cobalt spruce
#

AH SHIT

#

does anyone use this

#

?

normal sage
slender thistle
#

You know, it does feel refreshing when people understand your walls of text

normal sage
#

And they'll disappear.

cobalt spruce
#

lol

normal sage
#

Oh

#

what lang?

cobalt spruce
#

js

normal sage
#

I don't think they're supported there

cobalt spruce
#

😩

#

sad

normal sage
#

Maybe see this?

cobalt spruce
#

col

cobalt spruce
#

il read it

slender thistle
#

There are but I'm not aware of any helpful resources about them

normal sage
#

they give out a ton of slash command news

cobalt spruce
#

cool

granite portal
#

Hi

drifting socket
#

hey, i need help

#

i want to do a dog command
the person who helped me do the bot send this to put into my dog.js file

const { get } = require("snekfetch");

module.exports = {
name: 'dog',
description: "dog command",
execute(message, args, Discord) {
try {
get('random.dog/woof.json').then(res => {
const embed = new Discord.MessageEmbed()
.setImage(res.body.file)
return message.channel.send({embed});
});
} catch(err) {
return message.channel.send(err.stack);
}
}
}

when i do *dog in my server
it gives me trouble
cause it doesnt work

random.dog/woof.json

he originally sent a cat command which worked and the link was https://aws.random.cat/meow
but the dog command does not

#

mention me when somebody can help

zenith terrace
#

snekfetch is deprecated from what I know

sour flame
#

how to set a bot status

#

message

copper cradle
sour flame
#

Like that "Watching Discord Bot"

hybrid obsidian
#

me too

copper cradle
#

why would you reply with: message

boreal iron
drifting socket
copper cradle
#

send it here

#

I don't wanna take this into my dms

#

and I'm at school rn so I might not respond

#

@drifting socket

drifting socket
#

ok i’ll do it when i’m done eating

boreal iron
#

Well just use the search function in this channel and code snippets will magically appear

pale vessel
novel blaze
pale vessel
#

client.user.setActivity('status here', { type: "WATCHING" })

livid lichen
#
if (NewState.channel && NewState.member.user.tag === Bot.user.tag){
    NewState.member.user.setDeaf(true)
  }
``` Hi! I'm using voiceStateUpdate to deafen my bot when it joins a voice channel. Would this work?
pale vessel
livid lichen
pale vessel
#

ic

#

you should compare the bot id instead

livid lichen
#

Thanks.

pale vessel
#

and make sure that newstate exists first

#

it could be null if the bot left a VC

livid lichen
#

That's why I did NewState.channel.

pale vessel
#

no

livid lichen
#

Oh?

pale vessel
#

you'll get cannot read property channel of null

livid lichen
#

Oh.

drifting socket
#

@copper cradle
(node:1462) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)
(node:1462) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (rejection id: 1)
(node:1462) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

#

Thats the error it says when i say *dog

burnt citrus
#

Is making currency system with quick.db global?

#

Like a global variable for a user?

lusty quest
#

ohh wait nvm its a api call

copper cradle
lusty quest
#

you try to access an url that points to localhost port 80, what is your code?

lusty quest
copper cradle
#

my dude forgot to set the protocol in their url

#

add https:// at the beginning of the url

drifting socket
#

i already did that tho

#

and it did not work

lusty quest
#

what is the URL you try to access

drifting socket
#

ok so when i do *dog

#

i want it to be a random photo of a dog

#

thats the thing

#

but it wont work

lusty quest
#

did you paste it like this into your call?

#

btw what lib did you use for calling the api?

drifting socket
#

idk what that means sorry i followed a tutorial so i dont know much about coding

#

here is the script

#

const { get } = require("snekfetch");

module.exports = {
name: 'dog',
description: "dog command",
execute(message, args, Discord) {
try {
get('https://random.dog/woof.json').then(res => {
const embed = new Discord.MessageEmbed()
.setImage(res.body.file)
return message.channel.send({embed});
});
} catch(err) {
return message.channel.send(err.stack);
}
}
}

lusty quest
#

snekfetch is deprecated, i suggest to use a supported libary, like exios

#

or node-fetch

drifting socket
#

when i say *dog it does this now

#

not showing any image

drifting socket
lusty quest
#

probably bcs of wrong handling of the return json

#

we are not allowed to spoonfeed

haughty mirage
#

can anyone reccommend a good nodejs lib for parsing data out of excel or csv file?

lusty quest
#

and you never close the string

drifting socket
#

ok

boreal iron
#

Or node-fetch

lusty quest
#

also your handling of the return is wrong

#

the api returns a json that contains 2 keys

#

and you dont handle one of them

drifting socket
#

i dont really know what you mean, im new to starting this, this is like my first command that somebody helped me with.

lusty quest
#

ok

#

then we go back to the basics

drifting socket
#

yea sorry im like brand new to it

boreal iron
#

Well then read the docs of the libraries you use.
Somebody helping you doesn’t mean it will work tho.

lusty quest
#

did you figured out how to use axios?

drifting socket
#

nope

boreal iron
#

Oh nvm

dusty fern
#

is there a way to track how many messages a user has?

lusty quest
#

then i suggest to read the docs of it, if you dont understand the docs of axios, then i guess you dont know javascript well, then i suggest to learn a bit more javascript

boreal iron
#

Not afaik, only if you track them down, Zhyar

drifting socket
#

ok

lusty quest
#

a normal database can also work, just increment a key in it

#

then you can just use it in your code

boreal iron
#

Oh I thought he means to get the actual amount of messages an user sent

lament rock
sour flame
cinder patio
#

Plus discord.js already comes with node-fetch

lament rock
#

node-fetch bad

#

it's deprecated as well iirc

earnest phoenix
cinder patio
lament rock
#

might be thinking of some other http lib then

boreal iron
lament rock
#

nah. Was most likely thinking of request

old cliff
#

you must not use better-discord

sour flame
#
C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:36
        client.user.setActivity('m!help - Draconic', { type: "Playing" });
        ^

ReferenceError: client is not defined
    at ModmailClient.start (C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:36:9)
    at Object.<anonymous> (C:\Users\ravi_\Desktop\Discord Bots\Mail\index.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47
[nodemon] app crashed - waiting for file changes before starting...
``` I- Don't understand
#

How to get client defined

lament rock
#

are you trying to use client in another file?

earnest phoenix
#

show the your code

sour flame
#

kk

#
const{  MessageEmbed, Client, Collection } = require('discord.js');
class ModmailClient extends Client {
    constructor(){
        super();
        /*
        Dependencies
        */
       this.path = require('path')
       this.discord = require('discord.js')
       this.fs = require('fs')
       /*
       Collections
       */
      this.commands = new Collection();
      this.threads = new Collection();
      /*
      Constants
      */
     this.prefix = "m!";
    }
    commandHandler(path) {
        this.fs.readdirSync(this.path.normalize(path)).map((f) => {
            const File = require(this.path.join(__dirname, `..`, path, f))
            this.commands.set(File.name, File);
        });
    }
    getCommand(cmd) {
        return this.commands.has(cmd) ? this.commands.get(cmd) : false;
    }
    start(token, path){
        this.commandHandler(path);
        this.login(token);
        this.on('ready', () => {
            console.log("I'm now  online")
        });
        client.user.setActivity('m!help - Draconic', { type: "Playing" });
        this.on('message', async(message) => {
            if(message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(this.prefix)) return;
            const args = message.content.slice(this.prefix.length).trim().split(/ +/g);
            const cmd = args.shift().toLowerCase();
            const command = this.getCommand(cmd);
            if(command) return command.run(this, message, args).catch(console.error);
        })
    };
    embed(data, message) {
        return new MessageEmbed(data).setFooter(message.author.tag, message.author.displayAvatarURL({ dynamic: true, format: "png" }));
    }
}
module.exports = ModmailClient
#

here

lament rock
#

use this instead of client

quartz kindle
#

also, put it inside the ready event

sour flame
#

kk

#
C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:36
        this.user.setActivity('m!help - Draconic', { type: "Playing" });
                  ^

TypeError: Cannot read property 'setActivity' of null
    at ModmailClient.start (C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:36:19)
    at Object.<anonymous> (C:\Users\ravi_\Desktop\Discord Bots\Mail\index.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47
[nodemon] app crashed - waiting for file changes before starting...
``` What now
#

same code just changed client to this

lament rock
#

did you put it in the ready event? because client.user isnt assigned until it's ready

cinder patio
#

Are you sure you wrote this code?

boreal iron
cinder patio
#

If you did you should definitely know where your ready event is

raven needle
#

Hi, I'm trying to host my Bot on a Raspberry Pi.
The bot runs but it won't load the files from my cogs folder.

    if filename.endswith(".py") and filename != "__init__.py":
        bot.load_extension(f'cogs.{filename[:-3]}')
    else:
        print("Fail")

Does anybody know why?

sweet ruin
#

Are there any cool bot commands I should develop?

umbral zealot
#

Should? not really.

#

Develop something original.

long crow
pale vessel
#

you are 0/10 cool

copper cradle
#

it's most likely they just copied it from somewhere, and somehow managed to make it work

cobalt island
#

does anyone know a good hosting platform

jovial shoal
#

how long does it usually take for my bot to get approved or denied?

pale vessel
#

@cobalt island GalaxyGate

old cliff
#

@jovial shoal read pins of support channel

pale vessel
#

Read pins in this channel

jovial shoal
#

thank you though

wild nebula
#

I need some help please. I've made my own bot and used the app "bot commander". I need to "host" the bot 24/7 on my phone which drains my battery FAST. is there anyway to keep the bot online so the functions work without going from the app?
And please @reply me

cobalt island
#

I personally use repl.it and monitor it using UptimeRobot

old cliff
#

code it yourself

lyric mountain
old cliff
#

dont use apps

lyric mountain
#

so yeah, you either code yourself or get used to battery drain

wild nebula
#

I suck at programming 💃

old cliff
#

learn...

lament rock
#

Everyone does until they do it

cinder patio
#

If you aren't willing to learn then just... don't make a bot and use already existing ones

wild nebula
#

Never said i wasn't willing to learn.

lament rock
#

Even now where I could work in a professional environment most likely, I still suck at programming

cobalt island
#

I just started to program a week ago and u just grind ur way there

#

HAHAHAHA

boreal iron
wild nebula
#

Alrighty thanks for the input

old cliff
#

does try{} catch(){} catch promise rejections?

lament rock
#

That's what try catch blocks are for

old cliff
#

ok

cinder patio
#

well

#

they're for all kinds of errors

pale vessel
old cliff
#

yes I do

old cliff
pale vessel
#

wtf is that

#

@rustic nova

rustic nova
#

did i hear cringe

old cliff
#

yes

rustic nova
#

-b 627415529824714752 yeet

gilded plankBOT
#

dblMod Banned █▬█ █ ▀█▀ me はdaddyは#8181 (@blissful viper)

old cliff
#

btw is it SEND_MESSAGE or SEND_MESSAGES ?

cinder patio
#

what? The event?

#

the permission?

old cliff
#

perm

cinder patio
#

plural

old cliff
#

really?

#

send_messages?

#

bruh I have to change it in 100 places then

boreal iron
#

God thanks god developed a search and replace (all) feature

old cliff
#

use regular expression option?

cinder patio
#

You can also use the built-in enums discord.js provides instead of hard-coding the permission names

old cliff
# gilded plank

I read the reason... I am happy I didn't turn on my headphones

cinder patio
#
const {Permissions} = require("discord.js");

Permissions.FLAGS.SEND_MESSAGES;
old cliff
#

I won't spend another hour for that

boreal iron
#

Open all files, search and replace all, 10s maybe less okeh

cunning gorge
#

Right now, I use this:

                  r.users.remove(message.author.id);

To remove the reaction the user pressed after they clicked it. However, is there a way to make the bot remove all the reactions from a specific emote?

For example, if they click 1️⃣, I want it to remove that 1️⃣ reaction entirely.

pine quarry
#

some canvas problem

copper cradle
#

what the fuck do u even need help with

earnest phoenix
#

@pine quarry turkey?

#

😂

pine quarry
#

yes

earnest phoenix
#

Tam ab

pine quarry
#

what's so funny

supple shale
#

how to solve this

lusty quest
supple shale
#

how ?

lusty quest
supple shale
#

npm -g --add-python-to-path install windows-build-tools node-gyp

#

?

lusty quest
#

sounds right

#

but it can easy take a hour or two

supple shale
#

okok

cunning gorge
#

Hello does anyone know the method to remove all reactions from a specific emote?

supple shale
#

delete message and recreate

summer torrent
#

smart guy above

copper cradle
#

no

#

you can simply remove the reaction

cunning gorge
#

Well I'd prefer to do it more efficiently

copper cradle
#

oml

sour flame
#
import discord
from discord.ext import commands
import json
import os
import random

os.chdir("C:\Users\ravi_\Desktop\Discord Bots\Mail")

client = commands.Bot(command_prefix = m!)


@client.event
async def on_ready():
    print("Ready")

@client.command()
async def balance(ctx):
    await open_account(ctx.author)

    users = await get_bank_data()

    wallet_amt = users[str(user.id)]["wallet"] 
    bank_amt = users[str(user.id)]["bank"] 


    em = discord.Embed(title = f"{ctx.author.name}'s balance", color = discord.Color.red())
    em.add_field(name = "Wallet balance",value = wallet_amt)
    em.add_field(name = "Bank balance",value = bank_amt)
    await ctx.send(embed = em)

@client.command()
async def beg(ctx):
      await open_account(ctx.author)

    users = await get_bank_data()

    user = ctx.author

    earnings = random.randrange(101)


    await ctx.send(f"Some gave you {earning} coins!!")




    users[str(user.id)]["wallet"] += earnings
    
    with open("bank.json","w") as f:
        json.dump(users,f)


async def open_account(user):
 
    user = await get_bank_data()

    if str(user.id) in users:
         return False
    else:
        users[str(user.id)] = {}
        users[str(user.id)]["wallet"] = 10
        user[str(user.id)]["bank"] = 0
    
    with open("bank.json","w") as f:
        json.dump(users,f)
    return True





async def get_bank_dat():
    with open("bank.json", "r") as f:
        user = json.load(f)
    return users





client.run("Discord Token-Secret")
``` Did I do something wrong with the code?
copper cradle
cunning gorge
#

Usually in my reaction collector I have

                  r.users.remove(message.author.id)

But this time I want to remove everything not only the message.author

summer torrent
copper cradle
#

what happens when you run it

#

does it error

sour flame
#

no

copper cradle
#

does it do something it shouldn't do

#

does it do nothing at all

sour flame
#

nothing at all

copper cradle
#

what function are you trying to run

sour flame
#

an Economy Bot..

copper cradle
#

that's not what I asked my dude

#

read again

#

which of the functio... "commands" you have there did you run

#

and what happened when you did

#

how am I supposed to guess that

drifting shell
#

"my bot doesn't work"
pastes all 30 thousand lines of code

copper cradle
boreal iron
#

give your best and try to imagine

drifting shell
#

that's why i avoid this channel onesieKEKW

#

its usually stinky djs devs that don't understand basic principles of the language they chose

copper cradle
#

and then they expect every developer to guess what the fuck they were trying to do

drifting shell
#

Reminds me of the good old

"What language is your bot in?"
"English"

copper cradle
#

I literally asked
"what function are you trying to run"
and the reply I got
"an economy bot"

drifting shell
sour flame
#

Oh great ```
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

earnest phoenix
naive mortar
#

hey

#

wassup ppl

sour flame
cunning gorge
sour flame
#

ig from github?

lusty quest
sour flame
naive mortar
#

idk man

earnest phoenix
#

system environment variables

earnest phoenix
#

chatting some bs currently

naive mortar
earnest phoenix
sour flame
#

This ig

earnest phoenix
#

assuming you use windows

lyric mountain
#

ok, math time:

consider the folowing values

0, 1, 2, 3, 4, 5

how would I get the wrapped distance between 0 and 5?

sour flame
lyric mountain
#

I'm trying to figure that for about 1 hour by now

#

like

#

distance between 0 and 5 should be the same as 0 and 1

#

like a circle

#

hm, maybe using sin?

cinder patio
#

What do you mean by wrapped distance

lyric mountain
#

idk how to explain, like

sour flame
#

I right click the pc and get this. I need propeties not graphic propeties

lyric mountain
#

instead of being linear it'd wrap around

lyric mountain
#

if windows 10 just click the cog icon on start menu and search "computer"

cinder patio
#

Wouldn't it be just 1 then? To get from 0 to 5

lyric mountain
#

yes

#

but I can't figure out how to explain that to the code

#

if this helps

cinder patio
#

if lastValue = 5 then lastValue = 0

lyric mountain
#

I mean, I prefer to avoid ifs when possible

#

there has to be a mathematical way

#

I'm actually thinking about converting the values to radians then using sine

sour flame
#

That just got meh to this

lyric mountain
#

not start menu -> search computer

cinder patio
sour flame
cinder patio
#

It's going to make the code more readable

lyric mountain
#

open settings screen and press the frist icon

sour flame
#

oh wait

lyric mountain
#

a component that refreshes very often

#

also

#

it'd give me the wrong distance between 0 and 4 too

#

since it'd return 4

#

instead of 2

sour flame
#

first icon you mean system?

lyric mountain
#

yes

sour flame
#

nothing

#

when I searh computor

lyric mountain
#

bro

#

just press the first icon

sour flame
#

kk

lyric mountain
#

THAT'S windows 10 computer properties

sour flame
#

thx

#

lol

lyric mountain
#

if you want old computer properties just search computer on the start menu and click properties

sour flame
#

where is advanced settings

lyric mountain
#

just use the old-style properties menu smh

sour flame
#

.....

#

I'm their now what

lyric mountain
#

idk, you didn't say what you want to do

vivid fulcrum
#

whose???

slender thistle
# lyric mountain if this helps
>>> l = [0,1,2,3,4,5]
>>> x1 = l[2]
>>> x2 = l[-1]
>>> x1
2
>>> x2
5
>>> dx = abs(x1 - x2)
>>> if dx > len(l) / 2:
...     dx = len(l) - dx
...
>>> dx
3
sour flame
lyric mountain
#

used sine for that

slender thistle
#

XGWkekwlaugh fucking hell

sour flame
#

The complete path of python.exe can be added by:

Right-clicking This PC and going to Properties.

Clicking on the Advanced system settings in the menu on the left.

Clicking on the Environment Variables button o​n the bottom right.

In the System variables section, selecting the Path variable and clicking on Edit. The next screen will show all the directories that are currently a part of the PATH variable.

Clicking on New and entering Python’s install directory.

#

Where is System Variables

slender thistle
#

Oh dear

cinder patio
#

Literally open the search bar and type in "Env"

lyric mountain
#

oh, path configuration then

#

yeah, just search "env"

sour flame
#

yep

cinder patio
boreal iron
#

Can be found also browsing the "old" control panel or by clicking on the Windows icon > System

cinder patio
#

ALSO

cinder patio
#

n % 6

lyric mountain
#

wrong quote but ok

#

so val % (min + max + 1)?

cinder patio
#

yup

delicate sorrel
#

. .
/

sour flame
#

I entered Python’s install directory now what?

cinder patio
#

But you have to make sure that val can't ever be bigger than (min + max + 1)

slender thistle
#

Now try using python in your command prompt

cinder patio
sour flame
#

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases

lyric mountain
#

although I'll stick with sine solution because it outputs a normalized value

#

fits better for my usage

#

but thx

cinder patio
#

np

earnest phoenix
#

does somebody now a good landing page creator or any html css ui kit?

sour flame
#

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
What now??

sour flame
#

oh wait is it C:\Program Files\python\

#

@earnest phoenix

cinder patio
#

Did you expect just typing in Python's install directory to work??

sour flame
cinder patio
#

bruh

#

By that they mean to provide the actual install directory

#

not to write "Python's install directory" literally

#

that's sad

boreal iron
#

actual install directory
To be more correct the path of the app bin

sour flame
#

which one has the install directory

unreal estuary
#

whats the length for a server ID

boreal iron
#

The one which contains the actuall binary (.EXE)

#

However it's been called

#

probably python.exe

cinder patio
#

That's the install path

boreal iron
dusky sundial
unreal estuary
#

thanks

boreal iron
cinder patio
boreal iron
#

hmm I didn't look at the provided link

cinder patio
#

BTW I'm 99% sure there's a option to add python to path in the installer

dusky sundial
#

There is, yeah

#

Unless you found some wacky knock-off installer

sour flame
#

I now came here..

#

when I type python.exe

dusky sundial
#

So what directory did you enter in PATH?

boreal iron
#

That looks like the Windows app store

sour flame
sour flame
#

and my computer froze for 10mins

boreal iron
#

Take a look at the other entries and you may see the issue

cinder patio
#

of course because it's not a valid path to a directory

#

man

#

Just reinstall it, this time enabling the "Add python to path" option

tired panther
#
function replacevar(content , vars){
  console.log(content)
  content.replace("{membercount}", vars.membercount)
  content.replace("{username}", vars.username)
  content.replace("{usertag}", vars.usertag)
  content.replace("{usermention}", vars.usermantion)
  content.replace("{userid}", vars.userid)
  return content;
}
cinder patio
#

replace doesn't change the original string

#

it returns a nw one

crimson vapor
#

there is a better way to do that

tired panther
tired panther
cinder patio
#

just content += content.replace(...

crimson vapor
#
    const msg = <String>.replace(/{(.+?)}/g, (match: string) => {
      switch (match.slice(1, -1)) {
        case 'x': return 'y'

        default: return match
      }
    })```
cinder patio
#

But yeah that's better *

#

^

crimson vapor
#

wait

#

fixed

#

I use {{shit}}

#

not {shit}

#

and great thing about that is you don't have to deal with doing /X/g regex

agile lance
#

Is there a discord.js function to find messages by message id?

unreal estuary
#

it only sends the default prefix

#

any ideas why

#
if(msg.author.bot) return;
    var prefix = config.prefix;
    db.get(`SELECT * FROM servers WHERE id='${msg.guild.id}'`, (e, row) => {
        if(row !== undefined) return prefix = row.prefix;
    });```
#

i replaced prefix = row.prefix with console.log(row.prefix) and it shows the server's custom prefix

boreal iron
#

why would you select all if you just need the prefix?

#

btw. if(row) ... will work as well

unreal estuary
#

yeah

unreal estuary
#

no

#

sqlite 3

#

it only responds to the default bot prefix

agile lance
#

Oof I’m not that experienced with sqlite 3 sorry

unreal estuary
cinder patio
#

That's because you change the prefix in the callback

boreal iron
#

db.get might be a promise

#

read the docs I guess

unreal estuary
#

ok

quartz kindle
#

you're getting the data in a callback

#

you cant assign variables like that

cinder patio
#

the callback executes after the command executes

quartz kindle
#

^

midnight blaze
#

anyone here ever scripted with powershell?

unreal estuary
#

thanks

cinder patio
#

You need to put your entire code in the callback, or promisify the function

#

maybe it already returns a promise idk

quartz kindle
#

or just use better-sqlite3

unreal estuary
#

yeah i think ill use better-sqlite3

#

i dont think i can do this in normal sqlite3

quartz kindle
#

do what?

unreal estuary
#

the

#

const row = db.prepare('SELECT * FROM users WHERE id = ?').get(userId)

quartz kindle
#

you can, just not like that

cinder patio
#

You probably can but you have to await it

unreal estuary
#

ok ill try

vivid quiver
#

hii

unreal estuary
#

hello

vivid quiver
#

someone can help me about verify my bot
i don't know how answer the questions of in verification request 😢
my EN is bad
just i created bot for gaming

agile lance
#

-verifybot

#

@vivid quiver

earnest phoenix
#

@agile lance send the inv link to me in dms about this discord developer server

vivid quiver
#

@agile lance me to pls

#

on DM

agile lance
#

im not in it

#

1 sec

vivid quiver
#

nop

unreal estuary
#

update: im using better-sqlite3 instead of sqlite3 and its going well

vivid quiver
#

that is my problem my EN ois bad

agile lance
#

@earnest phoenix @vivid quiver

earnest phoenix
#

thanks

agile lance
#

np

boreal iron
vivid quiver
crystal wigeon
#

I don't understand why the dbl vote endpoint would be called over and over spam dming the same user

vivid quiver
#

i will try to fix it

crystal wigeon
#

Other bots seem to be working fine

unreal estuary
#

gl

boreal iron
vivid quiver
boreal iron
#

anyway... just answer the questions in your main language

vivid quiver
#

i do it ❤️ ty

lost wadi
#

require.resolve is not a function

for (const file of fs.readdirSync('./eventos/')) {
  if (file.endsWith(".js")) {
    let fileName = file.substring(0, file.length - 3)
    let fileContent = require(`./eventos/${file}`)
    client.on(fileName, fileContent.bind(null, client))
    delete require.cache[require.resolve(`./eventos/${file}`)]
  }
}
quartz kindle
lost wadi
#

ye

quartz kindle
#

they dont support it

lost wadi
#

?

quartz kindle
#

repl.it uses node in esm mode, which doesnt support require.cache nor require.resolve, among other things

hallow shell
#

Anyone know the difference between JSONP and JSON? I'm looking on the express docs, and can't really understand res.jsonp() and what it does.

cinder patio
#

the info is a quick google search away

JSONP stands for JSON with Padding.

Requesting a file from another domain can cause problems, due to cross-domain policy.

Requesting an external script from another domain does not have this problem.

JSONP uses this advantage, and request files using the script tag instead of the XMLHttpRequest object.
quartz kindle
#

JSONP, or JSON-P (JSON with Padding), is a historical JavaScript technique for requesting data by loading a <script> element, which is an element intended to load ordinary JavaScript. It was proposed by Bob Ippolito in 2005. JSONP enables sharing of data bypassing same-origin policy, which disallows running JavaScript code to read media DOM elem...

hasty lotus
#

is it possible to ban a use from a guild that is not member from the guild anymore ? By example someone that left, so <guild>.members.cache doesn't includes him anymore, but client.users.cache does ? (using djs)

#

please ping me*

unreal estuary
#

im trying to get the category the message channel is in and message.channel.parent is null?

lament rock
unreal estuary
#

lol what

#

im reading my code

#

lol my brain is so dead

#

just nvm

hasty lotus
lament rock
unreal estuary
#

ahh

#

that was the problem

#

thanks

unreal estuary
sterile lantern
#

do you get the bot dev badge anymore

#

or did they remove it

#

and if they did remove it, y

pale vessel
#

they didn't remove it

#

they stopped giving them

lament rock
#

They didn't remove it, but you cannot get it anymore

#

only users who verified within the first 1-2 weeks got it

pale vessel
#

a lot of people posted fake applications just to get the badge, discord had enough of it and said no

sour flame
#

...

lament rock
#

"Will you sell your verified dev account for 1 bitcoin"

pale vessel
#

Hell yeah

sterile lantern
#

do u think they'll bring it back

lament rock
#

No

#

Not a chance

sterile lantern
#

damn

#

rip

quartz kindle
#

1 bitcoin? holy shit

lament rock
#

3 accounts sent me that. It was the same person

pale vessel
#

I mean if it was real I'm down for it, just saying

lament rock
#

people literally trying to buy bot dev or early supporter accounts

#

I'd be down as well. Bitcoin prices have gone up insane

quartz kindle
#

still sad i sold mine at 30k

lament rock
#

30k is pretty good tho

rigid viper
#

“Would you sell your verified bot for $200?”

pale vessel
#

Come on now, that ain't enough

rigid viper
#

How much would you sell it for

pale vessel
#

1 bitcoin

#

at least

rigid viper
#

Damn

pale vessel
#

yeah so 57k

rigid viper
#

lol

green kestrel
rigid viper
green kestrel
#

i make a lot more than that in premium each month

rigid viper
#

Fr?

#

I was considering selling the bot

rigid viper
green kestrel
#

yeah for real, i make about £400 a month in premium at 80k servers

pale vessel
green kestrel
#

ah

rigid viper
#

80k servers?

#

What’s your bot called?

green kestrel
#

triviabot

rigid viper
#

I might’ve used it lol

#

1 sex

#

Omg

green kestrel
#

maybe, i keep going places where people have used it

rigid viper
#

Sec*

green kestrel
#

^

rigid viper
#

Yeah I looked it up

#

Your bot is doing well

green kestrel
#

i spent a bit on ads that i have to pay myself back

rigid viper
#

Ahhh, yeah idk if I should implement premium features to my bot

green kestrel
#

for sure

#

i' say yes, and do it early

rigid viper
#

ASAP?

green kestrel
#

even at say 200 servers youll have at least one superfan who'd pay

#

yeah, what kind of bot is your bot

rigid viper
#

It’s a coconut maller with image generation, soundboard, moderation and misc commands

green kestrel
#

coconut maller?

rigid viper
#

Yeah

green kestrel
#

is that like a cookie clicker/idle miner?

rigid viper
#

No haha

#

If you look up “You just got coconut malled” you would see what I mean

#

It’s quite similar to Rick bot with different features

green kestrel
#

i dont get that meme

#

tiktok weirdness

rigid viper
#

I was just bored and started developing it

green kestrel
#

my bots website has a tribute to memes in its easter egg

green kestrel
#

go to my bots site and do: up up down down left right left right b a b a

crimson vapor
#

...

#

dont make me make mine better

green kestrel
#

ah, thats a shame

#

😄

rigid viper
#

I’ll be on pc soon

green kestrel
#

i'll have to make a gesture version

rigid viper
#

An Easter egg on phone?

#

That’s hard I guess

boreal iron
rigid viper
#

lol

green kestrel
#

yup!

boreal iron
#

Reminds me of times using cheats for GTA1 on PS1 lmao

#

probably 20 years ago

rigid viper
#

Have you played gta on a PsP before?

crimson vapor
#

h

#

free premiun triviabot?

green kestrel
#

@crimson vapor fake found my easter egg for it

crimson vapor
#

pog

#

in vr

#

send link pls

green kestrel
#

go to https://triviabot.co.uk and use keyboard: up up down down left right left right b a b a

crimson vapor
#

embed it

sterile lantern
#

would there be a harm in allowing access from anywhere w mongo DB

green kestrel
#

lol

crimson vapor
#

im in vr kekw

green kestrel
#

there, embedded it

crimson vapor
#

ty

boreal iron
#

lol what a laziness

green kestrel
#

5, 4, 3..

sterile lantern
#

a rickroll-

#

i-

green kestrel
rigid viper
crimson vapor
#

guess its not possible in vr

green kestrel
#

TIL people will do anything for a freebie

crimson vapor
#

always

boreal iron
#

lmao

rigid viper
#

yk I will just vibe to the rickroll idc at this point KEKW

green kestrel
#

i love that rick astley song

#

never gonna give you up, never gonna let you down

rigid viper
#

Rick Astley has good songs actually

green kestrel
#

he was such a one hit wonder

slender wagon
#

Umm welp, so i get memes from reddit and post them on discord. I am just wondering if i can filter the memes by the number of upvotes.

shy turret
#

when using video.src = "" (html and js) there's a black flash every time i do it

#

how would you remove the black flash

#

posters seem to

#

fill way more than it should be able to

#
                let vid = document.getElementById("screen");

                // I don't know if this would remove the video from cache.
                vid.pause();
                vid.removeAttribute('src');
                
                vid.src = "../pathways/" + scenename + "/video.mp4";
                vid.play();

current code

crimson vapor
green kestrel
#

you like it?

#

I got a minified one with tamper protection too unittest.min.js @crimson vapor

#

feel free to reuse it elsewhere

crimson vapor
#

lol

modest maple
#

My mini high performance static server running wew

#

hopefully this will fix my cdn issues

obtuse knoll
#

Hey guys.
If anyone could help me with discord.py - i would appreciate it.
I am trying to work with the streamlabs API connected to a discord bot.
When something specific is entered into the channel.
(For example:

@client.event
async def on_message(message):
  if "hello" in message.content:
    # DO STUFF
```)

But how do I do this for a SPECIFIC channel.
#

Because i do not want all channels to be checked, just 1 specifically.

earnest phoenix
obtuse knoll
#

it's that easy?

#

lol

earnest phoenix
#

yup

obtuse knoll
#

i always over-complicate it

#

thanks bro.

simple pond
#

E

obtuse knoll
#

wait, does it work if i do async def on_message(ctx, message) ?

#

@earnest phoenix Because "ctx" isn't defined if I do it.

earnest phoenix
#

my bad

obtuse knoll
#

ah

#

ok

#

thanks

#

🙂

atomic tusk
#

Hey guys

naive mortar
#

heyoo

heavy marsh
#

in d.js how to get the number of channels the bot is connected to?

#

is it client.voice.broadcasts

#

or client.voice.connections

rose tartan
#

quick quetion

#

question*

#

does anyone know how to make a multi guild reaction roles?

quartz kindle
#

wdym

#

react once and get a role in multiple guilds?

rose tartan
#

yes

#

like with mongodb

quartz kindle
#

make a list of guilds and role ids for each guild

#

when a user reacts, check if the user exists in said guilds, and for each guild they exist in, add them the role id for that guild

rose tartan
#

with a database

#

not implementing servers manually

quartz kindle
#

same thing

quaint wasp
#

My code is this: js { name: "Current Status: ", value: status, inline: false },, but I get this:

quartz kindle
#

what is status

supple shale
#

@quaint wasp

quaint wasp
supple shale
#
}
      
    
    const status = {
      online: "YOUR EMOJI",
      idle: "YOUR EMOJI",
      dnd: "YOUR EMOJI",
      offline: "YOUR EMOJI"
    }
#
.addField("**![flecherougemeoji](https://cdn.discordapp.com/emojis/819716580409344021.webp?size=128 "flecherougemeoji") Status**", `${status[member.user.presence.status]}`,true)
quaint wasp
supple shale
#

const Discord = require('discord.js'); 
const moment = require('moment')
module.exports.run = async (bot, message, args) => {

  

    

      const flags = {
        DISCORD_EMPLOYEE: `![staff_badge](https://cdn.discordapp.com/emojis/819716957762093075.webp?size=128 "staff_badge")`,
        DISCORD_PARTNER: `![partenaireemoji](https://cdn.discordapp.com/emojis/819716773393465354.webp?size=128 "partenaireemoji")`,
        BUGHUNTER_LEVEL_1: `Bug Hunter (Level 1)`,
        BUGHUNTER_LEVEL_2: `Bug Hunter (Level 2)`,
        HYPESQUAD_EVENTS: `![HypeSquademoji](https://cdn.discordapp.com/emojis/819716627993985045.webp?size=128 "HypeSquademoji")`,
        HOUSE_BRAVERY: `:BraveryLogoemoji:`,
        HOUSE_BRILLIANCE: `![BrillianceLogoemoji](https://cdn.discordapp.com/emojis/819716429669859328.webp?size=128 "BrillianceLogoemoji")`,
        HOUSE_BALANCE: `![BraveryLogoemoji](https://cdn.discordapp.com/emojis/819716379313700874.webp?size=128 "BraveryLogoemoji")`,
        EARLY_SUPPORTER: `![BalanceLogojpg](https://cdn.discordapp.com/emojis/819716330227499019.webp?size=128 "BalanceLogojpg")`,
        TEAM_USER: `Membre team`,
        SYSTEM: `Système`,
        VERIFIED_BOT: `Bot certifié`,
        VERIFIED_DEVELOPER: `Développeur bot certifié`,
        
        
      }
      
    
    const status = {
      online: "![enligne](https://cdn.discordapp.com/emojis/821105517580648448.webp?size=128 "enligne")",
      idle: "![innactif](https://cdn.discordapp.com/emojis/821105368071012402.webp?size=128 "innactif")",
      dnd: "![nepasderanger](https://cdn.discordapp.com/emojis/821105395661406238.webp?size=128 "nepasderanger")",
      offline: "![offline](https://cdn.discordapp.com/emojis/821105422207025172.webp?size=128 "offline")"
    }
      
quartz kindle
#

@quaint wasp you did value: status

#

meaning status is a variable

#

what is the content of this variable

#

how did you define status

quaint wasp
#

I didnt....

quartz kindle
#

you did

supple shale
#

@quaint wasp use a variable

quaint wasp
#

Like a actiualy I didn't do const status

#

Also my pc just crashed

quartz kindle
#

then where did you get status from

quaint wasp
supple shale
quartz kindle
supple shale
#

or atom

quartz kindle
#

where did the variable status come from

quaint wasp
#

I'll check

#

...

#

-snipe

#

Pls snipe

supple shale
#

@quaint wasp

#

on the top you put your variable status

crude bough
#

Why isn't my code working?
Nothing seems to be printed in the debug logs or the channel

@commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print('Vote recieved!')
        print(data)
        
        gg_channel = self.client.get_channel(819639514758643754)
        await gg_channel.send(f'data = {str(data)}')
        await gg_channel.send(f'Vote from {data.user} found!\nThank you for voting! You have recieved a gift of 10 rating points.')
        
lyric mountain
#

That indentation seems wrong

sour flame
#

My code ```js
import discord
from discord.ext import commands
import json
import os
import random

os.chdir("C:\Users\ravi_\Desktop\Discord Bots\Mail")

client = commands.Bot(command_prefix = m!)

@client.event
async def on_ready():
print("Ready")

@client.command()
async def balance(ctx):
await open_account(ctx.author)

users = await get_bank_data()

wallet_amt = users[str(user.id)]["wallet"] 
bank_amt = users[str(user.id)]["bank"] 


em = discord.Embed(title = f"{ctx.author.name}'s balance", color = discord.Color.red())
em.add_field(name = "Wallet balance",value = wallet_amt)
em.add_field(name = "Bank balance",value = bank_amt)
await ctx.send(embed = em)

@client.command()
async def beg(ctx):
await open_account(ctx.author)

users = await get_bank_data()

user = ctx.author

earnings = random.randrange(101)


await ctx.send(f"Some gave you {earning} coins!!")




users[str(user.id)]["wallet"] += earnings

with open("bank.json","w") as f:
    json.dump(users,f)

async def open_account(user):

user = await get_bank_data()

if str(user.id) in users:
     return False
else:
    users[str(user.id)] = {}
    users[str(user.id)]["wallet"] = 10
    user[str(user.id)]["bank"] = 0

with open("bank.json","w") as f:
    json.dump(users,f)
return True

async def get_bank_dat():
with open("bank.json", "r") as f:
user = json.load(f)
return users

client.run("Bot Token")
My error
PS C:\Users\ravi_\Desktop\Discord Bots\EconomyManager> python main.py
File "C:\Users\ravi_\Desktop\Discord Bots\EconomyManager\main.py", line 7
os.chdir("C:\Users\ravi_\Desktop\Discord Bots\Mail")
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

earnest phoenix
#

So ``` client.on('voiceStateUpdate', (oldState, newState) => {
if(newState.channelID !== null) {
const voiceChannelName = newState.channel.name
let roleFind = newState.guild.roles.cache.find(role => role.name === voiceChannelName);
var roleName = roleFind;

    if(roleFind) {
        newState.member.roles.add(roleName)
    }

}
if(oldState.channelID !== null) {
    console.log(roleName)
    oldState.member.roles.remove(roleName)

}
})``` whenever the `if(oldState.channelID !== null)` goes off, the variable `roleName` is now undefined. why?
dusky sundial
sour flame
#

at os.chdir

#

???

earnest phoenix
dusky sundial
#

Your string in os.chdir has backslashes in it, that won't work

#

You need to escape it with another backslash

sour flame
#

kk

dusky sundial
#

Or use os.path.sep as that will automatically pick the separator char for your operating system

sour flame
#
File "C:\Users\ravi_\Desktop\Discord Bots\EconomyManager\main.py", line 9
    client = commands.Bot(command_prefix = m!)
                                            ^ 
SyntaxError: invalid syntax ``` I changed it to \\\  so now what
dusky sundial
#

well m! is not valid syntax

#

That takes a string or a character

#

I would recommend that you learn basic python, or if you already know some, read the error messages. They can be useful

agile lance
#

It needs to be a string

earnest phoenix
#

can someone help me make my bot play mp3s into vc?
like custom mp3s that i add in, not from youtube

crimson vapor
#

with discord.js, you can just do Connection.play(pathToMP3)

sturdy dock
#

what library are you using

earnest phoenix
sturdy dock
#

yeah

#

oh

#

idk then sorry

crimson vapor
#

yeah idk py

sturdy dock
blissful coral
#

Anyone here use WSL?

pale vessel
#

ya

crimson vapor
#

wyd @swift umbra

#

what kinda stuff 😉?

#

you should stream in General then

#

you sure?

#

cringe

earnest phoenix
#

and ive posted in the wrong channel

hazy horizon
#

Yo

earnest phoenix
#

_

#

?

hazy horizon
#

what is the startup command for .py

crimson vapor
#

python

hazy horizon
#

are you joking

#

the startup command

#

not what it is

crimson vapor
#

idk python but I really thought it was python file_name.py

hazy horizon
#

hmm, ill give it a shot, brb

agile lance
#

its python file.py @hazy horizon

hazy horizon
#

Ok

#

I got 2 .py files

agile lance
#

ok so do python main_file_name.py

#

and import the 2nd file in the main file

#

and sorry this may offend you: Learn python before making a discord bot

earnest phoenix
#

like just make sure to learn how to run python code

indigo ice
#

@indigo ice

fickle magnet
#
public static void main(String[] command_line_args) throws FileNotFoundException,  java.io.IOException {

        Person me = new Person("SomeGuy",28);
        ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("Data.tx"));

        out.writeObject(me);



    }

trying to store objects into a txt file but it doesn't work

lusty quest
#

dont store into text files, its single threaded and prone to corruption

drowsy epoch
#

ohh ok

fickle magnet
#

what do you recommand

drowsy epoch
#

what do u think is best?

fickle magnet
#

Json?

lusty quest
#

a database

drowsy epoch
#

json aint a db

fickle magnet
#

true but Im using intelij and I don't want to pay for sql

lusty quest
#

use mongodb

#

or firebase

drowsy epoch
#

or quick.db

#

wait thats java

#

ignore what i said

lusty quest
#

both offer free cloud databases

green kestrel
#

also mysql is a lot more mature libs than mongo on java

#

mongo only excels at support on js

drowsy epoch
#

r u using italian?

lusty quest
#

its possible that your command handler splits the messages apart

#

so you just send !Attentato

fickle magnet
#

ugh I have to relearn sql

drowsy epoch
#

ye that helps

lusty quest
fickle magnet
lusty quest
#

google is your friend

sacred aurora
#

u are lower casing the message.content

#

and this startswith contain uppercase A

#

wut

#

so it wont be called

#

hmm okay

#

and this one?

#

can i ask what the problem in the first place

#

change this

#

that "Attentato...."

#

it should be all lower case

#

so "attentato...."

#

dahek

sand seal
#

hi

#

can anyone tell me purge command? i want to add that command in my bot. Pls anyone tell.

vivid fulcrum
#

purge command

#

that'll be $100.20

cinder patio
#

👀

swift cloak
#
message.guild.members.forEach(m => m.rickroll())
swift cloak
#

purge command

#
message.guild.members.forEach((m) => {
  m.kick()
})```
#

this purges

#

all members

sand seal
swift cloak
#

ohhh

swift cloak
#

this purges

#

and deletes users messages

grizzled raven
#

i think this is the part everyone laughs

#

@sand seal use message.channel.bulkDelete

sand seal
digital sinew
#

ohhh

vivid fulcrum
#

the whole coding of purge

digital sinew
#

this purges

vivid fulcrum
#

you're welcome

sand seal
grizzled raven
cinder patio
#

I wonder why bloblul

earnest phoenix
#

Hi

dark crest
#

how can i get my api token from the website?

dusky sundial
dark crest
#

THX

dusky sundial
#

Or go to the edit page and click the "Webhooks" tab

dark crest
#

😦

dark crest
versed plume
#

hi can someone help me with plasma bot?

lament rock
#

Go to their support server

versed plume
#

their link is expired

pale vessel
versed plume
#

ty

sacred trout
#

can anyone help me?

#
  File "c:\Users\schwt\OneDrive\Desktop\bot with db\main.py", line 5, in <module>
    array = numpy.random.randint(0, 100(10, 5))
TypeError: 'int' object is not callable```
#

error

cinder patio
#

100(10, 5) numbers cannot be called because they're not functions

sacred trout
#

works for him

pale vessel
#

you're missing a comma

sacred trout
#

where?

pale vessel
#

look closely

sacred trout
#

bruh

#

xD

#

thanks

supple shale
#
const Discord = require('discord.js'); 
module.exports.run = async (bot, message) => {

    if (!message.guild) return
        let args = message.content.trim().split(/ +/g)
        
        if (args[0].toLowerCase() ===  "v!clear") {
            if(!message.guild.me.hasPermission('MANAGE_MESSAGES')) return message.channel.send('![attendtionemoji](https://cdn.discordapp.com/emojis/820613005187350539.webp?size=128 "attendtionemoji") | **Oupss il me faut la permission `MANAGE_MESSAGE`**').then(msg => msg.delete({ timeout: 5000})) 
        var embedclear = new Discord.MessageEmbed()
    
        message.delete()

        if (!message.member.hasPermission('MANAGE_MESSAGES')) return message.channel.send("![attendtionemoji](https://cdn.discordapp.com/emojis/820613005187350539.webp?size=128 "attendtionemoji") | **Vous devez avoir la permission `MANAGE_MESSAGE` pour faire cela**").then(msg => msg.delete({ timeout: 8000}))
            let count = parseInt(args[1])
            
            if (!count) return message.channel.send("![attendtionemoji](https://cdn.discordapp.com/emojis/820613005187350539.webp?size=128 "attendtionemoji") | **j'ai besoin de s'avoir le nombre de message à supprimés**").then(msg => msg.delete({ timeout: 8000}))
            if (isNaN(count)) return message.channel.send("![attendtionemoji](https://cdn.discordapp.com/emojis/820613005187350539.webp?size=128 "attendtionemoji") | **Veuillez indiquer un nombre valide**").then(msg => msg.delete({ timeout: 8000}))
            if (count < 1 || count > 50) return message.channel.send("![attendtionemoji](https://cdn.discordapp.com/emojis/820613005187350539.webp?size=128 "attendtionemoji") | **Veuillez indiquer un nombre entre 1 et 50**").then(msg => msg.delete({ timeout: 8000}))
            message.channel.bulkDelete(count + 1, true)
        
        message.channel.send(`![checkmarkemoji](https://cdn.discordapp.com/emojis/819716247175823412.webp?size=128 "checkmarkemoji") | **${args[1]}** message(s) was delete`).then(msg => msg.delete({ timeout: 10000}))
        }

}
module.exports.help = {
    name: "clear"
} 
pale vessel
#

uh, what's wrong?

supple shale
#

@sand seal

sand seal
sand seal
supple shale
#

just translate fr in en

sand seal
#

ok

steel arch
#

How do i put my bot to send animated emojis? Do i need nitro on my account?

pale vessel
#

no

#

just send <a:name:id>

steel arch
#

Ok thanks

pale vessel
#

the bot must be in that server with the emoji though

#

but it can use it anywhere

steel arch
#

Ok thanks again

quartz kindle
#

and must have "use external emojis" permission

upbeat willow
dusky sundial
steel arch
pale vessel
#

right click it

#

and select copy link and get the id if you don't have developer mode on

last sand
#

Pokemon zeraora?

steel arch
pale vessel
#

copy link instead then

#

can you find that?

steel arch
pale vessel
steel arch
#

No

pale vessel
#

that's weird

dusky sundial
#

What are the options when you right click it then?

steel arch
#

I dont have discord nitro, just a sec

pale vessel
#

you don't need nitro

#

ah

steel arch
#

Its in portuguese

#

But it doesn't show to copy link

pale vessel
#

just add a \

steel arch
#

Ok

vivid fulcrum
#

the client still filters it out

pale vessel
#

can you even do that , idk

#

well just inspect element then

vivid fulcrum
#

go into devtools and yeah

#

that

pale vessel
#

ctrl shift i

earnest phoenix
#

Ok I posted in the wrong one.
I'm currently having issues with the bot timing out.

dusky sundial
#

It's easier to help if you show the code that is failing

earnest phoenix
#

Alright, where will I find this?

dusky sundial
#

In.. your code?

#

If you're getting an error message it should tell you what line it errored at

earnest phoenix
#

It's currently erroring at the host. Ie. The bot. I'll show you the error message.

old cliff
#

Thats what we want

earnest phoenix
old cliff
dusky sundial
#

Huh? What are you trying to access?

solemn quartz
#

hi, can someone help me code a restart bot command?

#

i really dont know where to start

earnest phoenix
#

I'm updating or submitting my server to the bot.

old cliff
#

Bot?

dusky sundial
#

What is "the bot"?

earnest phoenix
#

The DSL bot.

steel arch
blazing portal
#

it's really an a. Short for animated

steel arch
#

Ok, but i think this is not correct const m = await message.channel.send("a:3339_loading:802499427200663612 **Aguarde...**");

blazing portal
#

your assumption is true, it's not in the format provided by flazepe

steel arch
#

i cant put the <>

cinder patio
#

Why can't you put em?

steel arch
#

It show me this

blazing portal
#

it shows you this when you use < and >?

steel arch
#

Oh, i think i found the problem