The weeb for the next gen discord boat - Wamellow wamellow.com
bot discord
at master 566 lines 13 kB view raw
1import type { ChannelType } from "discord-api-types/v10"; 2 3import type { actor } from "./utils/tts"; 4 5export interface ApiError { 6 status: number; 7 message: string; 8} 9 10export interface ApiV1TopguildsGetResponse { 11 id: string; 12 name: string; 13 icon: string | null; 14 memberCount: number; 15 16 verified: boolean; 17 partnered: boolean; 18} 19 20export interface ApiV1UsersMeGuildsGetResponse { 21 id: string; 22 name: string; 23 icon: string | null; 24 bot: boolean; 25} 26 27export enum GuildFlags { 28 Premium = 1 << 0, 29 PrivateLeaderboard = 1 << 1, 30 EmbedDiscordLinks = 1 << 2, 31 32 WelcomeEnabled = 1 << 4, 33 FarewellEnabled = 1 << 5, 34 StarboardEnabled = 1 << 6, 35 PassportEnabled = 1 << 7, 36 37 TextToSpeechAnnounceUsers = 1 << 8, 38 TextToSpeechQueueMessages = 1 << 9, 39 TextToSpeechAllowBots = 1 << 10, 40 41 WelcomeRestore = 1 << 11, 42 WelcomeDirectMessage = 1 << 12, 43 WelcomeCard = 1 << 13, 44 WelcomeCardInEmbed = 1 << 14, 45 WelcomeButton = 1 << 15, 46 WelcomeButtonPing = 1 << 16, 47 48 FarewellCard = 1 << 17, 49 FarewellCardInEmbed = 1 << 18, 50 51 StarboardAllowNSFW = 1 << 19, 52 StarboardAllowBots = 1 << 20, 53 StarboardAllowEdits = 1 << 21, 54 StarboardAllowSelf = 1 << 22, 55 StarboardDisplayReference = 1 << 23, 56 StarboardDeleteOnLoss = 1 << 24 57} 58 59export interface ApiV1GuildsGetResponse { 60 id: string; 61 name: string; 62 icon: string | null; 63 banner: string | null; 64 memberCount: number; 65 premiumTier: number; 66 inviteUrl: string | undefined; 67 description: string | null; 68 follownewsChannel?: { 69 id: string; 70 name: string; 71 }; 72 tts: { 73 channelId: string | null; 74 logChannelId: string | null; 75 blacklistRoleId: string | null; 76 priorityRoleId: string | null; 77 maxLength: number | null; 78 }; 79 flags: GuildFlags; 80 style: { 81 username: string | null; 82 avatar: string | null; 83 banner: string | null; 84 }; 85} 86 87export interface ApiV1GuildsStylePatchResponse { 88 username: string | null; 89 avatar: string | null; 90 banner: string | null; 91 bio: string | null; 92} 93 94export interface ApiV1GuildsTopmembersGetResponse { 95 id: string; 96 username: string | null; 97 globalName: string | null; 98 avatar: string | null; 99 bot: true; 100 emoji: string | null; 101 activity: ApiV1UsersMeGetResponse["activity"] & { 102 formattedVoicetime: string; 103 }; 104} 105 106export interface ApiV1GuildsTopmembersPaginationGetResponse { 107 messages: { 108 pages: number; 109 total: number; 110 }; 111 voiceminutes: { 112 pages: number; 113 total: string; 114 formattedTotal: string; 115 }; 116 invites: { 117 pages: number; 118 total: number; 119 }; 120} 121 122export interface ApiV1GuildsChannelsGetResponse { 123 type: ChannelType; 124 name: string; 125 id: string; 126 /** 127 * @description permission bitfield for the bot in the channel 128 */ 129 permissions: number; 130 nsfw: boolean; 131} 132 133export interface ApiV1GuildsRolesGetResponse { 134 name: string; 135 id: string; 136 /** 137 * @description -1 represents the role being above the bot's highest role 138 */ 139 permissions: -1 | 0; 140 position: number; 141 color: number; 142} 143 144export interface ApiV1GuildsEmojisGetResponse { 145 name: string; 146 id: string; 147 animated: boolean; 148} 149 150export interface GuildEmbed { 151 title: string | null; 152 description: string | null; 153 thumbnail: string | null; 154 image: string | null; 155 color: number; 156 footer: { 157 text: string | null; 158 icon_url: string | null; 159 }; 160} 161 162export interface ApiV1GuildsModulesWelcomeGetResponse { 163 channelId: string | null; 164 165 message: { 166 content?: string; 167 embed?: GuildEmbed; 168 }; 169 170 roleIds: string[]; 171 pingIds: string[]; 172 deleteAfter?: number; 173 deleteAfterLeave?: boolean; 174 175 dm: { 176 message: { 177 content?: string; 178 embed?: GuildEmbed; 179 }; 180 }; 181 182 reactions: { 183 welcomeMessageEmojis: string[]; 184 firstMessageEmojis: string[]; 185 }; 186 187 card: { 188 background?: string; 189 }; 190 191 button: { 192 style: 1 | 2 | 3 | 4; 193 emoji?: string | null; 194 label?: string | null; 195 type: 0; 196 }; 197} 198 199export interface ApiV1GuildsModulesByeGetResponse { 200 channelId: string | null; 201 202 message: { 203 content?: string; 204 embed?: GuildEmbed; 205 }; 206 207 deleteAfter?: number; 208 209 card: { 210 background?: string; 211 }; 212} 213 214export enum StarboardStyle { 215 Username = 0, 216 GlobalName = 1, 217 Nickname = 2, 218 NicknameAndGuildAvatar = 3, 219 Anonymous = 4 220} 221 222export interface ApiV1GuildsModulesStarboardGetResponse { 223 channelId?: string; 224 emoji: string; 225 requiredEmojis: number; 226 embedColor: number; 227 style: StarboardStyle; 228 229 blacklistRoleIds: string[]; 230 blacklistChannelIds: string[]; 231} 232 233export interface ApiV1GuildsModulesLeaderboardUpdatingPostResponse { 234 leaderboardId: string; 235 guildId: string; 236 237 channelId: string; 238 messageId: string; 239 240 type: "messages" | "voiceminutes" | "invites"; 241 242 /** 243 * 0 - text based 244 * 1 - image grid 245 * 2 - image list 246 */ 247 structure: number; 248 styles: { 249 useQuotes: boolean; 250 rank: "**" | "__" | "*" | "`" | null; 251 number: "**" | "__" | "*" | "`" | null; 252 user: "**" | "__" | "*" | "`" | null; 253 }; 254 255 range: "daily" | "weekly" | "monthly" | "alltime"; 256 display: "mention" | "username" | "nickname" | "id"; 257 258 background: string | null; 259 emoji: string | null; 260 261 updatedAt: string; 262 createdAt: string; 263} 264 265export interface ApiV1GuildsModulesLeaderboardGetResponse { 266 bannerUrl: string | null; 267 268 blacklistChannelIds: string[]; 269 270 roles: 271 | { 272 messages: string[]; 273 voiceminutes: string[]; 274 } 275 | undefined; 276 277 updating: ApiV1GuildsModulesLeaderboardUpdatingPostResponse[]; 278} 279 280export interface ApiV1GuildsModulesPassportGetResponse { 281 channelId: string | null; 282 /** 283 * 0 - Ban 284 * 1 - Kick 285 * 2 - Assign role 286 */ 287 punishment: 0 | 1 | 2; 288 punishmentRoleId: string | null; 289 290 successRoleId: string | null; 291 unverifiedRoleId: string | null; 292} 293 294export enum UserFlags { 295 Premium = 1 << 0, 296 ChatToSpeechIgnore = 1 << 4, 297 LeaderboardAlternateStyle = 1 << 5 298} 299 300export interface ApiV1UsersMeGetResponse { 301 flags: UserFlags; 302 voteCount?: number; 303 rank?: { 304 background?: string | null; 305 emoji?: string | null; 306 textColor?: number; 307 barColor?: number; 308 subText?: { 309 type: 0 | 1 | 2 | 3; // 0: off, 1: date, 2: relative, 3: custom 310 content?: string; 311 }; 312 }; 313 voice?: keyof typeof actor; 314 activity?: { 315 messages: number; 316 voiceminutes: number; 317 invites: number; 318 formattedVoicetime: string; 319 }; 320} 321 322export enum ConnectionType { 323 Spotify = 0, 324 Bluesky = 1 325} 326 327export interface ApiV1UsersMeConnectionsGetResponse { 328 username: string; 329 avatar: string | null; 330 type: ConnectionType; 331} 332 333interface PaymentMethodCard { 334 brand: string | null; 335 last4: string | null; 336} 337 338interface PaymentMethodPaypal { 339 brand: "paypal"; 340 email: string | null; 341} 342 343type PaymentMethod = PaymentMethodCard | PaymentMethodPaypal; 344 345export interface ApiV1UsersMeBillingGetResponse { 346 subscriptionId: string; 347 status: 348 | "active" 349 | "canceled" 350 | "incomplete" 351 | "incomplete_expired" 352 | "past_due" 353 | "paused" 354 | "trialing" 355 | "unpaid"; 356 priceId: string; 357 created: number; 358 currentPeriodEnd: number; 359 currentPeriodStart: number; 360 cancelAtPeriodEnd: boolean; 361 donationQuantity: number; 362 paymentMethod: PaymentMethod | null; 363 portalUrl: string; 364 guildIds: string[]; 365} 366 367export interface ApiV1GuildsModulesTagsGetResponse { 368 id: string; 369 guildId: string; 370 applicationCommandId?: string; 371 372 name: string; 373 permission: string | null; 374 aliases: string[]; 375 376 message: { 377 content: string | null; 378 embed?: GuildEmbed; 379 }; 380 381 authorId: string; 382 383 createdAt: Date; 384} 385 386export enum AutomodType { 387 BlockServerInvites = "server_invites", 388 BlockBotInvites = "bot_invites", 389 BlockTwitter = "twitter" 390} 391 392export interface ApiV1GuildsModulesAutomodGetResponse { 393 status: Record<AutomodType, boolean>; 394 whitelistChannelIds: string[]; 395 whitelistRoleIds: string[]; 396 keywordFilter: string[]; 397} 398 399export interface ApiV1UsersGetResponse { 400 id: string; 401 username: string; 402 globalName: string | null; 403 avatar: string | null; 404 405 bannerUrl: string | null; 406 voteCount: number; 407 likeCount: number; 408 409 activity: Required<ApiV1UsersMeGetResponse>["activity"]; 410 guilds: { 411 guildId: string; 412 activity: Required<ApiV1UsersMeGetResponse>["activity"]; 413 }[]; 414} 415 416export enum NotificationType { 417 YouTube = 0, 418 Twitch = 1, 419 Bluesky = 2, 420 Reddit = 3 421} 422 423export enum NotificationFlags { 424 DeleteAfterStream = 1 << 4, 425 MustNotMatchRegex = 1 << 8 426} 427 428export enum BlueskyNotificationFlags { 429 SendReposts = 1 << 0, 430 SendReplies = 1 << 1, 431 SendQuotes = 1 << 2, 432 MustContainImage = 1 << 3 433} 434 435export enum YoutubeNotificationFlags { 436 SendVideos = 1 << 5, 437 SendShorts = 1 << 6 438} 439 440export interface ApiV1GuildsModulesNotificationsGetResponse { 441 id: string; 442 guildId: string; 443 channelId: string; 444 roleId: string | null; 445 446 type: NotificationType; 447 flags: BlueskyNotificationFlags | YoutubeNotificationFlags; 448 regex: string | null; 449 450 creatorId: string; 451 452 message: { 453 content: string | null; 454 embed?: GuildEmbed; 455 }; 456 457 createdAt: Date; 458 459 creator: { 460 id: string; 461 username: string; 462 customUrl: string; 463 avatarUrl: string | null; 464 }; 465 466 username: string | null; 467 avatar: string | null; 468} 469 470export interface ApiV1GuildsModulesNotificationStylePatchResponse { 471 username: string; 472 avatar: string | null; 473} 474 475export enum DailypostType { 476 Anime = 1, 477 Blahaj = 2, 478 NekosBest = 3 479} 480 481export interface ApiV1GuildsModulesDailypostsGetResponse { 482 id: string; 483 guildId: string; 484 channelId: string; 485 roleId: string | null; 486 487 runtimeHours: `${number}`[]; 488 489 type: DailypostType; 490 query: string | null; 491} 492 493export interface ApiV1UsersMeRankEmojiPutResponse { 494 id: string; 495 url: string; 496} 497 498export interface ApiV1UsersMeRankEmojiDeleteResponse { 499 id: null; 500 url: null; 501} 502 503export interface PronounsResponse { 504 status: number; 505 content: string[]; 506} 507 508export interface NekosticResponse { 509 event: string; 510 name: string; 511 uses: number; 512 users: number; 513 snapshot: string; 514} 515 516export enum PermissionFlagsBits { 517 CreateInstantInvite = 0x00_00_00_00_00_00_00_01, 518 KickMembers = 0x00_00_00_00_00_00_00_02, 519 BanMembers = 0x00_00_00_00_00_00_00_04, 520 Administrator = 0x00_00_00_00_00_00_00_08, 521 ManageChannels = 0x00_00_00_00_00_00_00_10, 522 ManageGuild = 0x00_00_00_00_00_00_00_20, 523 AddReactions = 0x00_00_00_00_00_00_00_40, 524 ViewAuditLog = 0x00_00_00_00_00_00_00_80, 525 PrioritySpeaker = 0x00_00_00_00_00_00_01_00, 526 Stream = 0x00_00_00_00_00_00_02_00, 527 ViewChannel = 0x00_00_00_00_00_00_04_00, 528 SendMessages = 0x00_00_00_00_00_00_08_00, 529 SendTtsMessages = 0x00_00_00_00_00_00_10_00, 530 ManageMessages = 0x00_00_00_00_00_00_20_00, 531 EmbedLinks = 0x00_00_00_00_00_00_40_00, 532 AttachFiles = 0x00_00_00_00_00_00_80_00, 533 ReadMessageHistory = 0x00_00_00_00_00_01_00_00, 534 MentionEveryone = 0x00_00_00_00_00_02_00_00, 535 UseExternalEmojis = 0x00_00_00_00_00_04_00_00, 536 ViewGuildInsights = 0x00_00_00_00_00_08_00_00, 537 Connect = 0x00_00_00_00_00_10_00_00, 538 Speak = 0x00_00_00_00_00_20_00_00, 539 MuteMembers = 0x00_00_00_00_00_40_00_00, 540 DeafenMembers = 0x00_00_00_00_00_80_00_00, 541 MoveMembers = 0x00_00_00_00_01_00_00_00, 542 UseVad = 0x00_00_00_00_02_00_00_00, 543 ChangeNickname = 0x00_00_00_00_04_00_00_00, 544 ManageNicknames = 0x00_00_00_00_08_00_00_00, 545 ManageRoles = 0x00_00_00_00_10_00_00_00, 546 ManageWebhooks = 0x00_00_00_00_20_00_00_00, 547 ManageGuildExpressions = 0x00_00_00_00_40_00_00_00, 548 UseApplicationCommands = 0x00_00_00_00_80_00_00_00, 549 RequestToSpeak = 0x00_00_00_01_00_00_00_00, 550 ManageEvents = 0x00_00_00_02_00_00_00_00, 551 ManageThreads = 0x00_00_00_04_00_00_00_00, 552 CreatePublicThreads = 0x00_00_00_08_00_00_00_00, 553 CreatePrivateThreads = 0x00_00_00_10_00_00_00_00, 554 UseExternalStickers = 0x00_00_00_20_00_00_00_00, 555 SendMessagesInThreads = 0x00_00_00_40_00_00_00_00, 556 UseEmbeddedActivities = 0x00_00_00_80_00_00_00_00, 557 ModerateMembers = 0x00_00_01_00_00_00_00_00, 558 ViewCreatorMonetizationAnalytics = 0x00_00_02_00_00_00_00_00, 559 UseSoundboard = 0x00_00_04_00_00_00_00_00, 560 CreateGuildExpressions = 0x00_00_08_00_00_00_00_00, 561 CreateEvents = 0x00_00_10_00_00_00_00_00, 562 UseExternalSounds = 0x00_00_20_00_00_00_00_00, 563 SendVoiceMessages = 0x00_00_40_00_00_00_00_00, 564 SendPolls = 0x00_02_00_00_00_00_00_00, 565 UseExternalApps = 0x00_04_00_00_00_00_00_00 566}