Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 短縮形エイリアスの追加 #559

Merged
merged 3 commits into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/service/command/guild-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export interface GuildStatsRepository {
}

const SCHEMA = {
names: ['guildinfo', 'serverinfo'],
names: ['guildinfo', 'serverinfo', 'guild', 'server'],
subCommands: {}
} as const;

Expand Down
10 changes: 5 additions & 5 deletions src/service/command/role-info.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ describe('RoleRank', () => {
value: '101',
inline: true
},
{
name: '作成日時',
value: `<t:20200>`,
inline: true
},
{
name: '所属人数',
value: `3人`,
Expand All @@ -63,6 +58,11 @@ describe('RoleRank', () => {
name: 'カラーコード',
value: '1a1d1a',
inline: true
},
{
name: '作成日時',
value: `<t:20200>(<t:20200:R>)`,
inline: true
}
],
thumbnail: undefined
Expand Down
14 changes: 7 additions & 7 deletions src/service/command/role-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
CommandResponder,
HelpInfo
} from './command-message.js';
import { createTimestamp } from '../../model/create-timestamp.js';

export type RoleIcon =
| {
Expand All @@ -27,7 +28,7 @@ export interface RoleStatsRepository {
}

const SCHEMA = {
names: ['roleinfo'],
names: ['roleinfo', 'role'],
subCommands: {},
params: [
{
Expand Down Expand Up @@ -66,18 +67,12 @@ export class RoleInfo implements CommandResponder<typeof SCHEMA> {
{ color, createdAt, icon, numOfMembersBelonged, position }: RoleStats,
roleId: string
) {
const timeStampSeconds = Math.floor(createdAt.getTime() / 1000);
const fields = [
{
name: 'ID',
value: `${roleId}`,
inline: true
},
{
name: '作成日時',
value: `<t:${timeStampSeconds}>`,
inline: true
},
{
name: '所属人数',
value: `${numOfMembersBelonged}人`,
Expand All @@ -92,6 +87,11 @@ export class RoleInfo implements CommandResponder<typeof SCHEMA> {
name: 'カラーコード',
value: color,
inline: true
},
{
name: '作成日時',
value: createTimestamp(createdAt),
inline: true
}
];
if (icon && icon.isUnicode) {
Expand Down
2 changes: 1 addition & 1 deletion src/service/command/user-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface UserStatsRepository {
}

const SCHEMA = {
names: ['userinfo'],
names: ['userinfo', 'user'],
subCommands: {},
params: [
{
Expand Down