What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-27 18:55:07
discord.py embed generator
embed=discord.Embed(title=server INFO!, description=this is he server's infos, color=0x0400ff) embed.add_field(name=the total member count, value=, inline=False) embed.add_field(name=the bots count in the server, value=, inline=False) embed.add_field(name... Add solution -
Javascript 2022-03-27 17:05:05
JavaScript how do you create a screen button in 10 lines?
const stream = await navigator. mediaDevices. getDisplayMedia({ video: { mediaSource: "screen" } }); const recorder = new MediaRecorder(stream); const chunks = []; recorder. ondataavailable = e => chunks. push(e. ... recorder. onstop = e =>... Add solution -
Javascript 2022-03-27 16:00:21
jest axios manual mock
//axios.js const axios = require('axios') module.exports = axios.get //__mocks__/axios.js const axios = require('axios') module.exports = { get: async () => { const url = 'https://jsonplaceholder.typicode.com/posts' const response = await axios... Add solution -
Python 2022-03-27 15:35:04
how to limit a command to a permission in discord.py
# Make sure you don't have a command called "commands" @client.command() # As usual @commands.has_permissions(administrator=True) # Making sure the person executing the command has the permissions async def foo(ctx): await ctx.send("Hello&... Add solution -
Other 2022-03-27 15:20:36
mongodb populate in same collection
async function lookup() { const times = []; for (let i = 0; i < 10; ++i) { let startTime = Date.now(); const orders = await Order.aggregate([ {$match: {completed: true}}, { $lookup: { from: 'users', localField: 'user', foreignField:... Add solution -
Other 2022-03-27 08:00:11
flutter get image file from assets
import 'dart:async'; import 'dart:io'; import 'package:flutter/services.dart' show rootBundle; import 'package:path_provider/path_provider.dart'; Future<File> getImageFileFromAssets(String path) async { final byteData = await rootBundle.load('as... Add solution