Giter Club home page Giter Club logo

qbot-plugins's People

Contributors

amnobcop avatar brandoge91 avatar wilyt1 avatar yogurtsyum avatar zachariapopcorn avatar

Stargazers

 avatar

Watchers

 avatar

qbot-plugins's Issues

viewsuspensions Error

TSError: ⨯ Unable to compile TypeScript:
src/commands/suspensions/viewsuspensions.ts.ts:31:21 - error TS2322: Type '{ type: "role"; id: string[]; value: true; }' is not assignable to type 'CommandPermission'.
Object literal may only specify known properties, and 'id' does not exist in type 'CommandPermission'.

31 id: config.permissions.ranking,

FIX

import { discordClient, robloxClient, robloxGroup } from '../../main';
import { CommandContext } from '../../structures/addons/CommandAddons';
import { Command } from '../../structures/Command';
import {
    getInvalidRobloxUserEmbed,
    getRobloxUserIsNotMemberEmbed,
    getSuccessfulUnsuspendEmbed,
    getUnexpectedErrorEmbed,
    getVerificationChecksFailedEmbed,
    getRoleNotFoundEmbed,
    getNotSuspendedEmbed,
    getAlreadySuspendedEmbed,
    noSuspendedRankLog,
    mainColor,
} from '../../handlers/locale';
import { config } from '../../config';
import { provider } from '../../database/router';
import { MessageEmbed } from 'discord.js';


class ViewSuspensionsCommand extends Command {
    constructor() {
        super({
            trigger: 'viewsuspensions',
            description: 'Allows the viewing of all concurrent suspensions.',
            type: 'ChatInput',
            module: 'roblox',
            permissions: [
                {
                    type: 'role',
                    id: config.permissions.ranking,
                    value: true,
                }
            ]
        });
    }

    async run(ctx: CommandContext) {
        if(!config.database.enabled) return ctx.reply({ embeds: [ getUnexpectedErrorEmbed() ] });
        let isThere;
        const suspensions = await provider.findSuspendedUsers();
        let mainEmbed = new MessageEmbed();
        mainEmbed.setTimestamp();
        mainEmbed.setColor(mainColor);
        mainEmbed.setTitle('Current Suspensions');
        for (var i in suspensions) {
            isThere = true;
            const user = await robloxClient.getUser(suspensions[i].robloxId);

            mainEmbed.addField(user.name,`Expires on ${suspensions[i].suspendedUntil.toDateString()}`);
        }
        if (isThere == false) mainEmbed.setDescription("**No Current Suspensions!**");
        return ctx.reply({embeds: [mainEmbed]});
    }
}

export default ViewSuspensionsCommand;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.