matrix-org / matrix-appservice-discord

A bridge between Matrix and Discord.
Apache License 2.0
811 stars 152 forks source link

We should parse integers from options in adminme #282

Open Half-Shot opened 6 years ago

Half-Shot commented 6 years ago

https://github.com/Half-Shot/matrix-appservice-discord/blob/bc39208d2d8a35c758cb2f849ba975a671ee1298/tools/adminme.ts#L102

Sorunome commented 5 years ago

It appears options.power is already a number:

sorunome@sorunome-desktop repos/matrix-appservice-discord $ npm run adminme -- -p 12 -r blah -u blubb                                                                                                                                        1

> matrix-appservice-discord@0.3.0 adminme /home/sorunome/repos/matrix-appservice-discord
> node ./build/tools/adminme.js "-p" "12" "-r" "blah" "-u" "blubb"

Unable to load crypto module: crypto will be disabled: Error: global.Olm is not defined
12
number

with

console.log(options.power);
console.log(typeof options.power);

As we have

    {
        alias: "p",
        defaultValue: 100,
        description: "The power to set",
        name: "power",
        type: Number,
        typeLabel: "<0-100>",
    },

so....the problem is upstream!

Half-Shot commented 5 years ago

Yay! file a request to -bridge or js-sdk I guess.