Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed !senddm user + content #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 234 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"author": "",
"license": "ISC",
"dependencies": {
"discord.js": "^14.14.1"
"discord.js": "^14.14.1",
"dotenv": "^16.4.5",
"node-fetch": "^2.7.0",
"openai": "^4.38.2"
},
"devDependencies": {
"eslint": "^9.0.0"
Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ client.on('messageCreate', async (message) => {
return;
}
if (!user.bot && user.id !== client.user.id) {
user.send('This is a direct message from the bot!')
user.send(`${message.author.displayName}: ${message.content.replace(`!senddm <@${user.id}>`, "")}`)
.then(() => message.reply('Direct message sent successfully!'))
.catch((error) => message.reply('Failed to send direct message. Please make sure the user allows direct messages from server members.'));
} else {
message.reply('You cannot send direct messages to bots or to yourself.');
message.reply('You cannot send direct messages to bots or to yourself.');
}
break;
case 'createchannel':
Expand Down