Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Fix small typo and add image channel to env #1

Open
wants to merge 3 commits 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ MONGO_URI=mongodb+srv://super_hideous_user:super_secret_password@cluster0.****.m
DISCORD_TOKEN=NTk5Mjc0MzY1NTAyMDk1Mzcw.XSizvg.ecj2ZM5jy68kPWKhY**********
GUILD_ID=59002493**********
AUTHORIZED_ROLE=83276051**********
IMAGE_CHANNEL=9199828*******
```
7. Invite your bot to your server bearing the `bot` and `application.commands` scopes. Generate the invlite link in the OAuth2 URL Generator under the OAuth2 category.
8. Install the dependencies through `npm install` and launch the bot via the command `node index.js` on terminal.
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ Structures.extend('Message', DJSMessage => class Message extends DJSMessage{
});

client.on('message', async(message) => {
if (message.author.bot || message.typpe === 'dm'){
if (message.author.bot || message.type === 'dm'){
return;
};
if (message.channel.id === '780565988559028245' && !message.attachments.first()?.width){
if (message.channel.id === process.env.IMAGE_CHANNEL && !message.attachments.first()?.width){
message.delete();
if (!message.author.violations.get('image') || message.author.violations.get('image') < Date.now()){
message.author.send('<:mai_peek:774202712534941716> **Hiyaaa! Mai\'s Maid Here!**\n\nSeems like you sent a message on <#780565988559028245> without actually sending an image alongside that message. If you didn\'t know, we discourage users to chat on that channel. You can read more about it on the channel topic. Messaging you in case you didn\'t know or have forgotten about it. And oh! I also deleted the message you sent on that channel!~\n\nNYAAAAAWRR!', { files: [{ attachment: 'https://i.imgur.com/QiUovdw.png', name: 'rawr.png' }]}).catch(()=>{});
Expand Down