ahmed349
ahmed349
Explore posts from servers
DDeno
Created by ahmed349 on 11/22/2024 in #help
cant connect to mongo atlas via official driver or mongoose but works outside of deno
I am not sure how this relates to the issue at hand, could you clarify
3 replies
DDeno
Created by ahmed349 on 11/22/2024 in #help
cant connect to mongo atlas via official driver or mongoose but works outside of deno
import mongoose from "npm:mongoose";

const uri = 'mongodb+srv://no:[email protected]/?retryWrites=true&w=majority&appName=Cluster0'

async function run() {
await mongoose.connect(uri, {dbName: "sample_mflix"});
}

run().catch(console.dir);
import mongoose from "npm:mongoose";

const uri = 'mongodb+srv://no:[email protected]/?retryWrites=true&w=majority&appName=Cluster0'

async function run() {
await mongoose.connect(uri, {dbName: "sample_mflix"});
}

run().catch(console.dir);
code used by mongoose
3 replies
DIAdiscord.js - Imagine an app
Created by ahmed349 on 4/24/2024 in #djs-questions
InteractionNotReplied, sometimes occurs
ahhh must have missed that while reading the documentation, and i am also to blame for not figured it out intuitively, thank you very much
6 replies
DIAdiscord.js - Imagine an app
Created by ahmed349 on 4/24/2024 in #djs-questions
InteractionNotReplied, sometimes occurs
i am testing getting wrong letters in the game of hangman, but sometimes it works and gives me the proper response, and sometimes it just breaks and gives the aforementioned error
6 replies
DIAdiscord.js - Imagine an app
Created by ahmed349 on 4/24/2024 in #djs-questions
InteractionNotReplied, sometimes occurs
without including most of the gamelogic, this is how my code works, manipulating an array of active game sessions to see who is playing what game, and if statements to give appropriate replies when they fail/win the game depending on the input
async function execute(interaction){
let userId = interaction.user.id;
let session = activeGameSessions[Object.keys(activeGameSessions).find(str => str == userId)];
if (session == undefined) {
session = await createNewSession(userId);
interaction.reply('YO, Guess this word\n' + session.revealedWord);
return;
}

let input = interaction.options.getString('string');
console.log(input);
if (!input) return;

if (input.length > 1){
if (session.attemptWord(input)){
interaction.reply('GG, ig\n' + session.revealedWord);
delete(activeGameSessions[userId]);

return;
}
else {
interaction.reply('Nope, stupid nerd\n' + session.revealedWord);
}
}
else {
if (session.attemptLetter(input)){
interaction.reply('Les gooooo!!1\n' + session.revealedWord)
}
else {
interaction.reply('Nope, bad letter my boy\n' + session.revealedWord);
}
}

interaction.followUp(`Holy moly your lives are at ${session.lives} pepperoni`);
}
async function execute(interaction){
let userId = interaction.user.id;
let session = activeGameSessions[Object.keys(activeGameSessions).find(str => str == userId)];
if (session == undefined) {
session = await createNewSession(userId);
interaction.reply('YO, Guess this word\n' + session.revealedWord);
return;
}

let input = interaction.options.getString('string');
console.log(input);
if (!input) return;

if (input.length > 1){
if (session.attemptWord(input)){
interaction.reply('GG, ig\n' + session.revealedWord);
delete(activeGameSessions[userId]);

return;
}
else {
interaction.reply('Nope, stupid nerd\n' + session.revealedWord);
}
}
else {
if (session.attemptLetter(input)){
interaction.reply('Les gooooo!!1\n' + session.revealedWord)
}
else {
interaction.reply('Nope, bad letter my boy\n' + session.revealedWord);
}
}

interaction.followUp(`Holy moly your lives are at ${session.lives} pepperoni`);
}
6 replies
DIAdiscord.js - Imagine an app
Created by ahmed349 on 4/22/2024 in #djs-questions
error importing json
oh ok thanks
5 replies
AAdmincraft
Created by Louis_Dew on 8/28/2023 in #questions
Server hardware
as someone that knows next to nothing about servers, i would like to bring up aternos
100 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
thank you very much
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
thanks and sorry for whatever the fuck is wrong with my computer
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
uh
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
it even works on that site now
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
literally didnt change a thing other than restarted my computer
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
wtf
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
it works
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
the hell
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
No description
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
ah thats convenient
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
then use what
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
72 replies
AAdmincraft
Created by ahmed349 on 8/28/2023 in #questions
cant open port for local server
No description
72 replies