aa lot of shit
This commit is contained in:
parent
c1670b8abd
commit
6bde961dbe
4 changed files with 185 additions and 15 deletions
|
|
@ -1,15 +0,0 @@
|
|||
import { ApplicationCommandType, ContextMenuCommandBuilder, ContextMenuCommandInteraction, InteractionContextType, Snowflake, User } from "discord.js";
|
||||
import { ContextCommand } from "../command.ts";
|
||||
|
||||
export default class RailUser extends ContextCommand<User> {
|
||||
targetType: ApplicationCommandType.User = ApplicationCommandType.User;
|
||||
contextDefinition: ContextMenuCommandBuilder =
|
||||
new ContextMenuCommandBuilder()
|
||||
.setName('rail')
|
||||
.setType(ApplicationCommandType.User)
|
||||
async run(interaction: ContextMenuCommandInteraction, target: User): Promise<void> {
|
||||
await interaction.reply(`Raililng <@${target.id}>.`)
|
||||
await new Promise(resolve => setTimeout(resolve, 1000))
|
||||
await interaction.editReply(`UHGhghgghghgh. Railing successfull.`)
|
||||
}
|
||||
}
|
||||
24
src/commands/mock.ts
Normal file
24
src/commands/mock.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import {
|
||||
ApplicationCommandType,
|
||||
ContextMenuCommandBuilder,
|
||||
ContextMenuCommandInteraction,
|
||||
InteractionContextType,
|
||||
Message,
|
||||
Snowflake,
|
||||
User
|
||||
} from "discord.js";
|
||||
import { ContextCommand } from "../command.ts";
|
||||
|
||||
export default class Mock extends ContextCommand<Message> {
|
||||
targetType: ApplicationCommandType.Message = ApplicationCommandType.Message;
|
||||
contextDefinition: ContextMenuCommandBuilder =
|
||||
new ContextMenuCommandBuilder()
|
||||
.setName('mock')
|
||||
.setType(ApplicationCommandType.Message)
|
||||
async run(interaction: ContextMenuCommandInteraction, target: Message): Promise<void> {
|
||||
await interaction.deferReply();
|
||||
let message = target.content;
|
||||
message = message.replace(/(.)(.)/g, (a,b,c)=>b.toLowerCase() + c.toUpperCase())
|
||||
await interaction.followUp(message);
|
||||
}
|
||||
}
|
||||
72
src/commands/musicsearch.ts
Normal file
72
src/commands/musicsearch.ts
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
import {Command} from "../command.ts";
|
||||
import {
|
||||
ActionRowBuilder,
|
||||
ApplicationIntegrationType, ButtonBuilder, ButtonStyle,
|
||||
ChatInputCommandInteraction, EmbedBuilder,
|
||||
InteractionContextType,
|
||||
SlashCommandBuilder
|
||||
} from "discord.js";
|
||||
import { Config } from "../config.ts";
|
||||
import {getSongOnPreferredProvider, kyzaify} from "../helper.ts";
|
||||
|
||||
export default class PingCommand extends Command {
|
||||
async run(interaction: ChatInputCommandInteraction, config: Config) {
|
||||
await interaction.deferReply()
|
||||
const search = interaction.options.getString("search")!
|
||||
const paramsObj = {entity: "song", term: search};
|
||||
const searchParams = new URLSearchParams(paramsObj);
|
||||
const itunesinfo = (await (await fetch(`https://itunes.apple.com/search?${searchParams.toString()}`)).json()).results[0];
|
||||
const link = itunesinfo.trackViewUrl
|
||||
const songlink = await fetch(`https://api.song.link/v1-alpha.1/links?url=${link}`).then(a => a.json())
|
||||
const preferredApi = getSongOnPreferredProvider(songlink, link)!
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setAuthor({
|
||||
name: preferredApi.artist,
|
||||
})
|
||||
.setTitle(preferredApi.title)
|
||||
.setThumbnail(preferredApi.thumbnailUrl)
|
||||
.setFooter({
|
||||
text: "amy jr",
|
||||
});
|
||||
const meow = Object.keys(songlink.linksByPlatform)
|
||||
let message = ""
|
||||
|
||||
const nya: ActionRowBuilder<ButtonBuilder>[] = [];
|
||||
let currentRow = new ActionRowBuilder<ButtonBuilder>();
|
||||
|
||||
for (const meowi of meow) {
|
||||
if (currentRow.components.length >= 5) {
|
||||
nya.push(currentRow);
|
||||
currentRow = new ActionRowBuilder<ButtonBuilder>();
|
||||
}
|
||||
currentRow.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setURL(songlink.linksByPlatform[meowi].url)
|
||||
.setLabel(kyzaify(meowi))
|
||||
.setStyle(ButtonStyle.Link)
|
||||
);
|
||||
}
|
||||
if (currentRow.components.length > 0) {
|
||||
nya.push(currentRow);
|
||||
}
|
||||
|
||||
await interaction.followUp({
|
||||
components: nya,
|
||||
embeds: [embed]
|
||||
});
|
||||
}
|
||||
|
||||
slashCommand = new SlashCommandBuilder()
|
||||
.setName("musicsearch")
|
||||
.setDescription("search yo music").setIntegrationTypes([
|
||||
ApplicationIntegrationType.UserInstall
|
||||
]).addStringOption(option =>{
|
||||
return option.setName("search").setDescription("shit you wanna search").setRequired(true);
|
||||
})
|
||||
.setContexts([
|
||||
InteractionContextType.BotDM,
|
||||
InteractionContextType.Guild,
|
||||
InteractionContextType.PrivateChannel
|
||||
]);
|
||||
}
|
||||
89
src/commands/uwuifier.ts
Normal file
89
src/commands/uwuifier.ts
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
import {
|
||||
ApplicationCommandType,
|
||||
ContextMenuCommandBuilder,
|
||||
ContextMenuCommandInteraction,
|
||||
InteractionContextType,
|
||||
Message,
|
||||
Snowflake,
|
||||
User
|
||||
} from "discord.js";
|
||||
import { ContextCommand } from "../command.ts";
|
||||
|
||||
export default class Uwuifier extends ContextCommand<Message> {
|
||||
targetType: ApplicationCommandType.Message = ApplicationCommandType.Message;
|
||||
contextDefinition: ContextMenuCommandBuilder =
|
||||
new ContextMenuCommandBuilder()
|
||||
.setName('uwuify')
|
||||
.setType(ApplicationCommandType.Message)
|
||||
async run(interaction: ContextMenuCommandInteraction, target: Message): Promise<void> {
|
||||
|
||||
const endings = [
|
||||
"rawr x3",
|
||||
"OwO",
|
||||
"UwU",
|
||||
"o.O",
|
||||
"-.-",
|
||||
">w<",
|
||||
"(⑅˘꒳˘)",
|
||||
"(ꈍᴗꈍ)",
|
||||
"(˘ω˘)",
|
||||
"(U ᵕ U❁)",
|
||||
"σωσ",
|
||||
"òωó",
|
||||
"(///ˬ///✿)",
|
||||
"(U ﹏ U)",
|
||||
"( ͡o ω ͡o )",
|
||||
"ʘwʘ",
|
||||
":3",
|
||||
":3",
|
||||
"XD",
|
||||
"nyaa~~",
|
||||
"mya",
|
||||
">_<",
|
||||
"😳",
|
||||
"🥺",
|
||||
"😳😳😳",
|
||||
"rawr",
|
||||
"^^",
|
||||
"^^;;",
|
||||
"(ˆ ﻌ ˆ)♡",
|
||||
"^•ﻌ•^",
|
||||
"/(^•ω•^)",
|
||||
"(✿oωo)"
|
||||
];
|
||||
|
||||
const replacements = [
|
||||
["small", "smol"],
|
||||
["cute", "kawaii~"],
|
||||
["fluff", "floof"],
|
||||
["love", "luv"],
|
||||
["stupid", "baka"],
|
||||
["what", "nani"],
|
||||
["meow", "nya~"],
|
||||
["hello", "hewwo"],
|
||||
];
|
||||
await interaction.deferReply();
|
||||
let message = target.content;
|
||||
function getRandomElement<T>(arr:T[]):T {
|
||||
const randomIndex = Math.floor(Math.random() * arr.length);
|
||||
return arr[randomIndex];
|
||||
}
|
||||
|
||||
|
||||
function uwuify(message: string): string {
|
||||
message = message.toLowerCase();
|
||||
for (const pair of replacements) {
|
||||
message = message.replaceAll(pair[0], pair[1]);
|
||||
}
|
||||
message = message
|
||||
.replaceAll(/([ \t\n])n/g, "$1ny")
|
||||
.replaceAll(/[lr]/g, "w")
|
||||
.replaceAll(/([ \t\n])([a-z])/g, (_, p1, p2) => Math.random() < .5 ? `${p1}${p2}-${p2}` : `${p1}${p2}`)
|
||||
.replaceAll(/([^.,!][.,!])([ \t\n])/g, (_, p1, p2) => `${p1} ${getRandomElement(endings)}${p2}`);
|
||||
return message;
|
||||
}
|
||||
|
||||
interaction.followUp(uwuify(message));
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue