@bot.command()
async def роль(ctx):
await ctx.send("**`[✅ | Запрос отправлен] Запрос был успешно отправлен. Ожидайте проверку заявки модератором`**")
channel = bot.get_channel(1043881287842275401)
message = await channel.send("**`Была создана заявка на выдачу роли! Одобрить - ✅ | Отклонить - ❌ | Запросить доказательства - `**")
await message.add_reaction('✅')
await message.add_reaction('❌')
await message.add_reaction('')
@bot.event
async def on_raw_reaction_add(payload):
if payload.user_id == ID_БОТА:
return
if payload.channel_id == 1043881287842275401:
if str(payload.emoji) == "✅":
channel1 = bot.get_channel(1043881288504971269)
await channel1.send(f"**`[✅ | Одобрение] модератор`** {payload.member.mention} **`одобрил ваш запрос на получение роли`**")
const {Client, Intents} = require("discord.js");
const config = require('./config.json')
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MEMBERS] });
client.login(config.token);
const arr = [];
const afkRoleId = "967509853557891152"
const noAfkRoleId = "967509879642275851"
client.on("messageCreate", async (message) => {
const arrMember = arr.filter((member) => member.id === message.member.id);
if (arrMember.length > 0) {
delete arr.filter((member) => member.id === message.member.id)
}
await message.member.roles.remove(afkRoleId)
await message.member.roles.add(noAfkRoleId)
arr.push({id: message.member.id})
const sec = 3; // Запуск через 3 секунды
setTimeout(() => {
const member = arr.filter((member) => member.id === message.member.id)
if (member.length > 0) {
message.member.roles.add(afkRoleId)
message.member.roles.remove(noAfkRoleId)
}
}, sec * 1000)
})
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MEMBERS] });
client.on("guildMemberAdd", async (member) => {
await member.roles.add("ID роли")
})
const token = "Your Token" // Bearer токен
var details = {
'token': token,
'client_id': 'Your clientId',
'client_secret': 'Your clientSecret'
};
var formBody = [];
for (var property in details) {
var encodedKey = encodeURIComponent(property);
var encodedValue = encodeURIComponent(details[property]);
formBody.push(encodedKey + "=" + encodedValue);
}
formBody = formBody.join("&");
const json = fetch('https://discord.com/api/v8/oauth2/token/revoke', {
method: 'POST',
headers: {
'Authorization': "Bearer " + token,
'Content-Type': 'application/x-www-form-urlencoded'
},
body: formBody
})
{
path: 'containers',
meta: {
title: 'containers',
type: 'endpointDocker'
},
component: Blank,
children: [
{
name: 'containerDockerEdit',
path: ':hash',
meta: {
title: 'edit',
type: 'endpointDocker'
},
props: true,
component: () => import('@/views/Docker/Containers/Edit')
},
{
name: 'containersDockerList',
path: '/',
meta: {
title: 'list',
type: 'endpointDocker',
hiddenInMenu: true
},
props: true,
component: () => import('@/views/Docker/Containers/Index')
}
]
}
breadcrumbs() {
const {matched} = this.$route
return matched.filter(route => !route.meta.hiddenInMenu).map((route, index) => {
const text = this.$vuetify.lang.t('$vuetify.menu.' + route.meta.title) ? this.$vuetify.lang.t('$vuetify.menu.' + route.meta.title) : ""
let to;
if (route.meta.type === 'endpointDocker') {
const url = this.$route.fullPath.split('/')
to =
index === matched.length - 1
? this.$route.path.replace(':id', url[1])
: route.path.replace(':id', url[1]) || route.redirect
} else {
to =
index === matched.length - 1
? this.$route.path
: route.path || route.redirect
}
return {
text: text,
to: to,
exact: true,
disabled: false
}
})
}
<input type="text" name="search" id="search" />
$('#search').keyup(function(){
$.ajax({
url: "...", // Адрес обработчика
data: $(this).serialize(),
success: function(e){
// Действие, которое будет происходить
}
})
});