const Discord = require('discord.js')
const numerals = {
"M": 1000,
"CM": 900,
"D": 500,
"CD": 400,
"C": 100,
"XC": 90,
"L": 50,
"XL": 40,
"X": 10,
"IX": 9,
"V": 5,
"IV": 4,
"I": 1
}
exports.run = (client, message, args) => {
if(!args[0]) {
const embed = new Discord.RichEmbed()
.setDescription('Lütfen geçerli bir sayı yazın!')
.setColor("RANDOM")
.setTimestamp()
message.channel.send({embed})
return
}
if(isNaN(args[0])) {
const embed = new Discord.RichEmbed()
.setDescription(`Lütfen bir sayı girin!`)
.setColor("RANDOM")
.setTimestamp()
message.channel.send({embed})
return
}
if(args[0] > 999999) {
const embed = new Discord.RichEmbed()
.setDescription(`Lütfen 999999 veya daha düşük bir sayı girin!!`)
.setColor("RANDOM")
.setTimestamp()
message.channel.send({embed})
return
}
const sayi = args[0]
if(args[0] === 0) {
const embed = new Discord.RichEmbed()
.setDescription('Karşılıksız')
.setColor("RANDOM")
.setTimestamp()
message.channel.send({embed})
return
}
let result = '';
for (const [numeral, value] of Object.entries(numerals)) {
while (args[0] >= value) {
result += numeral;
args[0] -= value;
}
}
const embed = new Discord.RichEmbed()
.addField('Yazılan Sayı', sayi)
.addField('Romen Karşılığı', result)
.setColor("RANDOM")
.setTimestamp()
message.channel.send({embed})
}
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ['roman'],
permLevel: 0
}
exports.help = {
name: 'romen',
description: 'Yazdığınız sayının romen karşılığını yazar.',
usage: 'romen [sayı]'
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}