45
46 }
47
48 }).catch((error:any) => { 49
50 console.log(error);
51
22 const pathForYtRequest = "https://youtube.googleapis.com/youtube/v3/videos?part=statistics&id=hr-325mclek&key=" + key;
23
24 await axios.get(pathForYtRequest)
25 .then(async (response:any) => { 26
27 //console.log(response.data)
28
219commands.forEach(async command => {
220 await interaction
221.createApplicationCommand(command)
222.then((output:any) => {223 console.log(output);
224
225 console.error(JSON.stringify(output.errors))
4const id = parentPort.workerData.id;
5const optionsObject = parentPort.workerData.optionsObject;
6
7ytChart(id, optionsObject).then((result: any) => {8 parentPort.postMessage(result);
9});
712 pointy);
713 ctxSubYLineLegend.stroke();
714
715 var nameOfNumberSmall: any = countsmally; 716
717 if (countsmally % 1000) {
718 if (locale === "kr" || locale === "zh-CN" || locale === "zh-TW") {
60 timeRange?: number;
61 locale?: any;
62 publishedAt?: any;
63 subtitle?: any; 64}
65
66export async function imageGeneratorFunction(optionsForImageGen: imagegeninterface) {
59 beginningTime?: number;
60 timeRange?: number;
61 locale?: any;
62 publishedAt?: any; 63 subtitle?: any;
64}
65
58 cassandratimedone?: number;
59 beginningTime?: number;
60 timeRange?: number;
61 locale?: any; 62 publishedAt?: any;
63 subtitle?: any;
64}
54 leastAndGreatestObject: any;
55 isBlocked: boolean;
56 titletext: string;
57 arrayOfStats: Array<any>; 58 cassandratimedone?: number;
59 beginningTime?: number;
60 timeRange?: number;
51interface imagegeninterface {
52 numberOfRows: number;
53 viewRange: number;
54 leastAndGreatestObject: any; 55 isBlocked: boolean;
56 titletext: string;
57 arrayOfStats: Array<any>;
37 addOnPoints?: AddOnPointsEntity[] | null;
38 publishedAt?: Date;
39 locale?: any;
40 subtitle?: any; 41}
42
43interface AddOnPointsEntity {
36 [key: string]: any;
37 addOnPoints?: AddOnPointsEntity[] | null;
38 publishedAt?: Date;
39 locale?: any; 40 subtitle?: any;
41}
42
33
34interface optionsInterface {
35 channelId?: string;
36 [key: string]: any; 37 addOnPoints?: AddOnPointsEntity[] | null;
38 publishedAt?: Date;
39 locale?: any;
170 }
171}
172
173export async function youtubeVideoStatsInteraction(interaction: any, config: any) {174
175 // Defer to send an ephemeral reply later
176 interaction.deferReply()
170 }
171}
172
173export async function youtubeVideoStatsInteraction(interaction: any, config: any) {174
175 // Defer to send an ephemeral reply later
176 interaction.deferReply()
126}
127
128
129export async function youtubeVideoButtonInteraction(interaction: ButtonInteraction, config:any) {130 // Defer to send an ephemeral reply later
131 interaction.deferReply()
132 .then(console.log)
218 ]
219 };
220
221 var contentOfMessageReply: any;222
223
224 if (successimage) {
71
72 console.log('promise start')
73
74 var promiseresults: any = await Promise.allSettled([ 75 axios.get(pathForChannelOfVideoRequest),
76 ytChart(body.items[0].id, {
77 channelId: body.items[0].snippet.channelId,
35
36interface showTopVotersArgsInteraction {
37 interaction: CommandInteraction;
38 client: any; 39}
40
41export async function showListOfVotersTimes(voteArgs: showTopVotersArgs) {
30interface showTopVotersArgs {
31 message: Message;
32 [key: string]: any;
33 client: any; 34}
35
36interface showTopVotersArgsInteraction {
29
30interface showTopVotersArgs {
31 message: Message;
32 [key: string]: any; 33 client: any;
34}
35
8 individualservertodoeachban: any,
9 eachBannableUserRow: any,
10 unknownuserlocalarray: any,
11 toBanReason: any 12}
13
14export async function strikeBanHammer(options: optionsInterface) {
7interface optionsInterface {
8 individualservertodoeachban: any,
9 eachBannableUserRow: any,
10 unknownuserlocalarray: any, 11 toBanReason: any
12}
13
6
7interface optionsInterface {
8 individualservertodoeachban: any,
9 eachBannableUserRow: any, 10 unknownuserlocalarray: any,
11 toBanReason: any
12}
5let fileOfBanTimeouts = editJsonFile(`${__dirname}/../../putgetbanstimeout.json`);
6
7interface optionsInterface {
8 individualservertodoeachban: any, 9 eachBannableUserRow: any,
10 unknownuserlocalarray: any,
11 toBanReason: any
The any
type can sometimes leak into your codebase. TypeScript compiler skips the type checking of the any
typed variables, so it creates a potential safety hole, and source of bugs in your codebase. We recommend using unknown
or never
type variable.
In TypeScript, every type is assignable to any
. This makes any
a top type (also known as a universal supertype) of the type system.
The any
type is essentially an escape hatch from the type system. As developers, this gives us a ton of freedom: TypeScript lets us perform any operation we want on values of type any
without having to perform any checking beforehand.
The developers should not assign any
typed value to variables and properties, which can be hard to pick up on, especially from the external library; instead, developers can use the never
or unknown
type variable.
Bad Practice
const age: any = 'seventeen';
const ages: any[] = ['seventeen'];
const ages: Array<any> = ['seventeen'];
function greet(): any {}
function greet(): any[] {}
function greet(): Array<any> {}
function greet(): Array<Array<any>> {}
function greet(param: Array<any>): string {}
function greet(param: Array<any>): Array<any> {}
Recommended
const age: number = 17;
const ages: number[] = [17];
const ages: Array<number> = [17];
function greet(): string {}
function greet(): string[] {}
function greet(): Array<string> {}
function greet(): Array<Array<string>> {}
function greet(param: Array<string>): string {}
function greet(param: Array<string>): Array<string> {}