Skip to content

Commit b72c16c

Browse files
Reformatted some code
1 parent 0636b77 commit b72c16c

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/COMMAND-WIKI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314

315315
## uwflow info
316316
- **Aliases:** `information`, `i`
317-
- **Description:** Get info about courses using UWFlow.
317+
- **Description:** Get course information
318318
- **Examples:**<br>`.uwflow info cs135`<br>`.uwflow information cs246`<br>`.uwflow i cs240`
319319
- **Options:**
320320
- **Subcommands:** None

src/commandDetails/uwflow/info.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ const uwflowInfoExecuteCommand: SapphireMessageExecuteType = async (
2727
// Standardize the course code (i.e. cs 135, CS135, CS 135 becomes cs135 for the GraphQL query)
2828
const courseCode = <string>courseCodeArg.split(' ').join('').toLowerCase();
2929

30-
const courseInfo: courseInfo | number = await getCourseInfo(courseCode);
30+
const result: courseInfo | number = await getCourseInfo(courseCode);
3131

3232
// If mistyped course code or course doesn't exist
33-
if (courseInfo === -1) {
33+
if (result === -1) {
3434
const errorDesc = 'Oops, that course does not exist!';
3535
const courseEmbed = new EmbedBuilder()
3636
.setColor('Red')
@@ -39,14 +39,14 @@ const uwflowInfoExecuteCommand: SapphireMessageExecuteType = async (
3939
return { embeds: [courseEmbed] };
4040
}
4141

42-
const actualCourseInfo = <courseInfo>courseInfo;
42+
const info = <courseInfo>result;
4343

44-
const code = actualCourseInfo.code.toUpperCase();
45-
const name = actualCourseInfo.name;
46-
const description = actualCourseInfo.description;
47-
const liked = (actualCourseInfo.liked * 100).toFixed(2);
48-
const easy = (actualCourseInfo.easy * 100).toFixed(2);
49-
const useful = (actualCourseInfo.useful * 100).toFixed(2);
44+
const code = info.code.toUpperCase();
45+
const name = info.name;
46+
const description = info.description;
47+
const liked = (info.liked * 100).toFixed(2);
48+
const easy = (info.easy * 100).toFixed(2);
49+
const useful = (info.useful * 100).toFixed(2);
5050

5151
const courseEmbed = new EmbedBuilder()
5252
.setColor('Green')
@@ -66,7 +66,7 @@ const uwflowInfoExecuteCommand: SapphireMessageExecuteType = async (
6666
export const uwflowInfoCommandDetails: CodeyCommandDetails = {
6767
name: 'info',
6868
aliases: ['information', 'i'],
69-
description: 'Get info about courses using UWFlow.',
69+
description: 'Get course information',
7070
detailedDescription: `**Examples:**
7171
\`${container.botPrefix}uwflow info cs135\`
7272
\`${container.botPrefix}uwflow information cs246\`

0 commit comments

Comments
 (0)