push latest
This commit is contained in:
parent
1d839edd35
commit
f34811fe80
@ -12,9 +12,9 @@
|
||||
"axios": "^1.7.7",
|
||||
"discord.js": "^14.16.3",
|
||||
"dotenv": "^16.4.5",
|
||||
"unirest": "^0.6.0",
|
||||
"express": "^4.18.2",
|
||||
"express": "^4.21.2",
|
||||
"mongoose": "^7.0.4",
|
||||
"shortid": "^2.2.16"
|
||||
"shortid": "^2.2.16",
|
||||
"unirest": "^0.6.0"
|
||||
}
|
||||
}
|
||||
|
@ -21,12 +21,10 @@ db.once('open', () => {
|
||||
|
||||
// Supported domains
|
||||
const supportedDomains = [
|
||||
's.shells.lol',
|
||||
's.hehe.rest',
|
||||
's.dcord.rest', // default domain
|
||||
's.nodejs.lol',
|
||||
's.dht.rest',
|
||||
's.tcp.quest'
|
||||
's.dcord.lol',
|
||||
's.peer.rest',
|
||||
's.njs.lol', // default domain
|
||||
's.dlinux.pro'
|
||||
];
|
||||
|
||||
// Middleware to check API key
|
||||
@ -48,8 +46,8 @@ app.post('/api/shorturl', validateApiKey, async (req, res) => {
|
||||
}
|
||||
|
||||
// Validate domain, default to 's.dcord.rest' if not provided or invalid
|
||||
const selectedDomain = supportedDomains.includes(domain) ? domain : 's.dcord.rest';
|
||||
|
||||
const selectedDomain = supportedDomains.includes(domain) ? domain : 's.dlinux.pro';
|
||||
|
||||
try {
|
||||
let url = await Url.findOne({ longUrl });
|
||||
|
||||
|
14
short.js
14
short.js
@ -28,12 +28,10 @@ client.once('ready', async () => {
|
||||
.setDescription('Choose the domain for the short URL')
|
||||
.setRequired(false)
|
||||
.addChoices(
|
||||
{ name: 's.shells.lol', value: 's.shells.lol' },
|
||||
{ name: 's.hehe.rest', value: 's.hehe.rest' },
|
||||
{ name: 's.dcord.rest', value: 's.dcord.rest' }, // default domain
|
||||
{ name: 's.nodejs.lol', value: 's.nodejs.lol' },
|
||||
{ name: 's.dht.rest', value: 's.dht.rest' },
|
||||
{ name: 's.tcp.quest', value: 's.tcp.quest' }
|
||||
{ name: 's.dcord.lol', value: 's.dcord.lol' },
|
||||
{ name: 's.peer.rest', value: 's.peer.rest' },
|
||||
{ name: 's.njs.lol', value: 's.njs.lol' },
|
||||
{ name: 's.dlinux.pro', value: 's.dlinux.pro' }
|
||||
)
|
||||
)
|
||||
.toJSON(); // Convert to JSON
|
||||
@ -58,7 +56,7 @@ client.once('ready', async () => {
|
||||
client.on('interactionCreate', async interaction => {
|
||||
if (!interaction.isCommand() || interaction.commandName !== 'shortenurl') return;
|
||||
|
||||
const domain = interaction.options.getString('domain') || 's.dcord.rest';
|
||||
const domain = interaction.options.getString('domain') || 's.dlinux.pro';
|
||||
const url = interaction.options.getString('url');
|
||||
|
||||
// Validate the URL format before proceeding
|
||||
@ -97,4 +95,4 @@ client.on('interactionCreate', async interaction => {
|
||||
}
|
||||
});
|
||||
|
||||
client.login(process.env.BOT_TOKEN);
|
||||
client.login(process.env.BOT_TOKEN);
|
Loading…
x
Reference in New Issue
Block a user