this command will make 7 color roles at a time .. those colors are π ( RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, VIOLET)
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const sleep = async (ms) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, ms || 0);
});
};
const prefix = `c!`; // set your prefix
const owner = `123456789 `; // paste your discord user id
if (context.params.event.author.id === `${owner}`) {
if (context.params.event.content.startsWith(`${p}rainbow`)) {
let red = await lib.discord.guilds['@0.2.4'].roles.create({
guild_id: `${context.params.event.guild_id}`,
name: `RED`,
color: 0xff0000,
hoist: false,
mentionable: false,
});
await lib.discord.channels['@0.3.2'].messages.reactions.create({
emoji: `π΄`,
message_id: `${context.params.event.id}`,
channel_id: `${context.params.event.channel_id}`,
});
await 1000;
let msg = await lib.discord.channels['@0.1.2'].messages.create({
channel_id: context.params.event.channel_id,
content: ``,
embed: {
type: `rich`,
title: `π Color roles`,
description: `
Created Role List\n
π΄ -> RED `,
color: 0xff0000,
},
});
let orange = await lib.discord.guilds['@0.2.4'].roles.create({
guild_id: `${context.params.event.guild_id}`,
name: `ORANGE`,
color: 0xff7f00,
hoist: false,
mentionable: false,
});
await lib.discord.channels['@0.3.2'].messages.reactions.create({
emoji: `π `,
message_id: `${context.params.event.id}`,
channel_id: `${context.params.event.channel_id}`,
});
await 1000;
await lib.discord.channels['@0.3.2'].messages.update({
message_id: `${msg.id}`,
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
type: `rich`,
title: `π Color roles`,
description: `
Created Role List\n
π΄ -> RED
π -> ORANGE`,
color: 0xff7f00,
},
});
let yellow = await lib.discord.guilds['@0.2.4'].roles.create({
guild_id: `${context.params.event.guild_id}`,
name: `YELLOW`,
color: 0xffff00,
hoist: false,
mentionable: false,
});
await lib.discord.channels['@0.3.2'].messages.reactions.create({
emoji: `π‘`,
message_id: `${context.params.event.id}`,
channel_id: `${context.params.event.channel_id}`,
});
await 1000;
await lib.discord.channels['@0.3.2'].messages.update({
message_id: `${msg.id}`,
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
type: `rich`,
title: `π Color roles`,
description: `
Created Role List\n
π΄ -> RED
π -> ORANGE
π‘ -> YELLOW`,
color: 0xffff00,
},
});
let green = await lib.discord.guilds['@0.2.4'].roles.create({
guild_id: `${context.params.event.guild_id}`,
name: `GREEN`,
color: 0x00ff00,
hoist: false,
mentionable: false,
});
await lib.discord.channels['@0.3.2'].messages.reactions.create({
emoji: `π’`,
message_id: `${context.params.event.id}`,
channel_id: `${context.params.event.channel_id}`,
});
await lib.discord.channels['@0.3.2'].messages.update({
message_id: `${msg.id}`,
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
type: `rich`,
title: `π Color roles`,
description: `
Created Role List\n
π΄ -> RED
π -> ORANGE
π‘ -> YELLOW
π’ -> GREEN`,
color: 0x00ff00,
},
});
let blue = await lib.discord.guilds['@0.2.4'].roles.create({
guild_id: `${context.params.event.guild_id}`,
name: `BLUE`,
color: 0x0000ff,
hoist: false,
mentionable: false,
});
await lib.discord.channels['@0.3.2'].messages.reactions.create({
emoji: `π΅`,
message_id: `${context.params.event.id}`,
channel_id: `${context.params.event.channel_id}`,
});
await 1000;
await lib.discord.channels['@0.3.2'].messages.update({
message_id: `${msg.id}`,
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
type: `rich`,
title: `π Color roles`,
description: `
Created Role List\n
π΄ -> RED
π -> ORANGE
π‘ -> YELLOW
π’ -> GREEN
π΅ -> BLUE`,
color: 0x0000ff,
},
});
let indigo = await lib.discord.guilds['@0.2.4'].roles.create({
guild_id: `${context.params.event.guild_id}`,
name: `INDIGO`,
color: 0x4b0082,
hoist: false,
mentionable: false,
});
await lib.discord.channels['@0.3.2'].messages.reactions.create({
emoji: `π`,
message_id: `${context.params.event.id}`,
channel_id: `${context.params.event.channel_id}`,
});
await 1000;
await lib.discord.channels['@0.3.2'].messages.update({
message_id: `${msg.id}`,
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
type: `rich`,
title: `π Color roles`,
description: `
Created Role List\n
π΄ -> RED
π -> ORANGE
π‘ -> YELLOW
π’ -> GREEN
π΅ -> BLUE
π -> INDIGO`,
color: 0x4b0082,
},
});
let violet = await lib.discord.guilds['@0.2.4'].roles.create({
guild_id: `${context.params.event.guild_id}`,
name: `VIOLET`,
color: 0x9400d3,
hoist: false,
mentionable: false,
});
await lib.discord.channels['@0.3.2'].messages.reactions.create({
emoji: `π`,
message_id: `${context.params.event.id}`,
channel_id: `${context.params.event.channel_id}`,
});
await 1000;
await lib.discord.channels['@0.3.2'].messages.update({
message_id: `${msg.id}`,
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
type: `rich`,
title: `π Color roles`,
description: `
Created Role List\n
π΄ -> RED
π -> ORANGE
π‘ -> YELLOW
π’ -> GREEN
π΅ -> BLUE
π -> INDIGO
π -> VIOLET`,
color: 0x9400d3,
},
});
await 1000;
await lib.discord.channels['@0.3.2'].messages.update({
message_id: `${msg.id}`,
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
type: `rich`,
title: `π Rainbow roles are ready now !!`,
description: `
β
Created Role List\n
π΄ -> RED
π -> ORANGE
π‘ -> YELLOW
π’ -> GREEN
π΅ -> BLUE
π -> INDIGO
π -> VIOLET`,
color: 0xfcfbfa,
},
});
}
}