mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-29 00:14:23 -04:00
* Update googleThat * remove extra space?? * remove periods * Make devs one line * THOROREN 😭😭😭😭😭😭
This commit is contained in:
parent
81e5b5b6b4
commit
fbc444df8a
1 changed files with 18 additions and 8 deletions
|
@ -6,12 +6,17 @@
|
||||||
|
|
||||||
import { ApplicationCommandOptionType, findOption } from "@api/Commands";
|
import { ApplicationCommandOptionType, findOption } from "@api/Commands";
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs, EquicordDevs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
|
|
||||||
function getMessage(opts) {
|
function getMessage(opts) {
|
||||||
const inputOption = findOption(opts, "input", "");
|
const inputOption = findOption(opts, "input", "");
|
||||||
|
|
||||||
const queryURL = "" + searchEngines[settings.store.defaultEngine] + encodeURIComponent(inputOption);
|
let queryURL = "" + searchEngines[settings.store.defaultEngine] + encodeURIComponent(inputOption);
|
||||||
|
|
||||||
|
if (settings.store.customEngineURL) {
|
||||||
|
queryURL = "" + [settings.store.customEngineURL] + encodeURIComponent(inputOption);
|
||||||
|
}
|
||||||
|
|
||||||
if (settings.store.hyperlink) {
|
if (settings.store.hyperlink) {
|
||||||
return `[${inputOption}](${queryURL})`;
|
return `[${inputOption}](${queryURL})`;
|
||||||
|
@ -30,6 +35,7 @@ const searchEngines = {
|
||||||
"Yandex": "https://yandex.com/search/?text=",
|
"Yandex": "https://yandex.com/search/?text=",
|
||||||
"Ecosia": "https://www.ecosia.org/search?q=",
|
"Ecosia": "https://www.ecosia.org/search?q=",
|
||||||
"Ask": "https://www.ask.com/web?q=",
|
"Ask": "https://www.ask.com/web?q=",
|
||||||
|
"AOL": "https://search.aol.com/aol/search?q=",
|
||||||
"LetMeGoogleThatForYou": "https://letmegooglethat.com/?q="
|
"LetMeGoogleThatForYou": "https://letmegooglethat.com/?q="
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,10 +43,9 @@ const settings = definePluginSettings({
|
||||||
hyperlink: {
|
hyperlink: {
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
description: "If the sent link should hyperlink with the query as the label",
|
description: "If the sent link should hyperlink with the query as the label",
|
||||||
default: true
|
default: false
|
||||||
},
|
},
|
||||||
defaultEngine:
|
defaultEngine: {
|
||||||
{
|
|
||||||
type: OptionType.SELECT,
|
type: OptionType.SELECT,
|
||||||
description: "The search engine to use",
|
description: "The search engine to use",
|
||||||
options: Object.keys(searchEngines).map((key, index) => ({
|
options: Object.keys(searchEngines).map((key, index) => ({
|
||||||
|
@ -48,19 +53,24 @@ const settings = definePluginSettings({
|
||||||
value: key,
|
value: key,
|
||||||
default: index === 0
|
default: index === 0
|
||||||
}))
|
}))
|
||||||
|
},
|
||||||
|
customEngineURL: {
|
||||||
|
description: "The URL of the Engine you wish to use",
|
||||||
|
type: OptionType.STRING,
|
||||||
|
placeholder: "https://search.vmohammad.dev/?q="
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "GoogleThat",
|
name: "GoogleThat",
|
||||||
description: "Adds a command to send a google search link to a query",
|
description: "Adds a command to send a internet search link",
|
||||||
authors: [Devs.Samwich],
|
authors: [Devs.Samwich, EquicordDevs.KrystalSkull],
|
||||||
tags: ["search", "google", "query", "duckduckgo", "command"],
|
tags: ["search", "google", "query", "duckduckgo", "command"],
|
||||||
settings,
|
settings,
|
||||||
commands: [
|
commands: [
|
||||||
{
|
{
|
||||||
name: "googlethat",
|
name: "googlethat",
|
||||||
description: "send a search engine link to a query",
|
description: "send a search engine link",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "input",
|
name: "input",
|
Loading…
Add table
Add a link
Reference in a new issue